summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRonny Pfannschmidt <opensource@ronnypfannschmidt.de>2023-02-24 14:26:04 +0100
committerRonny Pfannschmidt <opensource@ronnypfannschmidt.de>2023-02-24 16:14:50 +0100
commit3996d3e6757260b2e4c04b72314375d36946f374 (patch)
treeaaec82df1ce0b634c1af1d5e2cde306b163efc87
parentd04871d280914c17c9cb77670335af80d18d72f0 (diff)
downloadsetuptools-scm-3996d3e6757260b2e4c04b72314375d36946f374.tar.gz
migrate to hynek/build-and-inspect-python-package@v1
-rw-r--r--.github/workflows/python-tests.yml65
-rw-r--r--pyproject.toml9
2 files changed, 32 insertions, 42 deletions
diff --git a/.github/workflows/python-tests.yml b/.github/workflows/python-tests.yml
index af4126b..a9d4eed 100644
--- a/.github/workflows/python-tests.yml
+++ b/.github/workflows/python-tests.yml
@@ -16,7 +16,20 @@ env:
FORCE_COLOR: 1
jobs:
+
+ package:
+ name: Build & inspect our package.
+ runs-on: ubuntu-latest
+
+ steps:
+ - uses: actions/checkout@v3
+ with:
+ fetch-depth: 0
+
+ - uses: hynek/build-and-inspect-python-package@v1
+
test:
+ needs: [package]
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
@@ -66,9 +79,14 @@ jobs:
echo "C:\Program Files (x86)\gnupg\bin" >> $env:GITHUB_PATH
git config --system gpg.program "C:\Program Files (x86)\gnupg\bin\gpg.exe"
if: runner.os == 'Windows'
- - run: pip install -U 'setuptools>=45'
+ - run: pip install -U 'setuptools>=60'
if: matrix.python_version != 'msys2'
- - run: pip install -e .[toml,test]
+ - uses: actions/download-artifact@v3
+ with:
+ name: Packages
+ path: dist
+ - shell: bash
+ run: pip install "$(echo -n dist/*whl)[toml,test]"
- run: |
$(hg debuginstall --template "{pythonexe}") -m pip install hg-git --user
if: matrix.os == 'ubuntu-latest'
@@ -81,58 +99,21 @@ jobs:
- name: Setup python
uses: actions/setup-python@v4
with:
- python-version: "3.7"
+ python-version: "3.8"
architecture: x64
- run: pip install -e .[toml,test] pytest virtualenv
- run: pytest --test-legacy testing/test_setuptools_support.py || true # ignore fail flaky on ci
- dist:
- runs-on: ubuntu-latest
-
- needs: [test]
- name: Python sdist/wheel
- steps:
- - uses: actions/checkout@v3
- - uses: actions/setup-python@v4
- with:
- python-version: "3.8"
- - name: Install dependencies
- run: |
- python -m pip install --upgrade pip
- pip install --upgrade wheel setuptools build
-
- - name: Build package
- run: python -m build -o dist/
- - uses: actions/upload-artifact@v3
- with:
- name: dist
- path: dist
-
-
- dist_check:
- runs-on: ubuntu-latest
- needs: [dist]
- steps:
- - uses: actions/setup-python@v4
- with:
- python-version: "3.8"
- - name: Install dependencies
- run: pip install twine
- - uses: actions/download-artifact@v3
- with:
- name: dist
- path: dist
- - run: twine check --strict dist/*
dist_upload:
runs-on: ubuntu-latest
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
- needs: [dist_check]
+ needs: [test]
steps:
- uses: actions/download-artifact@v3
with:
- name: dist
+ name: Packages
path: dist
- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@master
diff --git a/pyproject.toml b/pyproject.toml
index 7632fdb..f8cb696 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -3,6 +3,7 @@ build-backend = "scm_hack_build_backend"
requires = [
"packaging>=20",
"setuptools>=55",
+ 'tomli; python_version < "3.11"',
"typing_extensions",
]
backend-path = [
@@ -45,6 +46,14 @@ dependencies = [
'tomli>=1; python_version < "3.11"',
"typing-extensions",
]
+[project.optional-dependencies]
+test = [
+ "pytest",
+ "virtualenv>20",
+]
+toml = [
+]
+
[project.urls]
repository = "https://github.com/pypa/setuptools_scm/"