-
Notifications
You must be signed in to change notification settings - Fork 321
Future-proofing the CI against future Python versions #1372
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
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| # The extra url makes pip grap the torch fersion we want to use in the regtests | ||
| --extra-index-url=https://download.pytorch.org/whl/cpu | ||
| torch>=2.7 | ||
| metatomic-torch>=0.1.3,<0.2 | ||
| featomic-torch==0.7.0 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Cython==3.2.4 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,115 @@ | ||
| name: 'Prepare linux environment' | ||
| description: 'Set up the linux environment for plumed' | ||
| inputs: | ||
| pytest-make: | ||
| descriptions: 'set to yes for exporting PYTHONPATH to be used in the tests' | ||
| required: false | ||
| default: false | ||
| type: boolean | ||
| export-kernel: | ||
| descriptions: 'set to yes for exporting PLUMED_KERNEL to be used in the tests' | ||
| required: false | ||
| default: false | ||
| type: boolean | ||
| mpi: | ||
| description: 'setup the mpi library and environmental variables' | ||
| required: false | ||
| default: false | ||
| type: boolean | ||
| ccache: | ||
| description: 'setup ccache and the environmentalvariable to use che chache action with the ~/.ccache directory' | ||
| required: false | ||
| default: false | ||
| type: boolean | ||
| boost-debug: | ||
| description: 'install boost libraries in debug mode' | ||
| required: false | ||
| default: false | ||
| type: boolean | ||
| runs: | ||
| using: "composite" | ||
| steps: | ||
| # the boolean are evaluated to string... -> the various "=='true'" | ||
| - name: Remove unused stuff | ||
| run: | | ||
| echo "Making some space" | ||
| df -h | ||
| sudo rm -rf /usr/share/dotnet | ||
| sudo rm -rf /usr/local/lib/android | ||
| sudo rm -rf /opt/ghc | ||
| df -h | ||
| shell: bash | ||
|
|
||
| - name: Install generic packages | ||
| run: | | ||
| echo "Install generic packages" | ||
| sudo apt-get update -qq | ||
| sudo apt-get install -y libatlas-base-dev | ||
| sudo apt-get install -y libfftw3-dev | ||
| sudo apt-get install -y gsl-bin | ||
| sudo apt-get install -y libgsl0-dev | ||
| shell: bash | ||
|
|
||
| - name: Install boost | ||
| if: ${{ inputs.boost-debug != 'true' }} | ||
| run: | | ||
| echo "Install boost" | ||
| sudo apt-get install -y libboost-serialization-dev | ||
| shell: bash | ||
|
|
||
| - name: Install boost in debug mode | ||
| if: ${{ inputs.boost-debug == 'true' }} | ||
| run: | | ||
| echo "Install boost in debug mode" | ||
| ${{ github.action_path }}/install.boost | ||
| shell: bash | ||
|
|
||
| - name: Set paths for the installed plumed | ||
| run: | | ||
| echo "Setting up the basig enviroment variables for running plumed installed with --prefix=\"\$HOME/opt\"" | ||
| #accessing installed plumed | ||
| echo "$HOME/opt/bin" >> $GITHUB_PATH | ||
| echo "CPATH=$HOME/opt/include:$CPATH" >> $GITHUB_ENV | ||
| echo "INCLUDE=$HOME/opt/include:$INCLUDE" >> $GITHUB_ENV | ||
| echo "LIBRARY_PATH=$HOME/opt/lib:$LIBRARY_PATH" >> $GITHUB_ENV | ||
| echo "LD_LIBRARY_PATH=$HOME/opt/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV | ||
| shell: bash | ||
|
|
||
| - name: Set paths for python tests | ||
| if: ${{ inputs.pytest-make == 'true' }} | ||
| run: | | ||
| echo "Preparing some variables for pytest" | ||
| # path required for pytest: | ||
| echo "$HOME/.local/bin" >> $GITHUB_PATH | ||
| echo "PYTHONPATH=$HOME/opt/lib/plumed/python:$PYTHONPATH" >> $GITHUB_ENV | ||
| shell: bash | ||
|
|
||
| - name: Export PLUMED_KERNEL | ||
| if: ${{ inputs.export-kernel == 'true' }} | ||
| run: | | ||
| echo "Setting up PLUMED_KERNEL" | ||
| echo "PLUMED_KERNEL=$HOME/opt/lib/libplumedKernel.so" >> $GITHUB_ENV | ||
| shell: bash | ||
|
|
||
| - name: Prepare the environment with for mpi | ||
| if: ${{ inputs.mpi == 'true' }} | ||
| run: | | ||
| echo "Setup opempi" | ||
| sudo apt-get install -y libopenmpi-dev openmpi-bin | ||
| echo "CC=mpicc" >> $GITHUB_ENV | ||
| echo "CXX=mpic++" >> $GITHUB_ENV | ||
| echo "OMPI_MCA_btl_base_warn_component_unused=0" >> $GITHUB_ENV | ||
| echo "OMPI_MCA_btl_base_verbose=0" >> $GITHUB_ENV | ||
| echo "OMPI_MCA_plm=isolated" >> $GITHUB_ENV | ||
| echo "OMPI_MCA_btl_vader_single_copy_mechanism=none" >> $GITHUB_ENV | ||
| echo "OMPI_MCA_rmaps_base_oversubscribe=yes" >> $GITHUB_ENV | ||
| shell: bash | ||
|
|
||
| - name: Prepare the enviroment with for ccache | ||
| if: ${{ inputs.ccache == 'true' }} | ||
| run: | | ||
| echo "Setup ccache" | ||
| sudo apt-get install -y ccache | ||
| #forcing the legacy directory for ccache | ||
| echo "CCACHE_DIR=$HOME/.ccache/" >> $GITHUB_ENV | ||
| shell: bash |
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,97 @@ | ||
| name: python tests | ||
|
|
||
| on: | ||
| workflow_call: | ||
|
|
||
| env: | ||
| # on CI, better dump stack trace in case there is an error | ||
| PLUMED_STACK_TRACE: yes | ||
| # use two threads for openMP tests | ||
| PLUMED_NUM_THREADS: 2 | ||
| # these are used to build required packages | ||
| CC: gcc | ||
| CXX: g++ | ||
|
|
||
| jobs: | ||
| linux-build-plumed: | ||
| runs-on: ubuntu-22.04 | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/cache@v4 | ||
| with: | ||
| path: ~/.ccache | ||
| key: ccache-python-linux-${{ github.sha }} | ||
| restore-keys: ccache-python-linux- | ||
| - name: setup the CI environment | ||
| uses: ./.github/actions/linux-setup | ||
| with: | ||
| ccache: true | ||
|
|
||
| - name: Build PLUMED | ||
| run: | | ||
| ccache -s -M 100M | ||
| ./configure CXX="ccache $CXX" --enable-boost_serialization --disable-dependency-tracking --enable-modules=all $PLUMED_CONFIG --prefix=$HOME/opt | ||
| make -j 4 | ||
| make install | ||
| # check for global symbols, see https://github.com/plumed/plumed2/issues/549 | ||
| make nmcheck | ||
| ccache -s -M 100M | ||
| - name: prepare the plumedArtifact | ||
| run: | | ||
| cd $HOME | ||
| tar cf plumed.tar opt/ | ||
|
|
||
| - name: Upload the Plumed artifact | ||
| uses: actions/upload-artifact@v6 | ||
| with: | ||
| name: plumed-python-linux | ||
| path: ~/plumed.tar | ||
| retention-days: 1 | ||
|
|
||
| linux-test-python: | ||
| needs: | ||
| - linux-build-plumed | ||
| runs-on: ubuntu-22.04 | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| pyversion: [ "3.9", "3.10", "3.11", "3.12", "3.13" ] | ||
| steps: | ||
| #still checking out to install the plumed package and pycv | ||
| - uses: actions/checkout@v4 | ||
| - name: Set up Python | ||
| uses: actions/setup-python@v6 | ||
| with: | ||
| python-version: ${{ matrix.pyversion }} | ||
| pip-install: pytest -r ./python/requirements_run.txt | ||
|
|
||
| - name: setup the CI environment | ||
| uses: ./.github/actions/linux-setup | ||
| with: | ||
| export-kernel: true | ||
|
|
||
| - name: Download artifacts | ||
| uses: actions/download-artifact@v7 | ||
| with: | ||
| path: ~/ | ||
| name: plumed-python-linux | ||
|
|
||
| - name: Install plumed | ||
| run: | | ||
| cd $HOME | ||
| tar xf ~/plumed.tar | ||
|
|
||
| - name: Install the python pacakge | ||
| working-directory: ./python | ||
| run: | | ||
| make PLUMED_VERSION | ||
| pip install . | ||
| - name: Run python tests | ||
| working-directory: ./python | ||
| run: | | ||
| pytest -v | ||
| - name: Compile and test pycv | ||
| working-directory: ./plugins/pycv/ | ||
| run: | | ||
| ln -s $(realpath ../../regtest/scripts) ./regtest/scripts | ||
| make check |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -25,3 +25,6 @@ makefile.dep | |
| /autom4* | ||
| /stamp-h | ||
| __pycache__ | ||
| #to not export personal pyenv settings | ||
| .python-version | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,7 +19,6 @@ requirements: | |
| host: | ||
| - python | ||
| - pip | ||
| - cython | ||
| run: | ||
| - plumed | ||
| - python | ||
|
|
||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Having these dependencies specified here instead of the CI workflow only still feels weird to me (these are mainly here for easier CI building); but I can also see a point in having it consistent with the rest of the dependencies specifications, so I'll let you make a call here!
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.
My idea was that this requirements should only be called in the CI (or when you want to run the tests, from what I understood) the 'plain' requirements.txt is the one to be used by the user.
From your comment I feel like this is not clear enough. Do you think that if I call this "ci_packages.txt" (or "test_packages.txt") this will create less confusion?
Maybe also by adding a few lines of explanation to the md file with the instructions?
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.
I think I understood that part, but for me such a file should not be in
src, but rather incior.github/workflow. It does not matter too much anyway 😅Uh oh!
There was an error while loading. Please reload this page.
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.
ok, then I'll move the requirements in the .ci directory
I am force pushing the change, so we might lose this conversation