Skip to content

Conversation

@jl-wynen
Copy link
Member

@jl-wynen jl-wynen commented Oct 13, 2023

Tested in https://github.com/scipp/scipp/actions/runs/6508607013
I downloaded the build wheel and it works on my machine.

Needs some cleanup...

@jl-wynen jl-wynen marked this pull request as ready for review October 16, 2023 10:54
"ninja",
"scikit-build==0.13.1",
"setuptools>=68",
"conan==1.61.0",
Copy link
Member Author

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
Copy link
Member

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?

Copy link
Member Author

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.

Copy link
Member

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.

Copy link
Member Author

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.

Copy link
Member

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?

Copy link
Member Author

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.)

@jl-wynen jl-wynen merged commit b576716 into main Oct 17, 2023
@jl-wynen jl-wynen deleted the use-pyproject-toml branch October 17, 2023 08:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants