Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stance (or discussion) on src/ directory #320

Closed
ctheune opened this issue Jun 7, 2017 · 188 comments
Closed

Stance (or discussion) on src/ directory #320

ctheune opened this issue Jun 7, 2017 · 188 comments
Assignees
Labels
type: enhancement A self-contained enhancement or new feature

Comments

@ctheune
Copy link

ctheune commented Jun 7, 2017

Is there an official stance on the "src/" directory thing? I'm all for it (and @hynek seems to agree) but I haven't found any discussion or explanation about it from the PyPA. The guide doesn't mention it and the sample project doesn't use it. Even if the stance is "don't use it" (which I would disagree with) then I'd love to see this discussed in the official guide so we can refer to it when people need to make up their mind or argue it.

@ctheune
Copy link
Author

ctheune commented Jun 7, 2017

Some references on the discussion that support the "pro" argument:

@pfmoore
Copy link
Member

pfmoore commented Jun 7, 2017

I don't think there's a consensus on the best practice, and the packaging guide isn't really intended to cover general development practices, which this is. There's no discussion on testing or documentation, for similar reasons.

@theacodes
Copy link
Member

Based on the doc plan in #317, this is actually a good candidate for a discussion topic. I would be willing to accept a PR to add this topic.

@theacodes theacodes added type: enhancement A self-contained enhancement or new feature good first issue labels Jun 7, 2017
@pfmoore
Copy link
Member

pfmoore commented Jun 7, 2017

Nice, @jonparrott - I hadn't seen that doc plan. Agreed this would make a good discussion topic. Another one I've seen come up in the past is whether to put tests in the package or in a separate test directory.

@theacodes
Copy link
Member

@pfmoore for sure, I'd be happy to have that topic as well.

@theacodes
Copy link
Member

@ctheune if you or @hynek are interested in contributing this topic, I would love to review and merge it. :)

@pfmoore
Copy link
Member

pfmoore commented Jun 23, 2017

I'd also be interested in reviewing this. I tried a layout using src just recently and found there were some things that were fiddly to get right (coverage was one), so I have a test case I could use to see how the recommendations work in practice :-)

@hynek
Copy link

hynek commented Jun 23, 2017

Have you seen https://hynek.me/articles/testing-packaging/ Paul? I hoped to de-fiddle the process there...

@pfmoore
Copy link
Member

pfmoore commented Jun 23, 2017

@hynek Yes I have. The problem I had was not with combining coverage, but with the basic coverage output from a single tox environment. It's possible it was just lack of familiarity with running coverage under tox, but from what I recall the output had some rather badly nested directories, when I was after filenames relative to src (so mypkg/__init__.py). I backed out the implementation of coverage, so I don't have it to hand at the moment, but could reimplement it if needed.

@ctheune
Copy link
Author

ctheune commented Jun 28, 2017

Thanks for picking up that topic - happy to contribute although I can't promise to be very responsive at times (busy company and small child make my FLOSS contributions a bit spotty at the moment).

I haven't run into the coverage issue before - I usually have both a tox and non-tox pytest setup and ensure my coverage is right in the basic setup. I see the need for checking coverage of Python--version-specific code paths, though.

What's the next step for contributing here?

@theacodes
Copy link
Member

theacodes commented Jun 28, 2017 via email

@pradyunsg
Copy link
Member

Is anyone working on this right now?

@theacodes
Copy link
Member

theacodes commented Aug 25, 2017 via email

@ofek
Copy link
Contributor

ofek commented Sep 5, 2017

I really, really dislike this structure. It makes things a bit more complicated than necessary imo. Newcomers should be considered here.

@hynek
Copy link

hynek commented Sep 9, 2017 via email

@ofek
Copy link
Contributor

ofek commented Sep 9, 2017

@hynek More explicit is worse for beginners when they could rather have a simple packages=find_packages() 🙂

@hynek
Copy link

hynek commented Sep 10, 2017 via email

@theacodes
Copy link
Member

For beginners we'll likely have a new tutorial using flit as a starting point. Setuptools-style packaging would likely fall under guides, and a separate guide/discussion can be created around this topic.

@hynek
Copy link

hynek commented Sep 15, 2017

I'm not sure whether pushing for flit is the right way as long as it precludes the usage of tox.

@theacodes
Copy link
Member

I'm not sure whether pushing for flit is the right way as long as it precludes the usage of tox.

tox does a lot of weird stuff, but how does flit preclude using tox?

@hynek
Copy link

hynek commented Sep 15, 2017 via email

@theacodes
Copy link
Member

I think you can turn that off or use a different install command (though the later affects deps as well).

I definitely plan to try out flit significantly before writing the experimental tutorial and gathering feedback before considering making the experimental tutorial official. So this is really useful.

Also, shameless plug that tox isn't the only option.

@obestwalter
Copy link

but last time I checked tox needed a setup.py to work

No.

[tox]
skipsdist = True

[...]

... and you're golden.

@obestwalter
Copy link

@jonparrott interesting - quite new project also - how come you thought nox is needed? What's missing from tox? I am always interested in seeing how we can improve tox and maybe join forces, if you like open an issue or write on the list.

@theacodes
Copy link
Member

@obestwalter mostly just frustrated with using ini files. :)

@obestwalter
Copy link

obestwalter commented Sep 15, 2017

That's what I thought :D - also see tox-dev/tox#600 - sorry for hijacking this - I am quiete now ...

@theacodes
Copy link
Member

@obestwalter cool. :) I think there's room for both. If you ever want to chat about it feel free to reach out. :)

@pypa pypa unlocked this conversation Sep 30, 2022
@pypa pypa locked as resolved and limited conversation to collaborators Sep 30, 2022
@pradyunsg
Copy link
Member

This had fallen pretty low on my TODO list, but I finally got to filing the PR today: #1150

@pypa pypa unlocked this conversation Dec 20, 2022
@pypa pypa locked as resolved and limited conversation to collaborators Dec 20, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: enhancement A self-contained enhancement or new feature
Projects
None yet
Development

No branches or pull requests