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

ci: Use micromamba to test Python and ROOT #220

Merged

Conversation

matthewfeickert
Copy link
Member

@matthewfeickert matthewfeickert commented Feb 22, 2023

Requires #218 to go in first.

  • Use the mamba-org/provision-with-micromamba GitHub action to setup a micromamba enviroment with a ROOT version and CPython version defined by the CI matrix.
    • Set a default shell of a Bash login to automatically source the micromamba environment.
  • Test ROOT v6.24.x and v6.26.x and all compatible Python versions with them.
    • Exclude versions of Python that are not compatible with ROOT releases.
    • Test on macOS with the latest ROOT release on conda-forge (v6.26.x) and the latest supported CPython version (3.10).
  • Install ImageMagick and Ghostscript through conda-forge.
  • Remove commented out macOS and Python 2.7 workflows.

📚 Documentation preview 📚: https://hepdata-lib--220.org.readthedocs.build/en/220/

Comment on lines 32 to 33
- root-version: "6.24.00"
python-version: "3.10"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ROOT v6.24.00 isn't compatible with modern Python.

Comment on lines 34 to 37
- root-version: "6.26.10"
python-version: "3.6"
- root-version: "6.26.10"
python-version: "3.7"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The conda-forge distribution of ROOT v6.26 isn't compatible with Pythons that are EOL or on the verge of EOL.

@codecov-commenter
Copy link

codecov-commenter commented Feb 22, 2023

Codecov Report

Merging #220 (7fd168a) into master (3732906) will increase coverage by 0.20%.
The diff coverage is n/a.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@            Coverage Diff             @@
##           master     #220      +/-   ##
==========================================
+ Coverage   87.80%   88.01%   +0.20%     
==========================================
  Files           4        4              
  Lines         968      968              
  Branches      189      202      +13     
==========================================
+ Hits          850      852       +2     
+ Misses         86       85       -1     
+ Partials       32       31       -1     
Flag Coverage Δ
unittests-3.10 88.01% <ø> (?)
unittests-3.6 87.66% <ø> (?)
unittests-3.7 87.66% <ø> (?)
unittests-3.8 87.80% <ø> (ø)
unittests-3.9 87.80% <ø> (?)

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

Impacted Files Coverage Δ
hepdata_lib/c_file_reader.py 92.94% <0.00%> (+0.64%) ⬆️

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

@matthewfeickert
Copy link
Member Author

@clelange once PR #218 is merged I can rebase this and then it will be ready to go.

@matthewfeickert matthewfeickert force-pushed the ci/use-micromamba-provision branch from 7508ce5 to 7fd168a Compare February 22, 2023 16:17
@matthewfeickert matthewfeickert marked this pull request as ready for review February 22, 2023 16:18
@matthewfeickert
Copy link
Member Author

@clelange thanks for the fast review and merge of PR #218! This is now ready for review. 👍

@clelange clelange mentioned this pull request Feb 22, 2023
Copy link
Collaborator

@clelange clelange left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks once more, this helps a lot! I left a couple of comments in the code. I hope the tests will answer some of my questions 😄

@@ -22,15 +26,40 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
python-version: ["3.8"]
root-version: ["6.24.00", "6.26.10"]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason not to go with the latest release of 6.24, i.e. 6.24.08?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope. That's fine to update to, I was just leaving this as it currently exists.

Instead of using == for ROOT I can also just use = and specifying down to the minor version (which with conda is the same as ~= x.y.0) though ROOT doesn't really follow SemVer and so there is no reason to trust that testing against the latest patch release won't break something for an unclear reason. But maybe that's better to catch anyway as it is better to know in CI that things are broken than finding out later.

@matthewfeickert matthewfeickert force-pushed the ci/use-micromamba-provision branch from 7fd168a to ca30b85 Compare February 22, 2023 16:42
* Use the mamba-org/provision-with-micromamba GitHub action to setup a
  micromamba enviroment with a ROOT version and CPython version defined
  by the CI matrix.
   - Set a default shell of a Bash login to automatically source the
     micromamba environment.
* Test ROOT v6.24.x and v6.26.x and all compatible Python versions
  with them.
   - Exclude versions of Python that are not compatible with ROOT
     releases.
   - Test on macOS with the latest ROOT release on conda-forge
     (v6.26.x) and the latest supported CPython version (3.10).
* Install ImageMagick and Ghostscript through conda-forge.
* Remove commented out macOS and Python 2.7 workflows.
@matthewfeickert matthewfeickert force-pushed the ci/use-micromamba-provision branch from ca30b85 to b110f0a Compare February 22, 2023 16:55
environment-name: ci
extra-specs: |
python=${{ matrix.python-version }}
root=${{ matrix.root-version }}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using 6.24 and 6.26 along with root= instead of root== means that this is asking conda-forge for something equivalent to ~=6.26.0 in pip, for 6.26 for example.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That sounds good! Would you mind changing to =?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It already does use =.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I see it now, was looking at an outdated diff for some reason...

Comment on lines +38 to +41
include:
- os: macos-latest
root-version: "6.26"
python-version: "3.10"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This adds back in macOS tests but just for the latest release, as macos-latest is much slower given the limited number of runners and high demands that GitHub has.

Copy link
Collaborator

@clelange clelange left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks again! I'll merge this and will then make a new release so that python 2 can then be deprecated.

environment-name: ci
extra-specs: |
python=${{ matrix.python-version }}
root=${{ matrix.root-version }}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I see it now, was looking at an outdated diff for some reason...

@clelange clelange merged commit 21349a6 into HEPData:master Feb 23, 2023
@matthewfeickert matthewfeickert deleted the ci/use-micromamba-provision branch February 23, 2023 08:03
@matthewfeickert
Copy link
Member Author

matthewfeickert commented Feb 23, 2023

Thanks again! I'll merge this and will then make a new release so that python 2 can then be deprecated.

If you want to make a release before removing Python 2 support then let me make a PR that adds a python_requires (PR #222) before you make the release so that this release gets that. I would also recommend making a minor release after PR #221 to signify that a Python version has been dropped.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Test all supported Python versions
3 participants