File tree Expand file tree Collapse file tree 1 file changed +15
-6
lines changed Expand file tree Collapse file tree 1 file changed +15
-6
lines changed Original file line number Diff line number Diff line change 11name : PyPI release
22on :
3+ pull_request :
4+ branches : [main]
5+ push :
6+ branches : [main]
37 release :
48 types : [published]
59
@@ -24,16 +28,18 @@ jobs:
2428 cd test-sdist
2529 python -m venv venv-sdist
2630 venv-sdist/bin/python -m pip install ../dist/CausalPy*.tar.gz
27- # check import
28- venv-sdist/bin/python -c "import causalpy; assert causalpy.__version__ == '${{ github.ref_name }}'"
31+ echo "Checking import and version number (on release)"
32+ venv-sdist/bin/python -c "import causalpy; assert causalpy.__version__ == '${{ github.ref_name }}' if '${{ github.ref_type }}' == 'tag' else causalpy.__version__; print(causalpy.__version__)"
33+ cd ..
2934 - name : Check the bdist installs and imports
3035 run : |
3136 mkdir -p test-bdist
3237 cd test-bdist
3338 python -m venv venv-bdist
3439 venv-bdist/bin/python -m pip install ../dist/CausalPy*.whl
35- # check import
36- venv-bdist/bin/python -c "import causalpy; assert causalpy.__version__ == '${{ github.ref_name }}'"
40+ echo "Checking import and version number (on release)"
41+ venv-bdist/bin/python -c "import causalpy; assert causalpy.__version__ == '${{ github.ref_name }}' if '${{ github.ref_type }}' == 'tag' else causalpy.__version__; print(causalpy.__version__)"
42+ cd ..
3743 - uses : actions/upload-artifact@v3
3844 with :
3945 name : artifact
5965 python-version : 3.8
6066 - name : Test pip install from test.pypi
6167 run : |
68+ # Give time to test.pypi to update its index. If we don't wait,
69+ # we might request to install before test.pypi is aware that it actually has the package
70+ sleep 5s
6271 python -m venv venv-test-pypi
63- venv-test-pypi/bin/python -m pip install --index-url https://test.pypi.org/simple/ causalpy
64- # check import
72+ venv-test-pypi/bin/python -m pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple causalpy
73+ echo "Checking import and version number"
6574 venv-test-pypi/bin/python -c "import causalpy; assert causalpy.__version__ == '${{ github.ref_name }}'"
6675
6776 publish :
You can’t perform that action at this time.
0 commit comments