Skip to content
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

v6 breaks on Centos7 due to older git #537

Comments

@GertBurger
Copy link

GertBurger commented Mar 17, 2021

Hi,

Changes between v5 and v6 results in downstream packages failing to build/install on Centos7, e.g. black

Centos7 seems to come with git 1.8.3.1 which doesn't support the %cI format as used by get_head_date() resulting in the following error when using pre-commit+black:

File "/tmp/pip-build-env-y421rvu8/overlay/lib/python3.7/site-packages/setuptools_scm/git.py", line 124, in parse
        node_date = wd.get_head_date() or date.today()
      File "/tmp/pip-build-env-y421rvu8/overlay/lib/python3.7/site-packages/setuptools_scm/git.py", line 64, in get_head_date
        return datetime.strptime(date_part, r"%Y-%m-%d").date()
      File "/opt/app/lib/python3.7/_strptime.py", line 577, in _strptime_datetime
        tt, fraction, gmtoff_fraction = _strptime(data_string, format)
      File "/opt/app/lib/python3.7/_strptime.py", line 359, in _strptime
        (data_string, format))
    ValueError: time data '%cI' does not match format '%Y-%m-%d'

Installing either a newer git or setuptools_scm~=5.0 works around the issue.

@PatrikHlobil
Copy link

Hi, we have the same issue here. Unfortunately, we cannot pin the version to 5.x because we use pre-commit which automatically creates a temporary virtualenv where it installs the current version of setuptools_scm.

@alexprengere
Copy link

I confirm this issue and the proposed fix to pin to 5.x, I guess this is going to break quite a few builds 😄

@pelson
Copy link
Contributor

pelson commented Mar 17, 2021

Tracking this one too. It is awkward to pin because setuptools_scm is typically declared as a build dependency, so it effectively means re-releasing an sdist. 😢

@RonnyPfannschmidt
Copy link
Contributor

Yikes, will fix that when getting back to the computer

@pelson
Copy link
Contributor

pelson commented Mar 17, 2021

I think I've got confused. I can't reproduce when installing from sdist, only from source (as one would hope). That dramatically reduces the issue's impact, and I'm happy to report my error.

@RonnyPfannschmidt
Copy link
Contributor

An sdist won't reach to git, stoneage git is a problem 👺

@petterreinholdtsen
Copy link

We are into this problem too, trying to pull in https://github.com/unioslo/pybofh/ as a dependency using pip building on RHEL 7 with git version 1.8.3.1-23. The output from "git log -n 1 HEAD --format=%cI" is simply "%cI", which break the build.

@RonnyPfannschmidt
Copy link
Contributor

bugfix is in test, release soon

RonnyPfannschmidt added a commit to RonnyPfannschmidt/setuptools_scm that referenced this issue Mar 17, 2021
RonnyPfannschmidt added a commit to RonnyPfannschmidt/setuptools_scm that referenced this issue Mar 17, 2021
@RonnyPfannschmidt
Copy link
Contributor

the release pipeline for 6.0.1 has startedand includes a fix

@alexprengere
Copy link

I confirm 6.0.1 fixes the issue on CentOS 7. Thanks @RonnyPfannschmidt for the fast fix!

@PatrikHlobil
Copy link

Fix also works here. Thanks a lot for your superquick fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment