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

build: Update git archival options to support auto versioning #1951

Merged
merged 5 commits into from
Aug 18, 2022

Conversation

matthewfeickert
Copy link
Member

@matthewfeickert matthewfeickert commented Aug 18, 2022

Description

Resolves #1914

From the removed sections of scikit-hep/scikit-hep.github.io#250 I see that we should be updating the .git_archival.txt information to allow for Git archives (including the ones generated from GitHub) to also support versioning. c.f. https://github.com/pypa/setuptools_scm/tree/1b18371fc2fa672f39c758a103c4d12956b5964f#git-archives

In there it is additionally pointed out (in the removed section) that

If you are missing setuptools_scm or possibly the toml dependency on old versions of setuptools_scm, you will silently get version 0.0.0.
...
This will only work with setuptools_scm>=7, which requires Python 3.7+ (though adding the files won't hurt older versions).

So additionally update build-system requires to have setuptools_scm>=7.0.1 as 7.0.0 was yanked.

Require setuptools>=61.0.0 for the build system as v61.0.0 adds support for pyproject.toml configuration. This configuration is not currently used by pyhf, but it is updated given the recommendation by the Scikit-HEP developer guide.

Checklist Before Requesting Reviewer

  • Tests are passing
  • "WIP" removed from the title of the pull request
  • Selected an Assignee for the PR to be responsible for the log summary

Before Merging

For the PR Assignees:

  • Summarize commit messages into a comprehensive review of the PR
* Update the options in .git_archival.txt to fully support to allow Git archives
  (including the ones generated from GitHub) to support versioning.
   - c.f. https://github.com/scikit-hep/scikit-hep.github.io/pull/250
   - c.f. https://github.com/pypa/setuptools_scm/tree/1b18371fc2fa672f39c758a103c4d12956b5964f#git-archives
* Require 'setuptools_scm>=7.0.1' for the build system to ensure support.
   - Drop addition of 'setuptools_scm[toml]' extra as no longer required.
* Require 'setuptools>=61.0.0' for the build system as v61.0.0 adds support for
  pyproject.toml configuration. This configuration is not currently used by pyhf, but
  it is updated given the recommendation by the Scikit-HEP developer guide.
   - c.f. https://setuptools.pypa.io/en/latest/history.html#v61-0-0

@matthewfeickert matthewfeickert added build Changes that affect the build system or external dependencies chore Other changes that don't modify src or test files labels Aug 18, 2022
@matthewfeickert matthewfeickert self-assigned this Aug 18, 2022
@matthewfeickert
Copy link
Member Author

@henryiii I know you were updating sections for hatchling in that PR, but if we're updating things here for our setuptools based build just to ensure things work any input you have is welcome. 👍

@codecov
Copy link

codecov bot commented Aug 18, 2022

Codecov Report

Merging #1951 (bb87b95) into master (a618640) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master    #1951   +/-   ##
=======================================
  Coverage   98.26%   98.26%           
=======================================
  Files          69       69           
  Lines        4439     4439           
  Branches      748      748           
=======================================
  Hits         4362     4362           
  Misses         45       45           
  Partials       32       32           
Flag Coverage Δ
contrib 25.81% <ø> (ø)
doctest 61.02% <ø> (ø)
unittests-3.10 96.14% <ø> (ø)
unittests-3.7 96.13% <ø> (ø)
unittests-3.8 96.17% <ø> (ø)
unittests-3.9 96.19% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@henryiii
Copy link
Member

This will only work with setuptools_scm>=7, which requires Python 3.7+ (though adding the files won't hurt older versions).

There's no harm in older versions, they just don't look for this file. But since you are Python 3.7+ already, don't see a harm in requiring setuptools_scm>=7 if you want to.

Require setuptools>=61.0.0 for the build system as v61.0.0 adds support for pyproject.toml configuration.

But you aren't using it?

@matthewfeickert
Copy link
Member Author

Require setuptools>=61.0.0 for the build system as v61.0.0 adds support for pyproject.toml configuration.

But you aren't using it?

Correct, but we eventually will and I will probably forget to update the lower bound when switching. I only thought to do so here as I was reading the Scikit-HEP developer guide again.

@matthewfeickert matthewfeickert merged commit 44a7814 into master Aug 18, 2022
@matthewfeickert matthewfeickert deleted the chore/update-git-archive-files branch August 18, 2022 21:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Changes that affect the build system or external dependencies chore Other changes that don't modify src or test files
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove unused config files
3 participants