Migrate to pyproject.toml

This commit is contained in:
Alex Mykyta
2023-10-24 23:01:30 -07:00
parent 62518b318b
commit f2cb2425b3
3 changed files with 84 additions and 64 deletions

View File

@@ -11,6 +11,8 @@ on:
types:
- published
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
test:
@@ -36,6 +38,12 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.7 to bootstrap py3.6
if: ${{ matrix.python-version == '3.6' }}
uses: actions/setup-python@v4
with:
python-version: 3.7
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
@@ -45,7 +53,18 @@ jobs:
run: |
python -m pip install -U -r tests/requirements.txt
# Python 3.6 cannot install directly from a pyproject.toml
# Instead, build a wheel from py3.7 and then install it
- name: Install via wheel
if: ${{ matrix.python-version == '3.6' }}
run: |
python3.7 -m pip install build
python3.7 -m build
python --version
python -m pip install ./dist/*.whl
- name: Install
if: ${{ matrix.python-version != '3.6' }}
run: |
python -m pip install .
@@ -120,12 +139,12 @@ jobs:
mypy --config-file tests/mypy.ini src/peakrdl_regblock
#-------------------------------------------------------------------------------
build_sdist:
build:
needs:
- test
- lint
- mypy
name: Build source distribution
name: Build distributions
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
@@ -135,17 +154,23 @@ jobs:
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install -U build
- name: Build sdist
run: python setup.py sdist
run: python -m build
- uses: actions/upload-artifact@v3
with:
path: dist/*.tar.gz
path: |
dist/*.tar.gz
dist/*.whl
#-------------------------------------------------------------------------------
deploy:
needs:
- build_sdist
- build
runs-on: ubuntu-latest