diff --git a/.flake8 b/.flake8 index d9b0b18..4d102bd 100644 --- a/.flake8 +++ b/.flake8 @@ -4,4 +4,3 @@ extend-ignore = E501 E203 -max-line-length = 88 diff --git a/.github/workflows/python-tests.yml b/.github/workflows/python-tests.yml index b0efbd2..20e7924 100644 --- a/.github/workflows/python-tests.yml +++ b/.github/workflows/python-tests.yml @@ -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: @@ -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 @@ -50,11 +50,12 @@ 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" @@ -62,10 +63,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" @@ -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 @@ -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" diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b8a3336..1be4fc5 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -4,7 +4,7 @@ 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 @@ -12,8 +12,6 @@ repos: - 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 @@ -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 @@ -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 diff --git a/noxfile.py b/noxfile.py index a64f157..f9088a7 100644 --- a/noxfile.py +++ b/noxfile.py @@ -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") diff --git a/pyproject.toml b/pyproject.toml index 284d9dc..2fd37ca 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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"] diff --git a/requirements/requirements-dev.txt b/requirements/requirements-dev.txt index a764745..c109579 100644 --- a/requirements/requirements-dev.txt +++ b/requirements/requirements-dev.txt @@ -1,9 +1,4 @@ # Development Requirements - linting, formatting, etc. pre-commit -black mypy -flake8 -flake8-builtins -flake8-pep585 -pep8-naming