diff --git a/.github/workflows/pypi.yaml b/.github/workflows/pypi.yaml index 282e4cf..52aa859 100644 --- a/.github/workflows/pypi.yaml +++ b/.github/workflows/pypi.yaml @@ -1,7 +1,7 @@ name: Build and release PyPI -#Based on the similar action for `gumpy` +# Based on the similar action for `gumpy` -#Ensure this only runs when (pre)released +# Ensure this only runs when (pre)released on: release: types: [released, prereleased] @@ -15,31 +15,29 @@ jobs: - name: Check out repository code uses: actions/checkout@v2 - - name: Set up Conda - uses: conda-incubator/setup-miniconda@v2 + - name: Set up Python + uses: actions/setup-python@v2 with: - auto-activate-base: false + python-version: "3.10" - - name: Create Conda environment - run: conda env create --file env.yml - - - name: Activate Conda environment and install dependencies + - name: Create virtualenv and install project (from pyproject.toml) run: | - source $CONDA/bin/activate catomatic - pip install -e . + python -m pip install --upgrade pip setuptools wheel + # Install the project in editable mode. If you maintain a dev extra in pyproject.toml, + # and you want test/build deps from there, change to: pip install -e ".[dev]" + python -m pip install -e . - - name: Verify Conda environment + - name: Verify Python environment run: | - source $CONDA/bin/activate catomatic - conda info --all - conda list + python -V + pip --version + pip freeze - name: Set PYTHONPATH run: echo "PYTHONPATH=$PYTHONPATH:$(pwd)/src" >> $GITHUB_ENV - name: Run Pytest and Coverage run: | - source $CONDA/bin/activate catomatic pytest --cov=catomatic src/tests/ --cov-report=xml - name: Upload Coverage to Codecov @@ -49,20 +47,10 @@ jobs: token: ${{ secrets.CODECOV_TOKEN }} - name: Install pypa/build - run: >- - python -m - pip install - build - --user + run: python -m pip install --upgrade build - name: Build a binary wheel and a source tarball - run: >- - python -m - build - --sdist - --wheel - --outdir dist/ - . + run: python -m build --sdist --wheel --outdir dist/ - name: Publish a Python distribution to PyPI uses: pypa/gh-action-pypi-publish@release/v1