-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #34 from unt-libraries/modernize
Begin modernizing the pycallnumber package (v0.2.0). - Add Python 3.8, 3.9, 3.10, 3.11 support. - Drop Python 3.4 support. - Move to `pyproject.toml` + `setup.cfg` package configuration. - Use `setuptools_scm` for versioning. - Move to a `src` layout. - Improve tox configuration for CI/CD.
- Loading branch information
Showing
46 changed files
with
492 additions
and
269 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
name: Run linters and tests | ||
on: [push, workflow_call, workflow_dispatch] | ||
jobs: | ||
|
||
run-linters: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.10" | ||
- name: Upgrade pip and install tox | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install tox | ||
- name: Run linter | ||
run: tox -e flake8 | ||
|
||
run-tests: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
include: | ||
- python: '2.7' | ||
tox-env: '27' | ||
- python: '3.5' | ||
tox-env: '35' | ||
- python: '3.6' | ||
tox-env: '36' | ||
- python: '3.7' | ||
tox-env: '37' | ||
- python: '3.8' | ||
tox-env: '38' | ||
- python: '3.9' | ||
tox-env: '39' | ||
- python: '3.10' | ||
tox-env: '310' | ||
- python: '3.11' | ||
tox-env: '311' | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python }} | ||
- name: Upgrade pip and install tox | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install tox | ||
- name: Run tests | ||
run: tox -e "py${{ matrix.tox-env }}-{oldest,latest}" | ||
|
||
trigger-publish: | ||
if: ${{ github.ref_type == 'tag' && startsWith(github.ref_name, 'v') }} | ||
needs: [run-linters, run-tests] | ||
uses: ./.github/workflows/publish.yml | ||
secrets: | ||
TEST_PYPI_API_TOKEN: ${{ secrets.TEST_PYPI_API_TOKEN }} | ||
PYPI_API_TOKEN: ${{ secrets.PYPI_API_TOKEN }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,126 @@ | ||
name: Build and publish package | ||
on: | ||
workflow_call: | ||
inputs: | ||
skipTestUpload: | ||
description: 'Skip uploading the package to Test PyPI?' | ||
required: false | ||
default: false | ||
type: boolean | ||
skipLiveUpload: | ||
description: 'Skip uploading the package to Live PyPI?' | ||
required: false | ||
default: false | ||
type: boolean | ||
secrets: | ||
TEST_PYPI_API_TOKEN: | ||
required: true | ||
PYPI_API_TOKEN: | ||
required: true | ||
workflow_dispatch: | ||
inputs: | ||
skipTestUpload: | ||
description: 'Skip uploading the package to Test PyPI?' | ||
required: false | ||
default: false | ||
type: boolean | ||
skipLiveUpload: | ||
description: 'Skip uploading the package to Live PyPI?' | ||
required: false | ||
default: false | ||
type: boolean | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out repository | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.10" | ||
- name: Upgrade pip and install tox | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install tox | ||
- name: Build the package | ||
run: tox -e build_package | ||
- name: Tar the dist directory | ||
run: tar -cvf dist.tar dist | ||
- name: Upload dist.tar | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: pycallnumber-dist | ||
path: dist.tar | ||
retention-days: 1 | ||
|
||
test-built-package: | ||
needs: build | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
include: | ||
- python: '2.7' | ||
tox-env: '27' | ||
- python: '3.5' | ||
tox-env: '35' | ||
- python: '3.6' | ||
tox-env: '36' | ||
- python: '3.7' | ||
tox-env: '37' | ||
- python: '3.8' | ||
tox-env: '38' | ||
- python: '3.9' | ||
tox-env: '39' | ||
- python: '3.10' | ||
tox-env: '310' | ||
- python: '3.11' | ||
tox-env: '311' | ||
steps: | ||
- name: Check out repository | ||
uses: actions/checkout@v3 | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python }} | ||
- name: Upgrade pip and install tox | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install tox | ||
- name: Download dist.tar | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: pycallnumber-dist | ||
- name: Un-tar built package | ||
run: | | ||
tar -xvf dist.tar | ||
ls -Rl | ||
- name: Install built package and run tests | ||
run: tox -e "py${{ matrix.tox-env }}-test_built_package" | ||
|
||
publish: | ||
needs: test-built-package | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Download built package | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: pycallnumber-dist | ||
- name: Un-tar built package | ||
run: | | ||
tar -xvf dist.tar | ||
ls -Rl | ||
- name: Publish package to Test PyPI | ||
if: ${{ !inputs.skipTestUpload }} | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
password: ${{ secrets.TEST_PYPI_API_TOKEN }} | ||
repository_url: https://test.pypi.org/legacy/ | ||
- name: Publish package to Live PyPI | ||
if: ${{ !inputs.skipLiveUpload && github.ref_type == 'tag' && startsWith(github.ref_name, 'v') && !(contains(github.ref_name, 'dev') || contains(github.ref_name, 'a') || contains(github.ref_name, 'b') || contains(github.ref_name, 'rc')) }} | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
password: ${{ secrets.PYPI_API_TOKEN }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
*.pyc | ||
/dist/ | ||
/build/ | ||
/*.egg-info | ||
/*.egg | ||
dist/ | ||
dist.tar | ||
build/ | ||
*.egg-info | ||
*.egg | ||
.cache/ | ||
__pycache__/ | ||
.python-version | ||
/.eggs/ | ||
/.tox/ | ||
.eggs/ | ||
.tox/ |
This file was deleted.
Oops, something went wrong.
File renamed without changes.
This file was deleted.
Oops, something went wrong.
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
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.