-
Notifications
You must be signed in to change notification settings - Fork 163
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
Migrate to pyproject.toml #1668
Conversation
The github actions configuration is under .github/workflows/ and tox is currently not used.
Ah cool, you beat me to it, I was just doing that but it takes a while to catch up on the docs :) |
I was going to propose to remove About the pyproject.toml file, here is what I cam up with atm:
Left todo here are
|
Yea I am also fighting the docs and working my way forward in small commits. I noticed that we import some data from |
I think we can hardcode the version string for now and do dynamic version strings in a separate PR, possibly after a release. It seems that setuptools can do this in two ways:
It seems that there is an easy way to do 2) and get the version string into sphinx and readthedocs without dupication. |
build-backend = "setuptools.build_meta" | ||
|
||
|
||
[tool.poetry] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
whoopsie, this seems to have broken the nix stuff...
The idea was to remove all poetry related configs and keep this file vanilla setuptools.
Would it suffice to adjust the nix script to reflect the namespace change?
I'll stop interfering with your branch now, sorry :)
FYI: this branch is based off yours here and implements the dynamic versioning and metadata: |
I see your argument that you lean towards setuptool vs portry because it is the more established tool. One advantage of poetry I like is the lock file. It makes the setup reproducible. No idea if and how setuptools can do this. (I know there is the requirements.yml file but is it as exact as the portry lock file?). Then again, if we advise our developers to create virtualenvs with |
This still keeps poetry as the default build backend.
There seems to be a race condition when running this cleanup on github actions which results in > FileNotFoundError: [Errno 2] No such file or directory: 'S.gpg-agent.ssh'
in pyproject.toml
@pazz contrary to my initial comment I now implemented the switch from poetry to setuptools completely in this branch. I think it is ready from my side. Can you test it on debian or some other non nix system. I am using nixos and that saves me from all the gpg>1.10 trouble. |
@pazz I only included one commit from your "dynamic-version" branch because the rest was a bit broken. If you rebase the branch on this branch now (or on master, I think we can merge) then you should be able to fix it. |
In principle I agree though, but personally I have never seen the actual benefit of reproducible setups in practice IIRC. No string feelings wither way really, but if poetry ultimately depends on setuptools and is one more step to do when setting things up from scratch I would prefer to cut it out.
yes, true. I think the PR as is is almost ready, except perhaps we want to leave the last two commits about version strings out? |
I removed the last two commits. SitenoteAbout the different python build backends and frontends I read a bit of history about distutils and setuptools and pip somewhere but I can't remember where. My uptake was that there are two tasks that need to be solved:
Poetry is for 2. and setuptools was for both but tries to stay in 1. in the future I think. They try to be a library for 1. and deprecate the command line use case for 2. (which was The section [build-system]
-requires = ["poetry-core"]
-build-backend = "poetry.core.masonry.api"
+requires = ["setuptools", "setuptools-scm"]
+build-backend = "setuptools.build_meta" This section allows tools from point 2 above to select the correct library for point 1 above. See also the Motivation of PEP 621. Or a longer overview / introduction for developers how want to select a backend/frontend for their python project: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
The plan behind this PR is to migrate as much info as possible from setup.* to pyproject.toml.
We can then decide if we want to support setuptools or poetry or both as our build system.