-
Notifications
You must be signed in to change notification settings - Fork 219
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
versioneer
/setuptools_scm
are unable to infer the correct version
#1309
Comments
Small correction here: also on the latest docker image, we get a name like It might be an issue with the git update? |
From the recent release notes:
|
Setting
Within our Dockerfile appears to have resolved this issue. This may be more permissive than appropriate for all use cases, but for running on Github Actions it seemed fine. Is it appropriate to add something similar to the base Dockerfiles here? Looks like this is not an isolated case of git upgrades breaking things in recent days... |
* try using this command: pypa/manylinux#1309 (comment) * to deal with this in newer manylinux images: https://github.blog/2022-04-12-git-security-vulnerability-announced/
versioneer
/setuptools_scm
are unable to infer the correct version
Thanks for the report & the analysis. |
This allows git to work properly, e.g., `versioneer`/`setuptools_scm` with latest git versions. c.f. pypa/manylinux#1309
pypa/cibuildwheel#1095 indicates another way this can be fixed (although it might be specific to cibuildwheel, didn't look in detail) |
Users also can fix by being explicit, like in pypa/setuptools-scm#708. Or by ensuring the file ownership has a consistent user all the way up (tar needs the flag in the cibuildwheel link, for example). |
This allows git to work properly, e.g., `versioneer`/`setuptools_scm` with latest git versions. c.f. pypa/manylinux#1309
I'm a bit less clear on how to solve this as a consumer of I tried messing around with a few different things, but each seemed to have different problems--i.e., the custom |
This line needs to specify the git root explicitly: https://github.com/scipy/scipy/blob/69834743023220f0073ac9565cb5783c7a2dd433/tools/version_utils.py#L84 |
You could also just write out a version.py file in CI manually. |
Interesting idea, |
Actually, even in a simple local reproducing situation I can't get the simplest fix to work really: |
Can you patch the command, that is, out = _minimal_ext_cmd(['git', "--git-dir", git_dir 'rev-parse', 'HEAD']) I'm guessing git_dir would be something like If you don't want to modify code, you should be able to set |
Not much luck on not modifying code--perhaps because of environment variable scoping vs. subprocess call (I'd have to modify the code to pass in a custom env to the subprocess I think). Your code change seems promising locally though--with root owning the repo and me running as user this looks a little better (I believe):
# THIS FILE IS GENERATED FROM SCIPY SETUP.PY
short_version = '1.8.1'
version = '1.8.1'
full_version = '1.8.1.dev0+0.a6a2fe5'
git_revision = 'a6a2fe5'
commit_count = '0'
release = False
if not release:
version = full_version For diff: diff --git a/setup.py b/setup.py
index 94e72b80f..3723910f8 100755
--- a/setup.py
+++ b/setup.py
@@ -79,7 +79,9 @@ def git_version():
return out
try:
- out = _minimal_ext_cmd(['git', 'rev-parse', 'HEAD'])
+ cwd = os.getcwd()
+ git_dir = os.path.join(cwd, ".git")
+ out = _minimal_ext_cmd(['git', '--git-dir', git_dir, 'rev-parse', 'HEAD'])
GIT_REVISION = out.strip().decode('ascii')[:7]
# We need a version number that's regularly incrementing for newer commits, I'll give it a try in CI at least. |
* this is an attempt to deal with the new security measure in git: https://github.blog/2022-04-12-git-security-vulnerability-announced/ * it has been blocking the release of SciPy 1.8.1 and NumPy point release for some time * I'm going to try to point the problem wheels repo PR at the hash of this commit/branch before merging if possible: MacPython/scipy-wheels#167 * based on feedback from Henry over here, this does seem to help locally: pypa/manylinux#1309 (comment)
* MAINT: wheels 1.8.1 prep * restore Pythran for Windows builds to see if we are good to go there (if so, we can close gh-162 as well) * bump `BUILD_COMMIT` to point to the latest relevant maintenance branch--this should also tell me if anything strange is happening with things that may be pinned since the `1.8.0` rel * MAINT: PR 167 revisions * try pinning setuptools for Linux jobs; the wheel versions seem wrong with bleeding edge setuptools * MAINT: PR 167 revisions * try pinning `DOCKER_TEST_IMAGE` to avoid the issues related to: https://github.blog/2022-04-12-git-security-vulnerability-announced/ * Revert "MAINT: PR 167 revisions" This reverts commit a090151. * MAINT: PR 167 revisions * try using this command: pypa/manylinux#1309 (comment) * to deal with this in newer manylinux images: https://github.blog/2022-04-12-git-security-vulnerability-announced/ * MAINT: PR 167 revisions * try to address some of the issues with `git config` commands showing up in CI * MAINT: PR 167 revisions * revert some `config.sh` changes that were not helping * MAINT: PR 167 revisions * try shimming the `git` commands in `clean_code()` based on feedback from Matti related to the new `git` vulnerability fix * DEBUG: narrow CI * disable most of the CI while I debug * MAINT: PR 167 revisions * try adding the safe directory command inside of `repo_dir`, which presumably will include running this command in each of the submodules * Try workaround in scipy/scipy#16139 * MAINT: simplify after git fix.
@jorisvandenbossche I was able to work around this problem for NumPy, which uses versioneer and multibuild, by editing the
|
Update others whilst we're at it why not Some discussion here: pypa/manylinux#1309
Due to this issue: pypa/manylinux#1309 Can likely remove the "pre-build command" once the following is merged and released in setuptools_scm: pypa/setuptools-scm#708 Bumping version of actions/checkout may or may not be necessary Bumping other versions not necessary but why not
We are extending the manylinux2014_x86_64 Docker image to build binary dependencies using VCPKG. This worked nicely until the latest changes in
quay.io/pypa/manylinux2014_x86_64:2022-04-18-1d09d31
.Previously we were getting proper wheel names:
pyogrio-0.3.0+47.g9dd1b49-cp38-cp38-linux_x86_64.whl
On latest version we now get:
pyogrio-0+unknown-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
We are using
versioneer
for managing versions, but as that was working previously, I'm not sure that is the issue here. Given that the names now include "manylinux*" it suggests that perhaps there is an issue in one of the build scripts in this latest version?Downgrading to the
quay.io/pypa/manylinux2014_x86_64:2022-04-03-da6ecb3
image fixed our issue.xref: geopandas/pyogrio#77
The text was updated successfully, but these errors were encountered: