-
Notifications
You must be signed in to change notification settings - Fork 21
Use pyproject.toml instead of setup.py #3289
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
Conversation
a8f360e to
b9040a4
Compare
b9040a4 to
1ca30bb
Compare
1ca30bb to
0155282
Compare
| "ninja", | ||
| "scikit-build==0.13.1", | ||
| "setuptools>=68", | ||
| "conan==1.61.0", |
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.
This version differs from our conda setup. I needed to get a newer version here to make it work with scikit build. But conda still only has 1.59.
We need to update to version 2...
|
|
||
| return ( | ||
| subprocess.run( | ||
| ['git', 'describe', '--tags', '--abbrev=0'], stdout=subprocess.PIPE |
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.
Remind me how this gets the version now? Was it that code snipped we have in our __init__.py files?
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 same as all other packages. It uses setuptools_scm which essentially runs the code here. Differently from the other projects, here, we write the version to src/scipp/_version.py to allow scikit-build to pick it up. (I don't know how this works in pure setuptools-based builds.) However, the actual scipp.__version__ is based on C++. There is some code in CMakeLists.txt - that I didn't touch - that also runs this git command and makes it so the version gets written into the binary. So the change here is only for the version reported in PyPI.
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.
It uses setuptools_scm which essentially runs the code here.
Which code here? The file was removed.
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.
This code you highlighted to query git.
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.
So by "runs the code here", you do not mean the code here (which was deleted) but runs the same command?
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.
Yes, or a similar one. It uses git to get the latest tag and extract a version from it. (We've been using it in our python-only projects. But without writing a _version.py file.)
Tested in https://github.com/scipp/scipp/actions/runs/6508607013
I downloaded the build wheel and it works on my machine.
Needs some cleanup...