-
-
Notifications
You must be signed in to change notification settings - Fork 114
Implement PEP 621 (pyproject.toml) and migrate to "src" layout #85
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
Comments
For two real world example see This projects don't have |
@buhtz Thx for the suggestion. This is something @paketb0te suggested in #9 (in addition to poetry), which I think you already saw. I put this on the backburner since I don't have a lot of experience packaging Python projects and wanted to prioritize functionality before overhauling the structure with something I wasn't super familiar with. Any chance you want to collaborate with @paketb0te on a PR for this? Otherwise it will probably be a bit before I can brush up on it and do it myself. |
@buhtz I am not sure I fully understand the advantages of using a To me it seems like the main advantage is that "The src layout helps prevent accidental usage of the in-development copy of the code." - but I am not sure where / how that applies to our use case 🤔 Could you elaborate a bit why you propose the Please note that I am not against this idea in any way, I just want to understand the reasons for it 😄 |
Thanks for asking back. I think I told but I repeat (in my lame English) to be sure you understood. btw: You can contact in me in German language if it might help. My primary reason to use src-layout really is that the "Python Packing Authority" say so. It is the recommended way today.
Me either. But what I understand from reading some things and in my own experience:
I'm sure that there are much more advantages. But they might be relevant only when you have bigger projects, with a CI pipeline and all that fancy stuff. I always tried to keep it as simple as possible. But my own projects are very tiny and there is no problem with that.
Might be because of my English but I don't understand the term "in-development copy of the code". Some short notes about pyproject.toml. I always had "problems" with the package meta data (version string, name, website url, stuff like this). I don't want to declare a version string on two different places. I want everything centralized in the toml file. But not all tools are able to handle that. But I also have IMHO elegant solution for this. In short my package does have a global
With that solution you can use everything you declared in your toml file in your python code. Not sure if there will come up a better solution from the python folks in the future. I have never shown that to a python pro, e.g. on their mailinglist. |
@buhtz thanks for the detailed response. |
I see no need to separate that steps but I also see no argument against separating them. I would suggest move to src-layout first. That also includes moving you unittest files into a separate folder called "test" or "tests". |
Hello again @paketb0te and @buhtz. When packaging the most recent release of git-sim and trying to upload to PyPI I started running into some errors (didn't save them unfortunately) that were due to the way git-sim is packaged. Like you both mentioned looks like pyproject.toml is the new supported way and using the setup.py is basically being deprecated. I was able to get around this by downgrading setuptools to version 58.2.0, but I think this is a big sign we should migrate the project now so that we can use the most up to date tools going forward. After reading the details of the "src" layout, it seems to be essentially the recommended way by PyPA, and since we already use editable install for our development process anyway, doesn't seem like there is a downside. Would either of you like to work on this?
FYI the test suite and our unit test stub have already been moved into a |
Dear initialcommit-io , I won't have resource in the next months. But I can help analyzing problems. Maybe you can try to reproduce your problem and offer your setup in a separate branch .Then I can have a look. |
Thank you. But I have a workaround for the issue for now, so I think we should spend more time actually doing the project.toml and src structure refactorings. @paketb0te Any chance you're interested in helping with this since you had originally mentioned it a few months ago? 😄 |
@initialcommit-io yeah, I can take a stab at it 😃 If there is any bigger work in progress, it would probably be smart to integrate / merge that into the dev branch before restructuring, otherwise I think the (later) merging will be more difficult then neccessary. |
Thanks @paketb0te !!! Yes the dev branch should be up to date with the latest changes. Mostly its stuff related to the e2e test suite, which could be useful to run for the first time in a real situation after making your changes 😸 |
@initialcommit-io there is |
Yup, should be! |
Closing since the migration to src layout and pyproject.toml was successful! Thanks again @paketb0te for making this happen. |
Please consider to migrate your pyhton project to the last state of the art packaging process using
pyproject.toml
file only.I'm aware that this might be a low prio issue currently.
Further reading:
Feel free to ask back if you have any questions.
The text was updated successfully, but these errors were encountered: