Release v0.5.0 #9
This file contains 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
name: Upload | |
on: | |
release: | |
types: [published] | |
jobs: | |
upload: | |
runs-on: ubuntu-latest | |
env: | |
HYPOTHESIS_PROFILE: ci | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.9 | |
- name: Build and install Mr Mustard | |
run: | | |
python -m pip install --no-cache-dir --upgrade pip | |
pip install --no-cache-dir poetry==1.4.0 | |
poetry config virtualenvs.create false | |
poetry build | |
pip install dist/mrmustard*.whl | |
# Move to 'src' to properly test only installed package | |
# https://docs.pytest.org/en/7.1.x/explanation/goodpractices.html#tests-outside-application-code | |
mkdir src | |
mv mrmustard src | |
- name: Install only test dependencies | |
run: poetry install --no-root --extras "ray" --with dev | |
- name: Run tests | |
run: python -m pytest tests -p no:warnings --tb=native | |
- name: Publish | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
user: __token__ | |
password: ${{ secrets.PIPY_TOKEN }} | |
- name: Uninstall existing versions and pause | |
run: | | |
python -m pip uninstall mrmustard -y | |
sleep 5m | |
- name: Install MrMustard from pypi | |
run: python -m pip install mrmustard | |
- name: Print about | |
run: | | |
echo "import mrmustard; print(mrmustard.about())" > test_install.py | |
python test_install.py |