From 74f16d6bcca6f7d88d14ceaae09ca9366452ab5b Mon Sep 17 00:00:00 2001 From: Brian Skinn Date: Sat, 22 Nov 2025 00:35:52 -0500 Subject: [PATCH 01/36] Update Python versions --- .github/workflows/ci_tests.yml | 27 +++++++++++++++------------ pyproject.toml | 6 +++--- tox.ini | 18 +++++++++++++----- 3 files changed, 31 insertions(+), 20 deletions(-) diff --git a/.github/workflows/ci_tests.yml b/.github/workflows/ci_tests.yml index d0593d4..3151b44 100644 --- a/.github/workflows/ci_tests.yml +++ b/.github/workflows/ci_tests.yml @@ -4,18 +4,22 @@ on: push jobs: all_checks: - name: Run all tests, lints, etc. (Python 3.11) + name: Run all tests, lints, etc. (Python 3.14) runs-on: ubuntu-latest - if: "!contains(github.event.head_commit.message, '[skip ci]')" + if: '!contains(github.event.head_commit.message, ''[skip ci]'')' steps: - name: Check out repo - uses: actions/checkout@v2 + uses: actions/checkout@v6 - name: Install Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v6 with: - python-version: '3.11' + python-version: '3.14' + cache: 'pip' + cache-dependency-path: | + requirements-ci.txt + requirements-flake8.txt - name: Update pip & setuptools run: python -m pip install -U pip setuptools @@ -34,26 +38,25 @@ jobs: - name: Lint code run: tox -e flake8 - - name: Transmit to Codecov - run: codecov - just_tests: name: Run only the test suite runs-on: ubuntu-latest strategy: matrix: - python: ['3.8', '3.9', '3.10', '3.11', '3.12'] - if: "!contains(github.event.head_commit.message, '[skip ci]')" + python: ['3.10', '3.11', '3.12', '3.13'] + if: '!contains(github.event.head_commit.message, ''[skip ci]'')' steps: - name: Check out repo - uses: actions/checkout@v2 + uses: actions/checkout@v6 - name: Install Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v6 with: python-version: ${{ matrix.python }} + cache: 'pip' + cache-dependency-path: requirements-ci.txt - name: Update pip & setuptools run: python -m pip install -U pip setuptools diff --git a/pyproject.toml b/pyproject.toml index cbc890c..2530776 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -21,11 +21,11 @@ classifiers = [ "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", "Topic :: Software Development :: Quality Assurance", "Development Status :: 5 - Production/Stable", ] @@ -35,7 +35,7 @@ keywords = [ "absolute-imports", "relative-imports", ] -requires-python = ">=3.6" +requires-python = ">=3.10" dependencies = [ "flake8>=5.0", ] diff --git a/tox.ini b/tox.ini index 1334960..8ad1b66 100644 --- a/tox.ini +++ b/tox.ini @@ -2,8 +2,8 @@ minversion=2.0 isolated_build=True envlist= - py3{7,8,9,10,11,12}-f8_{min,latest} - py3{11,12}-f8_{5_x} + py3{10,11,12,13,14}-f8_{min,latest} + py3{13,14}-f8_{5_x,6_x} sdist_install flake8 @@ -17,16 +17,24 @@ deps= f8_latest: flake8 f8_min: flake8==5.0 f8_5_x: flake8~=5.0 + f8_6_x: flake8~=6.0 + +[testenv:win32] +platform=win32 +basepython= + py313: python3.13 + py312: python3.12 + py311: python3.11 + py310: python3.10 [testenv:linux] platform=linux basepython= + py314: python3.14 + py313: python3.13 py312: python3.12 py311: python3.11 py310: python3.10 - py39: python3.9 - py38: python3.8 - py37: python3.7 [testenv:sdist_install] commands= From 3d8fe3a0a5ead69e562e9c984d0d2355f16a90b3 Mon Sep 17 00:00:00 2001 From: Brian Skinn Date: Thu, 27 Nov 2025 00:10:03 -0500 Subject: [PATCH 02/36] Spruce up ci_test -> core_tests --- .github/workflows/{ci_tests.yml => core_tests.yml} | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) rename .github/workflows/{ci_tests.yml => core_tests.yml} (92%) diff --git a/.github/workflows/ci_tests.yml b/.github/workflows/core_tests.yml similarity index 92% rename from .github/workflows/ci_tests.yml rename to .github/workflows/core_tests.yml index 3151b44..a8720ad 100644 --- a/.github/workflows/ci_tests.yml +++ b/.github/workflows/core_tests.yml @@ -1,10 +1,10 @@ -name: ci-tests +name: 'PR: Run core tests' -on: push +on: pull_request jobs: all_checks: - name: Run all tests, lints, etc. (Python 3.14) + name: plus lints, etc. on Python 3.14 runs-on: ubuntu-latest if: '!contains(github.event.head_commit.message, ''[skip ci]'')' @@ -40,7 +40,7 @@ jobs: just_tests: - name: Run only the test suite + name: for Python ${{ matrix.python }} runs-on: ubuntu-latest strategy: matrix: From 9aa947487040c7817d7d1d07919408600f6ad950 Mon Sep 17 00:00:00 2001 From: Brian Skinn Date: Thu, 27 Nov 2025 00:10:16 -0500 Subject: [PATCH 03/36] Add sdist_test workflow --- .github/workflows/sdist_test.yml | 74 ++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 .github/workflows/sdist_test.yml diff --git a/.github/workflows/sdist_test.yml b/.github/workflows/sdist_test.yml new file mode 100644 index 0000000..1cb0173 --- /dev/null +++ b/.github/workflows/sdist_test.yml @@ -0,0 +1,74 @@ +name: 'RELEASE: Check sdist' + +on: + pull_request: + types: + - opened + - reopened + - synchronize + - ready_for_review + branches: + - stable + +jobs: + sdist_build_and_check: + name: builds & is testable + runs-on: 'ubuntu-latest' + concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + if: ${{ !github.event.pull_request.draft }} + + steps: + - name: Check out repo + uses: actions/checkout@v6 + + - name: Install Python + uses: actions/setup-python@v6 + with: + python-version: '3.14' + cache: 'pip' + cache-dependency-path: | + requirements-dev.txt + requirements-flake8.txt + + - name: Install 'build' package + run: python -m pip install build + + - name: Build sdist + run: | + python -m build -s + ls -lah dist + + - name: Create sandbox + run: mkdir sandbox + + - name: Unpack sdist in sandbox + run: | + cp dist/*.gz sandbox/ + cd sandbox + tar xvf *.gz + + - name: Create venv + run: | + cd sandbox + python -m venv env + + # Only the dir of the unpacked sdist will have a digit in its name + - name: Store sdist unpack path + run: echo "UNPACK_PATH=$( find sandbox -maxdepth 1 -type d -regex 'sandbox/.+[0-9].+' )" >> $GITHUB_ENV + + - name: Report sdist unpack path + run: echo $UNPACK_PATH + + - name: Install dev req'ts to venv + run: | + source sandbox/env/bin/activate + cd "$UNPACK_PATH" + python -m pip install -r requirements-dev.txt + + - name: Run test suite in sandbox + run: | + source sandbox/env/bin/activate + cd "$UNPACK_PATH" + pytest From 9ab3ec04133f790637c95d8c0e9d167f9f95e810 Mon Sep 17 00:00:00 2001 From: Brian Skinn Date: Thu, 27 Nov 2025 00:10:43 -0500 Subject: [PATCH 04/36] Deactivate Azure Pipelines --- azure-pipelines.yml => azure-pipelines-INACTIVE.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename azure-pipelines.yml => azure-pipelines-INACTIVE.yml (100%) diff --git a/azure-pipelines.yml b/azure-pipelines-INACTIVE.yml similarity index 100% rename from azure-pipelines.yml rename to azure-pipelines-INACTIVE.yml From 6d2e9ae87a2b6e52452648289b6f967856783007 Mon Sep 17 00:00:00 2001 From: Brian Skinn Date: Thu, 27 Nov 2025 00:15:03 -0500 Subject: [PATCH 05/36] Add initial testdir_coverage workflow --- .github/workflows/testdir_coverage.yml | 38 ++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/testdir_coverage.yml diff --git a/.github/workflows/testdir_coverage.yml b/.github/workflows/testdir_coverage.yml new file mode 100644 index 0000000..0e8e492 --- /dev/null +++ b/.github/workflows/testdir_coverage.yml @@ -0,0 +1,38 @@ +name: 'RELEASE: Ensure all tests ran' + +on: + pull_request: + types: + - opened + - reopened + - synchronize + - ready_for_review + branches: + - stable + +jobs: + testdir_coverage: + name: via coverage check + runs-on: 'ubuntu-latest' + if: ${{ !github.event.pull_request.draft }} + + steps: + - name: Check out repo + uses: actions/checkout@v6 + + - name: Install Python + uses: actions/setup-python@v6 + with: + python-version: '3.14' + cache: 'pip' + cache-dependency-path: | + requirements-ci.txt + + - name: Install CI requirements + run: pip install -r requirements-ci.txt + + - name: Run pytest with coverage + run: pytest --cov + + - name: Check 100% test execution + run: coverage report --include="tests/*" --fail-under=100 From 6b790f6156f04ea27d7d5b3bc4c7f481e42c9cd9 Mon Sep 17 00:00:00 2001 From: Brian Skinn Date: Thu, 27 Nov 2025 00:15:48 -0500 Subject: [PATCH 06/36] Rename workflows to indicate run context --- .github/workflows/{core_tests.yml => all_core_tests.yml} | 0 .github/workflows/{sdist_test.yml => release_sdist_test.yml} | 0 .../{testdir_coverage.yml => release_testdir_coverage.yml} | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{core_tests.yml => all_core_tests.yml} (100%) rename .github/workflows/{sdist_test.yml => release_sdist_test.yml} (100%) rename .github/workflows/{testdir_coverage.yml => release_testdir_coverage.yml} (100%) diff --git a/.github/workflows/core_tests.yml b/.github/workflows/all_core_tests.yml similarity index 100% rename from .github/workflows/core_tests.yml rename to .github/workflows/all_core_tests.yml diff --git a/.github/workflows/sdist_test.yml b/.github/workflows/release_sdist_test.yml similarity index 100% rename from .github/workflows/sdist_test.yml rename to .github/workflows/release_sdist_test.yml diff --git a/.github/workflows/testdir_coverage.yml b/.github/workflows/release_testdir_coverage.yml similarity index 100% rename from .github/workflows/testdir_coverage.yml rename to .github/workflows/release_testdir_coverage.yml From 3ca7162f51c8efac24ef4c04984afd9a9685e64d Mon Sep 17 00:00:00 2001 From: Brian Skinn Date: Thu, 27 Nov 2025 00:25:37 -0500 Subject: [PATCH 07/36] Add/fix [skip ci] handling --- .github/workflows/all_core_tests.yml | 2 +- .github/workflows/release_sdist_test.yml | 2 +- .github/workflows/release_testdir_coverage.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/all_core_tests.yml b/.github/workflows/all_core_tests.yml index a8720ad..9ecbcad 100644 --- a/.github/workflows/all_core_tests.yml +++ b/.github/workflows/all_core_tests.yml @@ -6,7 +6,7 @@ jobs: all_checks: name: plus lints, etc. on Python 3.14 runs-on: ubuntu-latest - if: '!contains(github.event.head_commit.message, ''[skip ci]'')' + if: ${{ !contains(toJson(github.event), '[skip ci]') }} steps: - name: Check out repo diff --git a/.github/workflows/release_sdist_test.yml b/.github/workflows/release_sdist_test.yml index 1cb0173..52af614 100644 --- a/.github/workflows/release_sdist_test.yml +++ b/.github/workflows/release_sdist_test.yml @@ -17,7 +17,7 @@ jobs: concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true - if: ${{ !github.event.pull_request.draft }} + if: ${{ !github.event.pull_request.draft && !contains(toJson(github.event), '[skip ci]')}} steps: - name: Check out repo diff --git a/.github/workflows/release_testdir_coverage.yml b/.github/workflows/release_testdir_coverage.yml index 0e8e492..d66b3b8 100644 --- a/.github/workflows/release_testdir_coverage.yml +++ b/.github/workflows/release_testdir_coverage.yml @@ -14,7 +14,7 @@ jobs: testdir_coverage: name: via coverage check runs-on: 'ubuntu-latest' - if: ${{ !github.event.pull_request.draft }} + if: ${{ !github.event.pull_request.draft && !contains(toJson(github.event), '[skip ci]')}} steps: - name: Check out repo From a39e97fa3459313fee04a2e42fd0e53a834ebcfe Mon Sep 17 00:00:00 2001 From: Brian Skinn Date: Thu, 27 Nov 2025 00:25:49 -0500 Subject: [PATCH 08/36] Add cross-platform tests for PRs to stable --- .github/workflows/release_platform_tests.yml | 49 ++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 .github/workflows/release_platform_tests.yml diff --git a/.github/workflows/release_platform_tests.yml b/.github/workflows/release_platform_tests.yml new file mode 100644 index 0000000..1ccb6f7 --- /dev/null +++ b/.github/workflows/release_platform_tests.yml @@ -0,0 +1,49 @@ +name: 'RELEASE: Run cross-platform tests' + +on: + pull_request: + types: + - opened + - reopened + - synchronize + - ready_for_review + branches: + - stable + +jobs: + just_tests: + name: ${{ matrix.os }} python ${{ matrix.py }} + runs-on: ${{ matrix.os }} + concurrency: + group: ${{ github.workflow }}-${{ matrix.os }}-${{ matrix.py }}-${{ github.ref }} + cancel-in-progress: true + if: ${{ !github.event.pull_request.draft && !contains(toJson(github.event), '[skip ci]') }} + strategy: + matrix: + os: ['windows-latest', 'macos-latest'] + py: ['3.10', '3.11', '3.12', '3.13'] + + steps: + - name: Check out repo + uses: actions/checkout@v6 + + - name: Install Python + uses: actions/setup-python@v6 + with: + python-version: ${{ matrix.py }} + cache: 'pip' + cache-dependency-path: requirements-ci.txt + + - name: Update pip & setuptools + run: python -m pip install -U pip setuptools + + - name: Install & report CI dependencies + run: | + python -m pip install -U --force-reinstall -r requirements-ci.txt + python --version + pip list + + - name: Run tests + run: | + pytest --cov + tox -e sdist_install From 0c8dfe9a60fe837d0b1cc370004b7fdffaae9393 Mon Sep 17 00:00:00 2001 From: Brian Skinn Date: Thu, 27 Nov 2025 00:32:18 -0500 Subject: [PATCH 09/36] Switch primary testing Python to 3.13 flake8 seems unhappy on 3.14. --- .github/workflows/all_core_tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/all_core_tests.yml b/.github/workflows/all_core_tests.yml index 9ecbcad..18f799e 100644 --- a/.github/workflows/all_core_tests.yml +++ b/.github/workflows/all_core_tests.yml @@ -4,7 +4,7 @@ on: pull_request jobs: all_checks: - name: plus lints, etc. on Python 3.14 + name: plus lints, etc. on Python 3.13 runs-on: ubuntu-latest if: ${{ !contains(toJson(github.event), '[skip ci]') }} @@ -44,7 +44,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python: ['3.10', '3.11', '3.12', '3.13'] + python: ['3.10', '3.11', '3.12', '3.14'] if: '!contains(github.event.head_commit.message, ''[skip ci]'')' steps: From 263b407d71232bd343491899adcdfdfc4e2db028 Mon Sep 17 00:00:00 2001 From: Brian Skinn Date: Thu, 27 Nov 2025 00:34:12 -0500 Subject: [PATCH 10/36] Actually *ahem* change the Python version --- .github/workflows/all_core_tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/all_core_tests.yml b/.github/workflows/all_core_tests.yml index 18f799e..4ae1537 100644 --- a/.github/workflows/all_core_tests.yml +++ b/.github/workflows/all_core_tests.yml @@ -15,7 +15,7 @@ jobs: - name: Install Python uses: actions/setup-python@v6 with: - python-version: '3.14' + python-version: '3.13' cache: 'pip' cache-dependency-path: | requirements-ci.txt From cc750fb83e1ac5748f7ec74d3789d9334480ea97 Mon Sep 17 00:00:00 2001 From: Brian Skinn Date: Thu, 27 Nov 2025 10:07:49 -0500 Subject: [PATCH 11/36] Delete Azure Pipelines YAML --- azure-coretest.yml | 33 ---------------- azure-pipelines-INACTIVE.yml | 58 ---------------------------- azure-sdisttest.yml | 74 ------------------------------------ 3 files changed, 165 deletions(-) delete mode 100644 azure-coretest.yml delete mode 100644 azure-pipelines-INACTIVE.yml delete mode 100644 azure-sdisttest.yml diff --git a/azure-coretest.yml b/azure-coretest.yml deleted file mode 100644 index 9d89f6a..0000000 --- a/azure-coretest.yml +++ /dev/null @@ -1,33 +0,0 @@ -parameters: - pythons: [] - platforms: [] - -jobs: -- ${{ each python in parameters.pythons }}: - - ${{ each platform in parameters.platforms }}: - - job: ${{ coalesce(python.value.name, python.key) }}_${{ coalesce(platform, 'linux') }} - variables: - ${{ if eq(platform, 'linux') }}: - image: 'Ubuntu-latest' - ${{ if eq(platform, 'windows') }}: - image: 'windows-latest' - ${{ if eq(platform, 'macOs') }}: - image: 'macOS-latest' - ${{ if notIn(platform, 'macOs', 'linux', 'windows') }}: - image: 'Ubuntu-latest' - - pool: - vmImage: $[ variables.image ] - - steps: - - task: UsePythonVersion@0 - inputs: - versionSpec: '${{ python.value.spec }}' - architecture: 'x64' - displayName: Use cached Python ${{ python.value.spec }} for tests. - - - script: pip install -r requirements-ci.txt - displayName: Install CI requirements - - - script: pytest - displayName: Run pytest (Python ${{ python.value.spec }}) diff --git a/azure-pipelines-INACTIVE.yml b/azure-pipelines-INACTIVE.yml deleted file mode 100644 index 910ca23..0000000 --- a/azure-pipelines-INACTIVE.yml +++ /dev/null @@ -1,58 +0,0 @@ -trigger: - - release-* - -pr: - branches: - include: - - main - - stable - - -jobs: -- template: azure-coretest.yml - parameters: - pythons: - py38: - spec: '3.8' - py39: - spec: '3.9' - py310: - spec: '3.10' - py311: - spec: '3.11' - py312: - spec: '3.12' - platforms: [linux, windows, macOs] - -- template: azure-sdisttest.yml - -- job: flake8 - pool: - vmImage: 'Ubuntu-latest' - steps: - - task: UsePythonVersion@0 - inputs: - versionSpec: '3.11' - - - script: pip install -U tox - displayName: Install tox - - - script: tox -e flake8 - displayName: Lint the codebase - -- job: testdir_coverage - pool: - vmImage: 'Ubuntu-latest' - steps: - - task: UsePythonVersion@0 - inputs: - versionSpec: '3.11' - - - script: pip install -r requirements-ci.txt - displayName: Install CI requirements - - - script: pytest --cov - displayName: Run pytest with coverage - - - script: coverage report --include="tests/*" --fail-under=100 - displayName: Check 100% test execution diff --git a/azure-sdisttest.yml b/azure-sdisttest.yml deleted file mode 100644 index 9f7e2a3..0000000 --- a/azure-sdisttest.yml +++ /dev/null @@ -1,74 +0,0 @@ -jobs: -- job: testable_sdist - displayName: Ensure sdist is testable - - variables: - pip_cache_dir: $(Pipeline.Workspace)/.pip - - pool: - vmImage: 'Ubuntu-latest' - - steps: - - task: UsePythonVersion@0 - inputs: - versionSpec: '3.11' - - - task: Cache@2 - inputs: - key: 'pip | "$(Agent.OS)" | requirements-dev.txt | requirements-flake8.txt' - restoreKeys: | - pip | "$(Agent.OS)" - path: $(pip_cache_dir) - displayName: Cache pip - - - script: python -m pip install build - displayName: Install 'build' package - - - script: | - python -m build -s - ls -lah dist - displayName: Build sdist - - - script: | - mkdir sandbox - displayName: Create sandbox - - - script: | - cp dist/*.gz sandbox/ - cd sandbox - tar xvf *.gz - displayName: Unpack sdist in sandbox - - - script: | - cd sandbox - python -m venv env - displayName: Create venv - - # Only the dir of the unpacked sdist will have a digit in its name - - script: | - cd sandbox - echo $( find . -maxdepth 1 -type d -regex "./.+[0-9].+" ) - displayName: Check unpack dir name - - - script: | - cd sandbox - source env/bin/activate - cd $( find . -maxdepth 1 -type d -regex "./.+[0-9].+" ) - python -m pip install -r requirements-dev.txt - displayName: Install dev req'ts to venv - - - script: | - cd sandbox - source env/bin/activate - cd $( find . -maxdepth 1 -type d -regex "./.+[0-9].+" ) - cd doc - O=-Ean make html - displayName: Build docs in sandbox (skipped, no docs) - condition: false - - - script: | - cd sandbox - source env/bin/activate - cd $( find . -maxdepth 1 -type d -regex "./.+[0-9].+" ) - pytest - displayName: Run test suite in sandbox From 0c41294f85f3eaa53be6f8a7b918b66e82ee7da8 Mon Sep 17 00:00:00 2001 From: Brian Skinn Date: Thu, 27 Nov 2025 10:09:45 -0500 Subject: [PATCH 12/36] Update some project meta-content --- AUTHORS.md | 2 +- README.rst | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/AUTHORS.md b/AUTHORS.md index 24aebe9..96fd011 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -2,7 +2,7 @@ Credits ======= `flake8-absolute-import` is authored and maintained by Brian Skinn -([Blog](https://bskinn.github.io)) ([Twitter](https://twitter.com/btskinn)). The +([Blog](https://bskinn.github.io)) ([Mastodon](https://fosstodon.org/@btskinn)). The skeleton of the AST-based implementation used for this plugin was shamelessly swiped from [`flake8-2020`](https://github.com/asottile/flake8-2020) by [Anthony Sottile](https://github.com/asottile). diff --git a/README.rst b/README.rst index 7044895..c47fe37 100644 --- a/README.rst +++ b/README.rst @@ -5,13 +5,10 @@ flake8-absolute-import **Current Development Version:** -.. image:: https://img.shields.io/github/actions/workflow/status/bskinn/flake8-absolute-import/ci_tests.yml?branch=main&logo=github +.. image:: https://img.shields.io/github/actions/workflow/status/bskinn/flake8-absolute-import/all_core_tests.yml?branch=release-1.0.0.3&logo=github :alt: GitHub Workflow Status :target: https://github.com/bskinn/flake8-absolute-import/actions -.. image:: https://codecov.io/gh/bskinn/flake8-absolute-import/branch/main/graph/badge.svg - :target: https://codecov.io/gh/bskinn/flake8-absolute-import - **Most Recent Stable Release:** .. image:: https://img.shields.io/pypi/v/flake8-absolute-import.svg?logo=pypi From 3550178db45daa73ff1dd44ed30d3bb8e0f187b8 Mon Sep 17 00:00:00 2001 From: Brian Skinn Date: Thu, 27 Nov 2025 11:35:59 -0500 Subject: [PATCH 13/36] Add typing --- MANIFEST.in | 1 + pyproject.toml | 15 +++++++++++++++ requirements-dev.txt | 1 + setup.py | 3 ++- src/flake8_absolute_import/core.py | 19 +++++++++++-------- src/flake8_absolute_import/py.typed | 1 + src/flake8_absolute_import/version.py | 2 +- 7 files changed, 32 insertions(+), 10 deletions(-) create mode 100644 src/flake8_absolute_import/py.typed diff --git a/MANIFEST.in b/MANIFEST.in index 8606d0b..34dd218 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,2 +1,3 @@ include AUTHORS.md LICENSE.txt README.rst CHANGELOG.md pyproject.toml include requirements-dev.txt requirements-flake8.txt tox.ini +include src/flake8_absolute_import/py.typed diff --git a/pyproject.toml b/pyproject.toml index 2530776..ae6ad42 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -95,3 +95,18 @@ exclude = ''' | ^env ) ''' + +[tool.mypy] +mypy_path = "src" +warn_return_any = true +warn_unused_configs = true +exclude = '''(?x)( + ^env/ + ) + ''' + +[[tool.mypy.overrides]] +module = [ + "pytest", +] +ignore_missing_imports = true diff --git a/requirements-dev.txt b/requirements-dev.txt index b8537c1..0ed034b 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -3,6 +3,7 @@ pytest>=4.4.0 pytest-cov restview tox +types-setuptools twine wget -r requirements-flake8.txt diff --git a/setup.py b/setup.py index 19adc57..0672011 100644 --- a/setup.py +++ b/setup.py @@ -1,9 +1,10 @@ import re from pathlib import Path from setuptools import find_packages, setup +from typing import Any -exec_ns = {} +exec_ns: dict[str, Any] = {} exec( Path("src", "flake8_absolute_import", "version.py").read_text(encoding="utf-8"), exec_ns, diff --git a/src/flake8_absolute_import/core.py b/src/flake8_absolute_import/core.py index 63ba5a2..cd05e56 100644 --- a/src/flake8_absolute_import/core.py +++ b/src/flake8_absolute_import/core.py @@ -22,21 +22,22 @@ """ import ast +from typing import Generator from flake8_absolute_import.version import __version__ -ABS101 = "ABS101 Relative import found" +ABS101: str = "ABS101 Relative import found" class Visitor(ast.NodeVisitor): """NodeVisitor to report relative imports.""" - def __init__(self): + def __init__(self) -> None: """Create a Visitor with empty errors list.""" - self.errors = [] + self.errors: list[tuple[int, int, str]] = [] - def visit_ImportFrom(self, node): # noqa: N802 + def visit_ImportFrom(self, node) -> None: # noqa: N802 """Implement check for relative import.""" if node.level > 0: self.errors.append((node.lineno, node.col_offset, ABS101)) @@ -47,17 +48,19 @@ def visit_ImportFrom(self, node): # noqa: N802 class Plugin: """Core plugin class for flake8-absolute-import.""" - name = "flake8-absolute-import" + name: str = "flake8-absolute-import" version = __version__ - def __init__(self, tree): + def __init__(self, tree: ast.Module) -> None: """Create plugin instance from the provided AST.""" self._tree = tree - def run(self): + def run(self) -> Generator[tuple[int, int, str, type], None, None]: """Traverse the AST and collect the errors.""" visitor = Visitor() visitor.visit(self._tree) - for line, col, msg in visitor.errors: + errors: list[tuple[int, int, str]] = visitor.errors + + for line, col, msg in errors: yield line, col, msg, type(self) diff --git a/src/flake8_absolute_import/py.typed b/src/flake8_absolute_import/py.typed new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/src/flake8_absolute_import/py.typed @@ -0,0 +1 @@ + diff --git a/src/flake8_absolute_import/version.py b/src/flake8_absolute_import/version.py index e7b00e5..5ffe9a8 100644 --- a/src/flake8_absolute_import/version.py +++ b/src/flake8_absolute_import/version.py @@ -21,4 +21,4 @@ """ -__version__ = "1.0.0.3.dev0" +__version__: str = "1.0.0.3.dev0" From b13ccd001c477c7805d7ca97207296c883d52c91 Mon Sep 17 00:00:00 2001 From: Brian Skinn Date: Thu, 27 Nov 2025 11:36:24 -0500 Subject: [PATCH 14/36] Add black and mypy tox envs --- tox.ini | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tox.ini b/tox.ini index 8ad1b66..fbbc255 100644 --- a/tox.ini +++ b/tox.ini @@ -48,6 +48,20 @@ commands= flake8 --version flake8 tests src +[testenv:black] +skip_install=True +deps=black +commands= + black {posargs} . + +[testenv:mypy] +description=Type-check with mypy +skip_install=True +deps=mypy +commands= + mypy --version + mypy {posargs} src tests + [pytest] addopts = -v -rsX -W error::Warning --strict-markers xfail_strict = True From 9b1692e54017d22aff880e8f7dcecf9a5dbefed7 Mon Sep 17 00:00:00 2001 From: Brian Skinn Date: Thu, 27 Nov 2025 11:36:40 -0500 Subject: [PATCH 15/36] Update/fix black config in pyproject.toml --- pyproject.toml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index ae6ad42..af09c66 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -81,18 +81,18 @@ namespaces = false line-length = 88 include = ''' ( - ^tests/.*[.]py$ - | ^src/flake8_absolute_import/.*[.]py$ - | ^setup[.]py - | ^conftest[.]py + ^/tests/.*[.]py$ + | ^/src/flake8_absolute_import/.*[.]py$ + | ^/setup[.]py + | ^/conftest[.]py ) ''' exclude = ''' ( __pycache__ - | ^[.] - | ^doc - | ^env + | ^/[.] + | ^/doc + | ^/env ) ''' From 4fdf31aa96293c7fdbcfe748fc67f886a8e09ed6 Mon Sep 17 00:00:00 2001 From: Brian Skinn Date: Thu, 27 Nov 2025 11:36:51 -0500 Subject: [PATCH 16/36] Modernize pyproject.toml --- pyproject.toml | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index af09c66..33832b4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [build-system] requires = [ "wheel", - "setuptools>=61.2", + "setuptools>=77", ] build-backend = "setuptools.build_meta" @@ -11,9 +11,11 @@ description = "flake8 plugin to require absolute imports" authors = [ { name = "Brian Skinn", email = "brian.skinn@gmail.com" }, ] +license = "MIT" +license-files = [ + "LICENSE.txt", +] classifiers = [ - "License :: OSI Approved", - "License :: OSI Approved :: MIT License", "Natural Language :: English", "Framework :: Flake8", "Intended Audience :: Developers", @@ -50,9 +52,6 @@ Changelog = "https://github.com/bskinn/flake8-absolute-import/blob/main/CHANGELO Thank = "https://twitter.com/btskinn" Donate = "https://github.com/sponsors/bskinn" -[project.license] -text = "MIT License" - [project.entry-points."flake8.extension"] ABS1 = "flake8_absolute_import:Plugin" @@ -60,9 +59,6 @@ ABS1 = "flake8_absolute_import:Plugin" platforms = [ "any", ] -license-files = [ - "LICENSE.txt", -] include-package-data = false [tool.setuptools.dynamic] From a0bc4d8c0d849cd127339669150a4818adda23c1 Mon Sep 17 00:00:00 2001 From: Brian Skinn Date: Thu, 27 Nov 2025 19:06:44 -0500 Subject: [PATCH 17/36] Add isort and check tox envs --- tox.ini | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/tox.ini b/tox.ini index fbbc255..5bab19a 100644 --- a/tox.ini +++ b/tox.ini @@ -62,6 +62,31 @@ commands= mypy --version mypy {posargs} src tests +[testenv:isort] +description=Sort, group, and coalesce imports +skip_install=True +deps=isort +commands= + isort --version + isort {posargs} src tests + +[testenv:check] +description=Run isort, black, flake8, and mypy +skip_install=True +deps= + isort + black + -r requirements-flake8.txt + mypy +commands= + isort --version + isort {posargs} src tests + black {posargs} . + flake8 --version + flake8 tests src + mypy --version + mypy {posargs} src tests + [pytest] addopts = -v -rsX -W error::Warning --strict-markers xfail_strict = True From 662f53ace524b3b20f5f7f888d0f54af60240fd4 Mon Sep 17 00:00:00 2001 From: Brian Skinn Date: Thu, 27 Nov 2025 19:08:17 -0500 Subject: [PATCH 18/36] Apply isort --- src/flake8_absolute_import/core.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/flake8_absolute_import/core.py b/src/flake8_absolute_import/core.py index cd05e56..c7e051b 100644 --- a/src/flake8_absolute_import/core.py +++ b/src/flake8_absolute_import/core.py @@ -26,7 +26,6 @@ from flake8_absolute_import.version import __version__ - ABS101: str = "ABS101 Relative import found" From be3447b28fe122dd95e81055821fa054693f860a Mon Sep 17 00:00:00 2001 From: Brian Skinn Date: Thu, 27 Nov 2025 19:12:06 -0500 Subject: [PATCH 19/36] Remove codecov from CI requirements --- requirements-ci.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/requirements-ci.txt b/requirements-ci.txt index d4e2d78..36b2a91 100644 --- a/requirements-ci.txt +++ b/requirements-ci.txt @@ -1,4 +1,3 @@ -codecov pytest>=4.4.0 pytest-cov tox From 2f6a9281e3436691122fb34e738e20968ffe2354 Mon Sep 17 00:00:00 2001 From: Brian Skinn Date: Thu, 27 Nov 2025 19:12:20 -0500 Subject: [PATCH 20/36] Remove build and flake8 req'ts from dev req'ts --- requirements-dev.txt | 2 -- 1 file changed, 2 deletions(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 0ed034b..d44b096 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,4 +1,3 @@ -build pytest>=4.4.0 pytest-cov restview @@ -6,5 +5,4 @@ tox types-setuptools twine wget --r requirements-flake8.txt -e . From c145f1225455b8a546584e7d16dee81314bea19b Mon Sep 17 00:00:00 2001 From: Brian Skinn Date: Thu, 27 Nov 2025 19:12:34 -0500 Subject: [PATCH 21/36] Add build env to tox --- tox.ini | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tox.ini b/tox.ini index 5bab19a..304fd4f 100644 --- a/tox.ini +++ b/tox.ini @@ -87,6 +87,13 @@ commands= mypy --version mypy {posargs} src tests +[testenv:build] +description=Build project to wheel and sdist +skip_install=True +deps=build +commands= + python -m build + [pytest] addopts = -v -rsX -W error::Warning --strict-markers xfail_strict = True From 90ad183ac22ad42720114c23be8579e2c742f7bd Mon Sep 17 00:00:00 2001 From: Brian Skinn Date: Thu, 27 Nov 2025 19:15:42 -0500 Subject: [PATCH 22/36] Revert the unneeded intermediate typed variable in Plugin.run() --- src/flake8_absolute_import/core.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/flake8_absolute_import/core.py b/src/flake8_absolute_import/core.py index c7e051b..fccefb4 100644 --- a/src/flake8_absolute_import/core.py +++ b/src/flake8_absolute_import/core.py @@ -59,7 +59,5 @@ def run(self) -> Generator[tuple[int, int, str, type], None, None]: visitor = Visitor() visitor.visit(self._tree) - errors: list[tuple[int, int, str]] = visitor.errors - - for line, col, msg in errors: + for line, col, msg in visitor.errors: yield line, col, msg, type(self) From 8fde84c02258656e912cc1b4f958422def242600 Mon Sep 17 00:00:00 2001 From: Brian Skinn Date: Thu, 27 Nov 2025 19:24:34 -0500 Subject: [PATCH 23/36] Set persist-credentials: false for all workflows Closes #23. --- .github/workflows/all_core_tests.yml | 4 ++++ .github/workflows/release_platform_tests.yml | 2 ++ .github/workflows/release_sdist_test.yml | 2 ++ .github/workflows/release_testdir_coverage.yml | 2 ++ 4 files changed, 10 insertions(+) diff --git a/.github/workflows/all_core_tests.yml b/.github/workflows/all_core_tests.yml index 4ae1537..a359c50 100644 --- a/.github/workflows/all_core_tests.yml +++ b/.github/workflows/all_core_tests.yml @@ -11,6 +11,8 @@ jobs: steps: - name: Check out repo uses: actions/checkout@v6 + with: + persist-credentials: false - name: Install Python uses: actions/setup-python@v6 @@ -50,6 +52,8 @@ jobs: steps: - name: Check out repo uses: actions/checkout@v6 + with: + persist-credentials: false - name: Install Python uses: actions/setup-python@v6 diff --git a/.github/workflows/release_platform_tests.yml b/.github/workflows/release_platform_tests.yml index 1ccb6f7..3fbb638 100644 --- a/.github/workflows/release_platform_tests.yml +++ b/.github/workflows/release_platform_tests.yml @@ -26,6 +26,8 @@ jobs: steps: - name: Check out repo uses: actions/checkout@v6 + with: + persist-credentials: false - name: Install Python uses: actions/setup-python@v6 diff --git a/.github/workflows/release_sdist_test.yml b/.github/workflows/release_sdist_test.yml index 52af614..df32bac 100644 --- a/.github/workflows/release_sdist_test.yml +++ b/.github/workflows/release_sdist_test.yml @@ -22,6 +22,8 @@ jobs: steps: - name: Check out repo uses: actions/checkout@v6 + with: + persist-credentials: false - name: Install Python uses: actions/setup-python@v6 diff --git a/.github/workflows/release_testdir_coverage.yml b/.github/workflows/release_testdir_coverage.yml index d66b3b8..03e3cb3 100644 --- a/.github/workflows/release_testdir_coverage.yml +++ b/.github/workflows/release_testdir_coverage.yml @@ -19,6 +19,8 @@ jobs: steps: - name: Check out repo uses: actions/checkout@v6 + with: + persist-credentials: false - name: Install Python uses: actions/setup-python@v6 From 268da15b6d91a522563d8c40a57ceff7383187ff Mon Sep 17 00:00:00 2001 From: Brian Skinn Date: Thu, 27 Nov 2025 19:42:20 -0500 Subject: [PATCH 24/36] Expand SemVer discussion in CHANGELOG.md Scoping the versioning to the plugin error code behavior, and describing the four version segments directly. --- CHANGELOG.md | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ed90d11..4d71c2f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,8 +3,27 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) -and this project strives to adhere (mostly) to -[Semantic Versioning](http://semver.org/spec/v2.0.0.html). +and this project follows an extension of [Semantic +Versioning](http://semver.org/spec/v2.0.0.html), adding a fourth `ADMIN` version +segment. + +The plugin interface changes implied by bumps in these SemVer versions are +specific to the error codes emitted by the plugin as part of flake8 execution: + +- **Major** + - Any addition or removal of an error code emitted by the plugin. + - Any change to the default behavior of the plugin with respect to an existing + error code. +- **Minor** + - Addition of new, configurable behavior of the plugin related to an existing + error code, which is not expected to alter the error code emitting behavior + of any existing user configurations. +- **Patch** + - Bugfixes to align the plugin's actual behavior with its stated behavior with + regard to error codes emitted. +- **Admin** + - Releases with changes that are expected to have no effect on plugin + behavior. ### [1.0.0.2] - 2023-10-08 From 56c04cbaaa3fd8895e779690960c4eefa5803587 Mon Sep 17 00:00:00 2001 From: Brian Skinn Date: Thu, 27 Nov 2025 19:49:38 -0500 Subject: [PATCH 25/36] Add type cast to setup.py --- setup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 0672011..d7ceae8 100644 --- a/setup.py +++ b/setup.py @@ -1,7 +1,7 @@ import re from pathlib import Path from setuptools import find_packages, setup -from typing import Any +from typing import Any, cast exec_ns: dict[str, Any] = {} @@ -9,7 +9,7 @@ Path("src", "flake8_absolute_import", "version.py").read_text(encoding="utf-8"), exec_ns, ) -__version__ = exec_ns["__version__"] +__version__ = cast(str, exec_ns["__version__"]) NAME = "flake8-absolute-import" version_override = None From 38d4a70ed2820dbfb739df9e3b3ad7c31e7a5d3f Mon Sep 17 00:00:00 2001 From: Brian Skinn Date: Thu, 27 Nov 2025 19:49:47 -0500 Subject: [PATCH 26/36] Switch CI badge back to `main` branch in README --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index c47fe37..43923ba 100644 --- a/README.rst +++ b/README.rst @@ -5,7 +5,7 @@ flake8-absolute-import **Current Development Version:** -.. image:: https://img.shields.io/github/actions/workflow/status/bskinn/flake8-absolute-import/all_core_tests.yml?branch=release-1.0.0.3&logo=github +.. image:: https://img.shields.io/github/actions/workflow/status/bskinn/flake8-absolute-import/all_core_tests.yml?branch=main&logo=github :alt: GitHub Workflow Status :target: https://github.com/bskinn/flake8-absolute-import/actions From b890733d7b9288cb0042474f9b3302c055a10502 Mon Sep 17 00:00:00 2001 From: Brian Skinn Date: Thu, 27 Nov 2025 19:49:58 -0500 Subject: [PATCH 27/36] Bump version to 1.0.0.3 --- src/flake8_absolute_import/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/flake8_absolute_import/version.py b/src/flake8_absolute_import/version.py index 5ffe9a8..2b46066 100644 --- a/src/flake8_absolute_import/version.py +++ b/src/flake8_absolute_import/version.py @@ -21,4 +21,4 @@ """ -__version__: str = "1.0.0.3.dev0" +__version__: str = "1.0.0.3" From cfd8203d9c0e50b4bab54364bef5a586b3101227 Mon Sep 17 00:00:00 2001 From: Brian Skinn Date: Thu, 27 Nov 2025 19:52:52 -0500 Subject: [PATCH 28/36] Rename to README.md --- MANIFEST.in | 2 +- README.rst => README.md | 0 setup.py | 4 ++-- 3 files changed, 3 insertions(+), 3 deletions(-) rename README.rst => README.md (100%) diff --git a/MANIFEST.in b/MANIFEST.in index 34dd218..0673235 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,3 +1,3 @@ -include AUTHORS.md LICENSE.txt README.rst CHANGELOG.md pyproject.toml +include AUTHORS.md LICENSE.txt README.md CHANGELOG.md pyproject.toml include requirements-dev.txt requirements-flake8.txt tox.ini include src/flake8_absolute_import/py.typed diff --git a/README.rst b/README.md similarity index 100% rename from README.rst rename to README.md diff --git a/setup.py b/setup.py index d7ceae8..e6f732a 100644 --- a/setup.py +++ b/setup.py @@ -16,7 +16,7 @@ def readme(): - content = Path("README.rst").read_text() + content = Path("README.md").read_text(encoding="utf-8") new_ver = version_override if version_override else __version__ @@ -40,5 +40,5 @@ def content_update(content, pattern, sub): setup( long_description=readme(), - long_description_content_type="text/x-rst", + long_description_content_type="text/markdown", ) From a39a7d4521c8c57303a8446f3c086a6caa45a739 Mon Sep 17 00:00:00 2001 From: Brian Skinn Date: Thu, 27 Nov 2025 20:10:55 -0500 Subject: [PATCH 29/36] Convert README contents to Markdown --- README.md | 98 ++++++++++++++++++++++++++++++------------------------- 1 file changed, 53 insertions(+), 45 deletions(-) diff --git a/README.md b/README.md index 43923ba..b0e8cb3 100644 --- a/README.md +++ b/README.md @@ -1,69 +1,77 @@ -flake8-absolute-import -====================== +## flake8-absolute-import: flake8 plugin to require absolute imports -*flake8 plugin to require absolute imports* +#### Current Development Version -**Current Development Version:** +[![GitHub Workflow Status][workflow badge]][workflow link target] -.. image:: https://img.shields.io/github/actions/workflow/status/bskinn/flake8-absolute-import/all_core_tests.yml?branch=main&logo=github - :alt: GitHub Workflow Status - :target: https://github.com/bskinn/flake8-absolute-import/actions +#### Most Recent Stable Release -**Most Recent Stable Release:** +[![PyPI Version][pypi badge]][pypi link target] +![Python Versions][python versions badge] -.. image:: https://img.shields.io/pypi/v/flake8-absolute-import.svg?logo=pypi - :target: https://pypi.org/project/flake8-absolute-import +#### Info -.. image:: https://img.shields.io/pypi/pyversions/flake8-absolute-import.svg?logo=python +[![MIT License][license badge]][license link target] +[![black formatted][black badge]][black link target] +[![PePY stats][pepy badge]][pepy link target] -**Info:** +---- + +### Don't like relative imports? + +#### Lint 'em out! -.. image:: https://img.shields.io/github/license/mashape/apistatus.svg - :target: https://github.com/bskinn/flake8-absolute-import/blob/stable/LICENSE.txt +`flake8-absolute-import` uses a direct check of the AST for each +`from x import y` statement to flag relative imports. +Specifically, it checks for a nonzero _level_ attribute on each +[`ImportFrom`] node. -.. image:: https://img.shields.io/badge/code%20style-black-000000.svg - :target: https://github.com/psf/black +Relative imports raise the `ABS101` error code: -.. image:: https://pepy.tech/badge/flake8-absolute-import/month - :target: https://pepy.tech/project/flake8-absolute-import +```py + from foo import bar # OK + from .foo import bar # ABS101 +``` ---- -*Don't like relative imports?* +Available on [PyPI][pypi link target] (`pip install flake8-absolute-import`). +`flake8` should automatically detect and load the plugin. `flake8`>=5.0 is +required. + +Source on [GitHub][gh repo]. Bug reports and feature requests are welcomed at +the [Issues][gh issues] page there. -Lint 'em out! +Copyright (c) Brian Skinn 2019-2023 -``flake8-absolute-import`` uses a direct check of the AST for each -``from x import y`` statement to flag relative imports. -Specifically, it checks for a nonzero *level* attribute on each -|ImportFrom|_ node. +The `flake8-absolute-import` documentation (currently docstrings and README) is +licensed under a [Creative Commons Attribution 4.0 International License][cc-by] +(CC-BY). The `flake8-absolute-import` codebase is released under the [MIT +License]. See [`LICENSE.txt`] for full license terms. -Relative imports raise the ``ABS101`` error code: +[`ImportFrom`]: https://docs.python.org/3/library/ast.html#ast.ImportFrom +[`LICENSE.txt`]: https://github.com/bskinn/flake8-absolute-import/blob/main/LICENSE.txt -.. code:: python +[black badge]: https://img.shields.io/badge/code%20style-black-000000.svg +[black link target]: https://github.com/psf/black - from foo import bar # OK - from .foo import bar # ABS101 +[cc-by]: http://creativecommons.org/licenses/by/4.0/ ----- +[gh issues]: https://github.com/bskinn/flake8-absolute-import/issues +[gh repo]: https://github.com/bskinn/flake8-absolute-import -Available on `PyPI `__ -(``pip install flake8-absolute-import``). ``flake8`` should automatically -detect and load the plugin. ``flake8``>=5.0 is required. +[license badge]: https://img.shields.io/github/license/mashape/apistatus.svg +[license link target]: https://github.com/bskinn/flake8-absolute-import/blob/stable/LICENSE.txt -Source on `GitHub `__. Bug reports -and feature requests are welcomed at the -`Issues `__ page there. +[MIT License]: https://opensource.org/licenses/MIT -Copyright (c) Brian Skinn 2019-2023 +[pepy badge]: https://pepy.tech/badge/flake8-absolute-import/month +[pepy link target]: https://pepy.tech/project/flake8-absolute-import + +[pypi badge]: https://img.shields.io/pypi/v/flake8-absolute-import.svg?logo=pypi +[pypi link target]: https://pypi.org/project/flake8-absolute-import -The ``flake8-absolute-import`` documentation (including docstrings and README) -is licensed under a -`Creative Commons Attribution 4.0 International License `__ -(CC-BY). The ``flake8-absolute-import`` codebase is released under the -`MIT License `__. See -`LICENSE.txt `__ for -full license terms. +[python versions badge]: https://img.shields.io/pypi/pyversions/flake8-absolute-import.svg?logo=python -.. _ImportFrom: https://greentreesnakes.readthedocs.io/en/latest/nodes.html#ImportFrom -.. |ImportFrom| replace:: ``ImportFrom`` +[workflow badge]: https://img.shields.io/github/actions/workflow/status/bskinn/flake8-absolute-import/all_core_tests.yml?branch=main&logo=github +[workflow link target]: https://github.com/bskinn/flake8-absolute-import/actions From c047726f999a5fd059703df2bc016369f1ef672d Mon Sep 17 00:00:00 2001 From: Brian Skinn Date: Thu, 27 Nov 2025 20:12:58 -0500 Subject: [PATCH 30/36] Update copyright years to 2025 --- LICENSE.txt | 2 +- README.md | 2 +- src/flake8_absolute_import/__init__.py | 2 +- src/flake8_absolute_import/core.py | 2 +- src/flake8_absolute_import/version.py | 2 +- tests/test_plugin.py | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/LICENSE.txt b/LICENSE.txt index 3742dc3..12728c3 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2019-2023 Brian Skinn +Copyright (c) 2019-2025 Brian Skinn Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index b0e8cb3..c33c9ef 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ required. Source on [GitHub][gh repo]. Bug reports and feature requests are welcomed at the [Issues][gh issues] page there. -Copyright (c) Brian Skinn 2019-2023 +Copyright (c) Brian Skinn 2019-2025 The `flake8-absolute-import` documentation (currently docstrings and README) is licensed under a [Creative Commons Attribution 4.0 International License][cc-by] diff --git a/src/flake8_absolute_import/__init__.py b/src/flake8_absolute_import/__init__.py index 5fe1ff3..7705159 100644 --- a/src/flake8_absolute_import/__init__.py +++ b/src/flake8_absolute_import/__init__.py @@ -9,7 +9,7 @@ 6 Sep 2019 **Copyright** - \(c) Brian Skinn 2019-2023 + \(c) Brian Skinn 2019-2025 **Source Repository** http://github.com/bskinn/flake8-absolute-import diff --git a/src/flake8_absolute_import/core.py b/src/flake8_absolute_import/core.py index fccefb4..3fb5567 100644 --- a/src/flake8_absolute_import/core.py +++ b/src/flake8_absolute_import/core.py @@ -9,7 +9,7 @@ 6 Sep 2019 **Copyright** - \(c) Brian Skinn 2019-2023 + \(c) Brian Skinn 2019-2025 **Source Repository** http://github.com/bskinn/flake8-absolute-import diff --git a/src/flake8_absolute_import/version.py b/src/flake8_absolute_import/version.py index 2b46066..f73a6e2 100644 --- a/src/flake8_absolute_import/version.py +++ b/src/flake8_absolute_import/version.py @@ -9,7 +9,7 @@ 6 Sep 2019 **Copyright** - \(c) Brian Skinn 2019-2023 + \(c) Brian Skinn 2019-2025 **Source Repository** http://github.com/bskinn/flake8-absolute-import diff --git a/tests/test_plugin.py b/tests/test_plugin.py index ed24f3c..8da4732 100644 --- a/tests/test_plugin.py +++ b/tests/test_plugin.py @@ -9,7 +9,7 @@ 6 Sep 2019 **Copyright** - \(c) Brian Skinn 2019-2023 + \(c) Brian Skinn 2019-2025 **Source Repository** http://github.com/bskinn/flake8-absolute-import From ca343e6accf0a570dc78002b22efe69772e42980 Mon Sep 17 00:00:00 2001 From: Brian Skinn Date: Thu, 27 Nov 2025 20:18:59 -0500 Subject: [PATCH 31/36] Update keywords & add 'typed' classifier in pyproject.toml --- pyproject.toml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 33832b4..1116e49 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -29,9 +29,11 @@ classifiers = [ "Programming Language :: Python :: 3.13", "Programming Language :: Python :: 3.14", "Topic :: Software Development :: Quality Assurance", + "Typing :: Typed", "Development Status :: 5 - Production/Stable", ] keywords = [ + "flake8", "flake8-plugin", "linting", "absolute-imports", From 8d88aafa9c7627211afcd9a7f028475c8f3970b3 Mon Sep 17 00:00:00 2001 From: Brian Skinn Date: Thu, 27 Nov 2025 20:29:46 -0500 Subject: [PATCH 32/36] Update PePy badge link --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c33c9ef..348e706 100644 --- a/README.md +++ b/README.md @@ -66,7 +66,7 @@ License]. See [`LICENSE.txt`] for full license terms. [MIT License]: https://opensource.org/licenses/MIT [pepy badge]: https://pepy.tech/badge/flake8-absolute-import/month -[pepy link target]: https://pepy.tech/project/flake8-absolute-import +[pepy link target]: https://pepy.tech/projects/flake8-absolute-import?timeRange=threeMonths&category=version&includeCIDownloads=true&granularity=daily&viewType=line&versions=1.0.0.3%2C1.0.0.2%2C1.0.0.1%2C1.0 [pypi badge]: https://img.shields.io/pypi/v/flake8-absolute-import.svg?logo=pypi [pypi link target]: https://pypi.org/project/flake8-absolute-import From 6883e7a68920b83b990fb7cb833f24dd77f39b2a Mon Sep 17 00:00:00 2001 From: Brian Skinn Date: Thu, 27 Nov 2025 20:43:43 -0500 Subject: [PATCH 33/36] Update CHANGELOG [skip ci] --- CHANGELOG.md | 53 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4d71c2f..5788c05 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,59 @@ specific to the error codes emitted by the plugin as part of flake8 execution: behavior. +### [1.0.0.3] - 2025-11-27 + +This release contains significant changes, but none that should alter the +behavior of the plugin. Thus, it is being considered an administrative release +despite its scale. + +#### Dependencies + +- Add formal support for Python 3.13 and 3.14. + +- Drop formal support for Python 3.8 and 3.9. + +- Increase the minimum permitted Python version to install the package to Python + 3.10. + +#### Internal + +- Add types to the project code. + +#### Administrative + +- Upgrade `checkout` and `setup-python` actions. + +- Convert Azure Pipelines jobs to GitHub Actions and remove Azure config. + - The cross-platform auth/auth required to keep Pipelines working just wasn't + worth the effort to put in place. + - The cross-platform tests, sdist-install check, and test-dir coverage check + now all run only on PRs to `stable`. + - Credentials persistence was disabled for all. + - All were implemented with pip caching. + +- Convert core tests workflow to run on PR, not push, and modernize. + - Cache pip. + - Disable credentials persistence. + - Advance Python versions. + +- Remove CodeCov from workflows and requirements. + - The project/team is far too small for it to be valuable. + +- Update copyright end years. + +- Convert `README` to Markdown. + +- Modernize `pyproject.toml` and `setuptools` config. + +- Add multiple `tox` envs: + - `black` + - `mypy` + - `isort` + - `check` (rollup of `isort`, `black`, `flake8`, `mypy`) + - `build` + + ### [1.0.0.2] - 2023-10-08 This is an administrative release, primarily to update officially supported From dd1a0e48f928df62ac8da1e79a46b907ab3a6427 Mon Sep 17 00:00:00 2001 From: Brian Skinn Date: Thu, 27 Nov 2025 21:04:14 -0500 Subject: [PATCH 34/36] Tweak README title --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 348e706..51c5a69 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -## flake8-absolute-import: flake8 plugin to require absolute imports +## flake8-absolute-import: A flake8 plugin to require absolute imports #### Current Development Version From f2c94ceaaa708aabcb220b608d393b61a7fca2f0 Mon Sep 17 00:00:00 2001 From: Brian Skinn Date: Thu, 27 Nov 2025 21:04:21 -0500 Subject: [PATCH 35/36] Remove THANK link from pyproject.toml metadata --- pyproject.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 1116e49..3fe321e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -51,7 +51,6 @@ dynamic = [ [project.urls] Homepage = "https://github.com/bskinn/flake8-absolute-import" Changelog = "https://github.com/bskinn/flake8-absolute-import/blob/main/CHANGELOG.md" -Thank = "https://twitter.com/btskinn" Donate = "https://github.com/sponsors/bskinn" [project.entry-points."flake8.extension"] From 6eb984e0b6ae8ec21023b74d94caa9a8472ceb44 Mon Sep 17 00:00:00 2001 From: Brian Skinn Date: Thu, 27 Nov 2025 21:14:27 -0500 Subject: [PATCH 36/36] Bump to next dev version --- src/flake8_absolute_import/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/flake8_absolute_import/version.py b/src/flake8_absolute_import/version.py index f73a6e2..653d993 100644 --- a/src/flake8_absolute_import/version.py +++ b/src/flake8_absolute_import/version.py @@ -21,4 +21,4 @@ """ -__version__: str = "1.0.0.3" +__version__: str = "1.0.0.4.dev0"