-
Notifications
You must be signed in to change notification settings - Fork 11
139 lines (112 loc) · 6.16 KB
/
pip_install.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
# documentation: https://help.github.com/en/articles/workflow-syntax-for-github-actions
name: Test installation of EESSI test suite with 'pip install'
on: [push, pull_request, workflow_dispatch]
permissions: read-all
jobs:
test_pip_install:
# ubuntu <= 20.04 is required for python 3.6
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
python-version: ['3.6', '3.7', '3.8', '3.9', '3.10', '3.11']
steps:
- name: Check out repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
persist-credentials: false
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4.7.0
with:
python-version: ${{ matrix.python-version }}
- name: Install setuptools
run: |
if [[ "${{ matrix.python-version }}" == "3.6" ]]; then
# system installed setuptools version in RHEL8 and CO7
python -m pip install --user setuptools==39.2.0
fi
- name: Install ReFrame
run: |
python -m pip install --user ReFrame-HPC
- name: Install EESSI test suite with 'pip install'
run: |
# Make it easier to figure out CI issues in case of CI failures related to SCM versioning
export SETUPTOOLS_SCM_DEBUG=1
# install from source distribution tarball, to test release as published on PyPI
rm -rf dist
echo "Running python setup.py sdist"
python setup.py sdist
ls dist
echo "Running python -m pip install --user dist/eessi*.tar.gz"
python -m pip install --user dist/eessi*.tar.gz
echo "Checking contents of .local"
find $HOME/.local
# make sure we are not in the source directory
cd $HOME
python --version
python -m pip --version
python -c 'import setuptools; print("setuptools", setuptools.__version__)'
echo "Checking if file 'eessi/testsuite/_version.py' was generated by setuptools_scm":
cat $HOME/.local/lib/python${{ matrix.python-version}}/site-packages/eessi/testsuite/_version.py
echo "Checking if version can be imported directly from the version file"
if [[ "${{ matrix.python-version }}" == "3.6" ]]; then
versionfile_version=$(python -c 'from eessi.testsuite._version import version; print(version)')
else
versionfile_version=$(python -c 'from eessi.testsuite._version import __version__; print(__version__)')
fi
echo "Version from version file: $versionfile_version"
echo "Checking if we can import the __version__ from eessi.testsuite"
testsuite_version=$(python -c 'import eessi.testsuite; print(eessi.testsuite.__version__)')
echo "Version imported from eessi.testsuite: $testsuite_version"
echo "Checking if the version imported from eessi.testsuite matches that from the version file ..."
if [[ "$versionfile_version" != "$testsuite_version" ]]; then
echo "Version $versionfile_version not equal to $testsuite_version"
exit 1
else
echo "... yes!"
fi
echo "Checking if we can import eessi.testsuite.utils"
python -c 'import eessi.testsuite.utils'
echo "Checking if we can import eessi.testsuite.tests.apps"
python -c 'import eessi.testsuite.tests.apps'
- name: Install EESSI test suite with 'pip install git+https'
run: |
# Get version from the installation in the previous step
testsuite_version=$(python -c 'import eessi.testsuite; print(eessi.testsuite.__version__)')
# Cleanup installation from previous step
echo "Uninstalling testsuite for next step"
python -m pip uninstall -y eessi-testsuite
pip install --user "git+$GITHUB_SERVER_URL/$GITHUB_REPOSITORY.git@$GITHUB_SHA"
echo "Checking contents of .local"
find $HOME/.local
echo "Checking if file 'eessi/testsuite/_version.py' was generated by setuptools_scm":
cat $HOME/.local/lib/python${{ matrix.python-version}}/site-packages/eessi/testsuite/_version.py
echo "Checking if version can be imported directly from the version file"
if [[ "${{ matrix.python-version }}" == "3.6" ]]; then
githttps_versionfile_version=$(python -c 'from eessi.testsuite._version import version; print(version)')
else
githttps_versionfile_version=$(python -c 'from eessi.testsuite._version import __version__; print(__version__)')
fi
echo "Version from version file: $githttps_versionfile_version"
echo "Checking if we can import the __version__ from eessi.testsuite"
githttps_testsuite_version=$(python -c 'import eessi.testsuite; print(eessi.testsuite.__version__)')
echo "Version imported from eessi.testsuite: $githttps_testsuite_version"
echo "Checking if the version imported from eessi.testsuite matches that from the version file ..."
if [[ "$githttps_versionfile_version" != "$githttps_testsuite_version" ]]; then
echo "Version $githttps_versionfile_version not equal to $githttps_testsuite_version"
exit 1
else
echo "... yes!"
fi
echo "Checking if the version import from a regular pip install and the git+https based install are the same ..."
if [[ "$githttps_testsuite_version" != "$testsuite_version" ]]; then
echo "Version $githttps_testsuite_version not equal to $testsuite_version"
exit 1
else
echo "... yes!"
fi
echo "Checking if we can import eessi.testsuite.utils"
python -c 'import eessi.testsuite.utils'
echo "Checking if we can import eessi.testsuite.tests.apps"
python -c 'import eessi.testsuite.tests.apps'