-
Notifications
You must be signed in to change notification settings - Fork 3
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 #208 from treyhunner/fix-everything
Remove so much junk
- Loading branch information
Showing
13 changed files
with
367 additions
and
1,300 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,135 +5,93 @@ on: | |
- pull_request | ||
|
||
jobs: | ||
build-package: | ||
name: Build & verify package | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- uses: hynek/build-and-inspect-python-package@v2 | ||
id: baipp | ||
|
||
outputs: | ||
python-versions: ${{ steps.baipp.outputs.supported_python_classifiers_json_array }} | ||
|
||
tests: | ||
name: ${{ matrix.session }} ${{ matrix.python }} / ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
name: Tests on ${{ matrix.python-version }} | ||
needs: build-package | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- { python: "3.10", os: "ubuntu-latest", session: "pre-commit" } | ||
- { python: "3.10", os: "ubuntu-latest", session: "safety" } | ||
- { python: "3.10", os: "ubuntu-latest", session: "mypy" } | ||
- { python: "3.9", os: "ubuntu-latest", session: "mypy" } | ||
- { python: "3.8", os: "ubuntu-latest", session: "mypy" } | ||
- { python: "3.10", os: "ubuntu-latest", session: "tests" } | ||
- { python: "3.9", os: "ubuntu-latest", session: "tests" } | ||
- { python: "3.8", os: "ubuntu-latest", session: "tests" } | ||
- { python: "3.10", os: "windows-latest", session: "tests" } | ||
- { python: "3.10", os: "macos-latest", session: "tests" } | ||
- { python: "3.10", os: "ubuntu-latest", session: "typeguard" } | ||
- { python: "3.10", os: "ubuntu-latest", session: "xdoctest" } | ||
- { python: "3.10", os: "ubuntu-latest", session: "docs-build" } | ||
|
||
env: | ||
NOXSESSION: ${{ matrix.session }} | ||
FORCE_COLOR: "1" | ||
PRE_COMMIT_COLOR: "always" | ||
python-version: ${{ fromJson(needs.build-package.outputs.python-versions) }} | ||
|
||
steps: | ||
- name: Check out the repository | ||
uses: actions/[email protected] | ||
|
||
- name: Set up Python ${{ matrix.python }} | ||
uses: actions/[email protected] | ||
- uses: actions/checkout@v4 | ||
- name: Download pre-built packages | ||
uses: actions/download-artifact@v4 | ||
with: | ||
python-version: ${{ matrix.python }} | ||
|
||
- name: Upgrade pip | ||
run: | | ||
pip install --constraint=.github/workflows/constraints.txt pip | ||
pip --version | ||
- name: Upgrade pip in virtual environments | ||
shell: python | ||
run: | | ||
import os | ||
import pip | ||
with open(os.environ["GITHUB_ENV"], mode="a") as io: | ||
print(f"VIRTUALENV_PIP={pip.__version__}", file=io) | ||
name: Packages | ||
path: dist | ||
- run: tar xf dist/*.tar.gz --strip-components=1 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
allow-prereleases: true | ||
cache: pip | ||
|
||
- name: Install Poetry | ||
run: | | ||
pipx install --pip-args=--constraint=.github/workflows/constraints.txt poetry | ||
pipx install poetry | ||
poetry --version | ||
- name: Install Nox | ||
run: | | ||
pipx install --pip-args=--constraint=.github/workflows/constraints.txt nox | ||
pipx inject --pip-args=--constraint=.github/workflows/constraints.txt nox nox-poetry | ||
nox --version | ||
- name: Compute pre-commit cache key | ||
if: matrix.session == 'pre-commit' | ||
id: pre-commit-cache | ||
shell: python | ||
run: | | ||
import hashlib | ||
import sys | ||
python = "py{}.{}".format(*sys.version_info[:2]) | ||
payload = sys.version.encode() + sys.executable.encode() | ||
digest = hashlib.sha256(payload).hexdigest() | ||
result = "${{ runner.os }}-{}-{}-pre-commit".format(python, digest[:8]) | ||
pipx install nox | ||
pipx inject nox nox-poetry | ||
print("::set-output name=result::{}".format(result)) | ||
- name: Restore pre-commit cache | ||
uses: actions/[email protected] | ||
if: matrix.session == 'pre-commit' | ||
- name: Upload coverage data | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
path: ~/.cache/pre-commit | ||
key: ${{ steps.pre-commit-cache.outputs.result }}-${{ hashFiles('.pre-commit-config.yaml') }} | ||
restore-keys: | | ||
${{ steps.pre-commit-cache.outputs.result }}- | ||
name: coverage-data-${{ matrix.python-version }} | ||
path: .coverage.* | ||
if-no-files-found: ignore | ||
|
||
- name: Run Nox | ||
run: | | ||
nox --force-color --python=${{ matrix.python }} | ||
nox --force-color --python=${{ matrix.python-version }} | ||
- name: Upload coverage data | ||
if: always() && matrix.session == 'tests' | ||
uses: "actions/[email protected]" | ||
with: | ||
name: coverage-data | ||
path: ".coverage.*" | ||
|
||
- name: Upload documentation | ||
if: matrix.session == 'docs-build' | ||
uses: actions/[email protected] | ||
with: | ||
name: docs | ||
path: docs/_build | ||
|
||
coverage: | ||
runs-on: ubuntu-latest | ||
needs: tests | ||
steps: | ||
- name: Check out the repository | ||
uses: actions/checkout@v3.3.0 | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4.5.0 | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.10" | ||
|
||
- name: Upgrade pip | ||
run: | | ||
pip install --constraint=.github/workflows/constraints.txt pip | ||
pip --version | ||
python-version-file: .python-version-default | ||
cache: pip | ||
|
||
- name: Install Poetry | ||
run: | | ||
pipx install --pip-args=--constraint=.github/workflows/constraints.txt poetry | ||
pipx install poetry | ||
poetry --version | ||
- name: Install Nox | ||
run: | | ||
pipx install --pip-args=--constraint=.github/workflows/constraints.txt nox | ||
pipx inject --pip-args=--constraint=.github/workflows/constraints.txt nox nox-poetry | ||
nox --version | ||
pipx install nox | ||
pipx inject nox nox-poetry | ||
- name: Download coverage data | ||
uses: actions/[email protected] | ||
|
@@ -150,3 +108,18 @@ jobs: | |
- name: Upload coverage report | ||
uses: codecov/[email protected] | ||
|
||
required-checks-pass: | ||
name: Ensure everything required is passing for branch protection | ||
if: always() | ||
|
||
needs: | ||
- coverage | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Decide whether the needed jobs succeeded or failed | ||
uses: re-actors/alls-green@release/v1 | ||
with: | ||
jobs: ${{ toJSON(needs) }} |
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 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 @@ | ||
3.12 |
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,4 +1,5 @@ | ||
"""Sphinx configuration.""" | ||
|
||
from datetime import datetime | ||
|
||
|
||
|
Oops, something went wrong.