diff --git a/.flake8 b/.flake8 index 4d102bd..d9b0b18 100644 --- a/.flake8 +++ b/.flake8 @@ -4,3 +4,4 @@ extend-ignore = E501 E203 +max-line-length = 88 diff --git a/.github/workflows/python-tests.yml b/.github/workflows/python-tests.yml index 20e7924..b0efbd2 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 : 0b93645e9fea7318ecaed2b359559ac225c90a2b -# https://github.com/actions/checkout : 11bd71901bbe5b1630ceea73d27597364c9af683 -# https://github.com/actions/download-artifact : fa0a91b85d4f404e444e00e005971372dc801d16 -# https://github.com/actions/upload-artifact : 6f51ac03b9356f520e9adb1b1b7802705f340c2b +# https://github.com/actions/setup-python +# https://github.com/actions/checkout +# https://github.com/actions/download-artifact +# https://github.com/actions/upload-artifact on: pull_request: @@ -33,10 +33,10 @@ jobs: steps: - name: "Repo checkout" - uses: "actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683" + uses: "actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11" - name: "Set up Python ${{ matrix.python-version }}" - uses: "actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b" + uses: "actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c" with: python-version: "${{ matrix.python-version }}" allow-prereleases: true @@ -50,12 +50,11 @@ jobs: nox --session tests_with_coverage-${{ matrix.python-version }} - name: "Save coverage artifact" - uses: "actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b" + uses: "actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3" with: name: "coverage-artifact-${{ matrix.os}}-${{ matrix.python-version}}" path: ".coverage.*" retention-days: 1 - include-hidden-files: true coverage-compile: name: "coverage compile" @@ -63,10 +62,10 @@ jobs: runs-on: "ubuntu-latest" steps: - name: "Repo checkout" - uses: "actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683" + uses: "actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11" - name: "Set up Python" - uses: "actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b" + uses: "actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c" with: python-version: "3.12" @@ -75,7 +74,7 @@ jobs: python -m pip install --upgrade pip nox - name: "Download coverage artifacts" - uses: "actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16" + uses: "actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427" with: pattern: "coverage-artifact-*" merge-multiple: true @@ -92,10 +91,10 @@ jobs: runs-on: "ubuntu-latest" steps: - name: "Repo checkout" - uses: "actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683" + uses: "actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11" - name: "Set up Python" - uses: "actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b" + uses: "actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c" with: python-version: "3.12" diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1be4fc5..b8a3336 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: "v5.0.0" + rev: "v4.6.0" hooks: - id: check-json - id: check-toml @@ -12,6 +12,8 @@ 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 @@ -27,7 +29,7 @@ repos: # Format code. No, I don't like everything black does either. - repo: https://github.com/psf/black-pre-commit-mirror - rev: 24.10.0 + rev: 24.4.2 hooks: - id: black @@ -43,6 +45,6 @@ repos: # Type enforcement for Python - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.14.0 + rev: v1.11.1 hooks: - id: mypy diff --git a/noxfile.py b/noxfile.py index f9088a7..a64f157 100644 --- a/noxfile.py +++ b/noxfile.py @@ -107,12 +107,13 @@ 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, "--upgrade-deps") + session.run(py_command, "-m", "venv", VENV_PATH) + session.run(f"{venv_path}/python", "-m", "pip", "install", "--upgrade", "pip") session.run(f"{venv_path}/python", "-m", "pip", "install", "-e", ".[dev,test]") session.run(f"{venv_path}/pre-commit", "install") - if not venv_path: + if not os.environ.get("VIRTUAL_ENV"): session.log(f"\n\nRun '{activate_command}' to enter the virtual environment.\n") diff --git a/pyproject.toml b/pyproject.toml index 2fd37ca..284d9dc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -38,10 +38,6 @@ 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 c109579..a764745 100644 --- a/requirements/requirements-dev.txt +++ b/requirements/requirements-dev.txt @@ -1,4 +1,9 @@ # Development Requirements - linting, formatting, etc. pre-commit +black mypy +flake8 +flake8-builtins +flake8-pep585 +pep8-naming