-
Notifications
You must be signed in to change notification settings - Fork 182
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
DO NOT MERGE: trying setuptools PR #590
Conversation
henryiii
commented
Feb 9, 2022
- chore: delete setup.py
- DO NOT MERGE: trying PEP 621 directly
- DO NOT MERGE: try full PEP 621
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.
Hi @henryiii, thank you very much for testing this out!
I admit the errors are far from understandable... I have to review what is going on. Ideally the validation phase should tell you how to change pyproject.toml
accordingly. (I have to revisit https://github.com/abravalheri/validate-pyproject, I suspect I forgot to forbid non-standardised keys to the project
table, as was the case here with author
and requires
).
Could you try rebuilding with my suggestions? I am curious to see if the tests pass...
Something that might be interesting to you in future experiments: https://github.com/abravalheri/ini2toml can help to bootstrap pyproject.toml
from setup.cfg
(and then it can be further edited)
Co-authored-by: Anderson Bravalheri <andersonbravalheri+github@gmail.com>
Thanks, that seems to be it! It was being very picky about other things, so I assumed it would be catching things like that, so didn't check as carefully. It does check for extra keys in the
Yes, I noticed that after I did this, but this was a good experience (and looks like it might have been helpful!) |
Might be expected, but setuptools_scm is not working, |
Definitely! It helped to find a problem in
I will try to have a look on this later this weekend, thank you very much for pointing it out. In theory it should be no different. I have to double check if all the plugin hooks in setuptools are being called... |
Hi @henryiii, could you elaborate a bit more what is happening? I also can verify $ unzip -c dist/plumbum-1.7.3.dev31+g110c22f-py3-none-any.whl plumbum/version.py
Archive: dist/plumbum-1.7.3.dev31+g110c22f-py3-none-any.whl
inflating: plumbum/version.py
# coding: utf-8
# file generated by setuptools_scm
# don't change, don't track in version control
version = '1.7.3.dev31+g110c22f'
version_tuple = (1, 7, 3, 'dev31', 'g110c22f') and $ python -m setuptools_scm
1.7.3.dev31+g110c22f Is it supposed to work differently? |
I'm looking at https://github.com/tomerfiliba/plumbum/runs/5141354158?check_suite_focus=true Ahhh! That version number is broken on master. Sorry for the noise! I hate "try not to break things" defaults... (I think it works on releases, just not random builds) |
Now I see that the I wonder if that is happening because of a shallow clone? Locally after cloning your fork and switching to the $ git tag '1.8'
$ python -m build
...
Successfully built plumbum-1.8.tar.gz and plumbum-1.8-py3-none-any.whl
$ unzip -c dist/plumbum-1.8-py3-none-any.whl plumbum/version.py
Archive: dist/plumbum-1.8-py3-none-any.whl
inflating: plumbum/version.py
# coding: utf-8
# file generated by setuptools_scm
# don't change, don't track in version control
version = '1.8'
version_tuple = (1, 8) I also tried replicating the $ rm -rf dist build plumbum.egg-info
$ pipx run build
...
Successfully built plumbum-1.8.tar.gz and plumbum-1.8-py3-none-any.whl and the outcome is similar. |
Perfect, thank you very much for the feedback! |
Yeah, fix in #591 - checkout@v2 does shallow clones, unlike v1, and this seems to have been using v2 but assuming v1. It was probably not noticed because releases are on tags, and setuptools_scm is happy then. I'm guessing running this in
Well, there's still the pybind11 one. ;) There I'm working on cleaning up the Python 3 drop PR, then rebasing the attempt on that. |
I promise I will have a look on that soon 😄 |
pyproject.toml
Outdated
@@ -1,11 +1,79 @@ | |||
[build-system] | |||
requires = [ | |||
"setuptools>=42", | |||
"setuptools @ git+https://github.com/abravalheri/setuptools@support-pyproject", |
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.
@henryiii, you can also try git+https://github.com/pypa/setuptools@experimental/support-pyproject
now.
However this branch also adds automatic discovery for packages (which supports src-layout
without config) and considers implicit namespaces by default (PEP 420). So the experiments
folder might end-up being included in the wheel (I suspect that previously it was not being included because setuptools predates PEP 420).
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.
The exclusion rules are documented here: https://setuptools--2894.org.readthedocs.build/en/2894/userguide/package_discovery.html#automatic-discovery
Thank you very much @henryiii for updating the PR. I think the problems in the CI are probably related to the fact setuptools supports Python >= 3.7 (and the vendored version of I just pushed some changes to the experimental branch related to the feedback I got from Python's Discourse. Hopefully everything will keep working :) |