Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 16 additions & 28 deletions .github/workflows/pypi.yaml
Original file line number Diff line number Diff line change
@@ -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]
Expand All @@ -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
Expand All @@ -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
Expand Down
Loading