Skip to content

Commit

Permalink
Merge pull request #179 from Preocts/eoy-cleanup
Browse files Browse the repository at this point in the history
End of year cleanup
  • Loading branch information
Preocts authored Dec 28, 2024
2 parents eae084b + 37cf7e5 commit 7cfaf40
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 26 deletions.
1 change: 0 additions & 1 deletion .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@
extend-ignore =
E501
E203
max-line-length = 88
25 changes: 13 additions & 12 deletions .github/workflows/python-tests.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: "python tests and coverage"
# Uses:
# https://github.com/actions/setup-python
# https://github.com/actions/checkout
# https://github.com/actions/download-artifact
# https://github.com/actions/upload-artifact
# https://github.com/actions/setup-python : 0b93645e9fea7318ecaed2b359559ac225c90a2b
# https://github.com/actions/checkout : 11bd71901bbe5b1630ceea73d27597364c9af683
# https://github.com/actions/download-artifact : fa0a91b85d4f404e444e00e005971372dc801d16
# https://github.com/actions/upload-artifact : 6f51ac03b9356f520e9adb1b1b7802705f340c2b

on:
pull_request:
Expand Down Expand Up @@ -33,10 +33,10 @@ jobs:

steps:
- name: "Repo checkout"
uses: "actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11"
uses: "actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683"

- name: "Set up Python ${{ matrix.python-version }}"
uses: "actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c"
uses: "actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b"
with:
python-version: "${{ matrix.python-version }}"
allow-prereleases: true
Expand All @@ -50,22 +50,23 @@ jobs:
nox --session tests_with_coverage-${{ matrix.python-version }}
- name: "Save coverage artifact"
uses: "actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3"
uses: "actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b"
with:
name: "coverage-artifact-${{ matrix.os}}-${{ matrix.python-version}}"
path: ".coverage.*"
retention-days: 1
include-hidden-files: true

coverage-compile:
name: "coverage compile"
needs: "run-tests-and-coverage"
runs-on: "ubuntu-latest"
steps:
- name: "Repo checkout"
uses: "actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11"
uses: "actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683"

- name: "Set up Python"
uses: "actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c"
uses: "actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b"
with:
python-version: "3.12"

Expand All @@ -74,7 +75,7 @@ jobs:
python -m pip install --upgrade pip nox
- name: "Download coverage artifacts"
uses: "actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427"
uses: "actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16"
with:
pattern: "coverage-artifact-*"
merge-multiple: true
Expand All @@ -91,10 +92,10 @@ jobs:
runs-on: "ubuntu-latest"
steps:
- name: "Repo checkout"
uses: "actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11"
uses: "actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683"

- name: "Set up Python"
uses: "actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c"
uses: "actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b"
with:
python-version: "3.12"

Expand Down
8 changes: 3 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,14 @@ ci:
repos:
# Batch of helpful formatters and patterns
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: "v4.6.0"
rev: "v5.0.0"
hooks:
- id: check-json
- id: check-toml
- id: check-yaml
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-docstring-first
- id: debug-statements
- id: mixed-line-ending

# Adds a standard feel to import segments
- repo: https://github.com/pycqa/isort
Expand All @@ -29,7 +27,7 @@ repos:

# Format code. No, I don't like everything black does either.
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 24.4.2
rev: 24.10.0
hooks:
- id: black

Expand All @@ -45,6 +43,6 @@ repos:

# Type enforcement for Python
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.11.1
rev: v1.14.0
hooks:
- id: mypy
5 changes: 2 additions & 3 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,12 @@ def install(session: nox.Session) -> None:
activate_command = f"source {venv_path}/activate"

if not os.path.exists(VENV_PATH):
session.run(py_command, "-m", "venv", VENV_PATH)
session.run(f"{venv_path}/python", "-m", "pip", "install", "--upgrade", "pip")
session.run(py_command, "-m", "venv", VENV_PATH, "--upgrade-deps")

session.run(f"{venv_path}/python", "-m", "pip", "install", "-e", ".[dev,test]")
session.run(f"{venv_path}/pre-commit", "install")

if not os.environ.get("VIRTUAL_ENV"):
if not venv_path:
session.log(f"\n\nRun '{activate_command}' to enter the virtual environment.\n")


Expand Down
4 changes: 4 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ homepage = "https://github.com/[ORG NAME]/[REPO NAME]"
# [project.scripts]
# python-src-example = "module_name.sample:main"

[tool.black]
line-length = 100
target-version = ['py39']

[tool.setuptools.package-data]
"module_name" = ["py.typed"]

Expand Down
5 changes: 0 additions & 5 deletions requirements/requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
# Development Requirements - linting, formatting, etc.

pre-commit
black
mypy
flake8
flake8-builtins
flake8-pep585
pep8-naming

0 comments on commit 7cfaf40

Please sign in to comment.