labscript-suite / labscript

The 𝗹𝗮𝗯𝘀𝗰𝗿𝗶𝗽𝘁 library provides a translation from expressive Python code to low-level hardware instructions.
http://labscriptsuite.org
BSD 2-Clause "Simplified" License
9 stars 52 forks source link

Ensure setuptools_scm uses `release-branch-semver` #106

Closed dihm closed 9 months ago

dihm commented 9 months ago

Updates setuptools and setuptools_scm pin in the build.

philipstarkey commented 9 months ago

@dihm When I merged my PR just now, it failed the build step/upload to test PyPI because it fell back on the v3.3.0rc2-<commit hash> format again even though the previous commit had been correctly identified as v3.4.0.dev10` (or something like that. Any idea why that might have happened?

dihm commented 9 months ago

You have got to be kidding me. This only lasted a week! That's a personal record for me.

Not sure the root cause still, but it appears something has changed such that setuptools_scm is not capturing any configuration options. For example, the build totally broke here because it didn't pick up the environment variable override of SCM_LOCAL_SCHEME=no-local-version which is necessary for pip uploads.

But it gets worse, checking the logs of your build, it appears setuptools_scm isn't even getting the dist_name correctly (reporting errors like version of None already set).

Finally, it appears I am seeing some level of this locally, since running python -m setuptools_scm on an editable install does not pull the correct release-branch-semver behavior (but the default guess-next-dev). I'm still doing a little digging, but I can't see what has actually changed in the past week since I know I checked that behavior locally and got the expected result. I feel like I'm taking crazy pills though since I don't think I've updated anything locally...

It's almost like setuptools_scm has suddenly decided to ignore the contents of setup.py and only use the pyproject.toml config options when introspecting versions from the source without importing. Still can't figure out why it is changed, but a simple hack might be to put our config in pyproject.toml as well. That should update how the sdist workflow gets the version (as well as the python -m setuptools_scm CLI check locally) without effecting anything else. I'll have to do a bit more testing to ensure that.

As a quick summary to myself: