-
-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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
BLD: Fetch version from setuptools_scm at build time #28036
Conversation
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 seems to have broken (at least) the circleCI build:
Traceback (most recent call last):
File "/home/circleci/.pyenv/versions/3.9.19/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 167, in prepare_metadata_for_build_editable
hook = backend.prepare_metadata_for_build_editable
AttributeError: module 'mesonpy' has no attribute 'prepare_metadata_for_build_editable'
Inspired by this I tried to do the same for another project and got this issue on GitHub as well. The thing seems to be that
(Although it wasn't required for all of my work flows for some reason... And, despite initially promising results, didn't solve it for all of my work flows, but at least for the tests...) Edit: really not sure what the solution is, but the problem is clearly that |
meson.build
Outdated
@@ -1,7 +1,7 @@ | |||
project( | |||
'matplotlib', | |||
'c', 'cpp', | |||
version: '3.9.0.dev0', | |||
version: run_command(find_program('python3'), '-m', 'setuptools_scm').stdout().strip(), |
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.
version: run_command(find_program('python3'), '-m', 'setuptools_scm').stdout().strip(), | |
version: run_command(find_program('python3'), '-m', 'setuptools_scm', check: true).stdout().strip(), |
will get rid of a warning.
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.
Sorry for spamming, but this may actually be the key thing. If setuptools_scm
is not available, not having check: true
will just continue running the install script. My current guess is that setuptools_scm
is not installed in the failing work flows.
(I think I had an issue with tags as well, but this was the final boss in my case.)
This should ensure we get the right version when tagging, etc., without having to do manual changes.
I believe what happened here is that we used to depend on Now that this starts using setuptools-scm, it's required again, and we need to ensure we pre-install build-time dependencies for editable installs. |
Was based on install failures on circle which have been resolved.
I restarted the azure failure (it was a jupyter related failure) and appveyor looks broken across all cI (gobject related). |
That's unfortunate that it came back; it occurred a few weeks ago, but magically fixed itself. |
…036-on-v3.9.x Backport PR #28036 on branch v3.9.x (BLD: Fetch version from setuptools_scm at build time)
@QuLogic This appears to have broken local editable installs (
Edit: this appears to have broken the ci docs build in a similar fashion, e.g. https://app.circleci.com/pipelines/github/matplotlib/matplotlib/30737/workflows/c5534721-661a-4c53-88ff-c4dcc8d1d59c/jobs/82703 |
ping @tacaswell on the above per the call. |
circle looks like it has fixed itself and I'm not seeing this problem locally (I even tried going back to the commit before this one, building, switching back to main and rebuilding). |
This is definitely still broken for me, and rather annoying because I need to keep running from the last commit before this PR, as later commits are totally unusable... |
Checking that you did a |
I also can not reproduce this on a mac
I tried a bunch of different versions of meson (both from pip and from conda-forge) and they all seem to work. |
OK, I figured it out: due to vagaries in my .profile ordering (homebrew being added to the path at a higher position than conda) my shell's python ( Thanks for looking into it. |
I think this sort of brittleness is inherent in the quasi-isolation of conda / virtualenvs which rely on partially aliasing just the right things and letting through just the right other things. When it works it is magic, when it fails it is in deeply confusing ways 🤣 . |
PR summary
This should ensure we get the right version when tagging, etc., without having to do manual changes.
We had incorrect sdist/wheel names when building rc1 due to this: https://github.com/matplotlib/matplotlib/actions/runs/8566515999/job/23476414949#step:6:89
PR checklist