Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 1.0.0.2 #21

Merged
merged 32 commits into from
Oct 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
4b4e356
Bump to dev version for merge to main
bskinn Dec 5, 2021
6129b4e
Merge pull request #17 from bskinn/release-1.0.0.1
bskinn Dec 5, 2021
18c97a5
Add release date for v1.0.0.1
bskinn Dec 5, 2021
f58f235
Update setup.cfg
bskinn Oct 1, 2023
1f2354a
Update tox testing matrix & doc of supported versions
bskinn Oct 1, 2023
f767046
Update CI config for new Python versions
bskinn Oct 1, 2023
a946dd3
Revert VS Code recommended string quoting reformat
bskinn Oct 1, 2023
f599a9a
Switch to 3.12 rc Python
bskinn Oct 1, 2023
04c84eb
Add curious period to version
bskinn Oct 1, 2023
618fb9e
Remove 3.12 from Azure Pipelines
bskinn Oct 1, 2023
68c70ca
Fix pyproject.toml and remove setup.cfg
bskinn Oct 1, 2023
9a89d6a
Modernize setup.py
bskinn Oct 1, 2023
1867088
Restore accidentally obliterated pyproject bits
bskinn Oct 1, 2023
b781b27
Refactor test code to improve some names
bskinn Oct 1, 2023
0e423a5
Refactor .format()s to f-strings in test module
bskinn Oct 1, 2023
7d2bfa5
Add CI for testable sdist & augment MANIFEST.in
bskinn Oct 1, 2023
62ee1b3
Skip docs build in sdist test since there are none
bskinn Oct 2, 2023
bedfc8c
Fix Azure syntax
bskinn Oct 2, 2023
8b36d88
Remove leftover sphobjinv test flag
bskinn Oct 2, 2023
6dcd348
Add trial bumps to unqualified Python 3.12
bskinn Oct 8, 2023
84a915c
Merge pull request #19 from bskinn/py312-freshen
bskinn Oct 9, 2023
8449975
Fix flake8 in tox
bskinn Oct 9, 2023
e54b315
Merge pull request #20 from bskinn/fix-tox
bskinn Oct 9, 2023
9bc8cb7
Update copyright dates and contact email
bskinn Oct 9, 2023
81d7fa6
Add CC-BY to license blurb
bskinn Oct 9, 2023
75ae3a4
Switch version def from setup.py to pyproject.toml
bskinn Oct 9, 2023
67d25cc
Bump version to 1.0.0.2
bskinn Oct 9, 2023
f4c38aa
Adjust README wording
bskinn Oct 9, 2023
0a8592c
Fix for shields.io breaking change
bskinn Oct 9, 2023
2cabad0
Add pepy.tech downloads badge
bskinn Oct 9, 2023
aeff008
Update CHANGELOG
bskinn Oct 9, 2023
0e7abd1
Reflow AUTHORS.md
bskinn Oct 9, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions .github/workflows/ci_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on: push

jobs:
all_checks:
name: Run all tests, lints, etc. (Python 3.10)
name: Run all tests, lints, etc. (Python 3.11)
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[skip ci]')"

Expand All @@ -15,7 +15,7 @@ jobs:
- name: Install Python
uses: actions/setup-python@v2
with:
python-version: '3.10'
python-version: '3.11'

- name: Update pip & setuptools
run: python -m pip install -U pip setuptools
Expand Down Expand Up @@ -43,7 +43,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python: ['3.6', '3.7', '3.8', '3.9']
python: ['3.8', '3.9', '3.10', '3.11', '3.12']
if: "!contains(github.event.head_commit.message, '[skip ci]')"

steps:
Expand All @@ -68,4 +68,3 @@ jobs:
run: |
pytest --cov
tox -e sdist_install

14 changes: 11 additions & 3 deletions AUTHORS.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
Credits
=======

`flake8-absolute-import` is authored and maintained by Brian Skinn ([Blog](https://bskinn.github.io)) ([Twitter](https://twitter.com/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).
`flake8-absolute-import` is authored and maintained by Brian Skinn
([Blog](https://bskinn.github.io)) ([Twitter](https://twitter.com/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).

While there is disagreement about the upsides and downsides of relative imports in Python, as best this author can tell there are numerous projects and developers out there who desire to hold strictly to absolute imports in their code. The goal of this flake8 plugin is to simplify enforcement of this policy.
While there is disagreement about the upsides and downsides of relative imports
in Python, as best this author can tell there are numerous projects and
developers out there who desire to hold strictly to absolute imports in their
code. The goal of this flake8 plugin is to simplify enforcement of this policy.

v1.0 provides a single catch-all error, `ABS101`, raised on any relative imports found.
v1.0 provides a single catch-all error, `ABS101`, raised on any relative imports
found.
66 changes: 52 additions & 14 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,44 +7,82 @@ and this project strives to adhere (mostly) to
[Semantic Versioning](http://semver.org/spec/v2.0.0.html).


### [1.0.0.1] - ####-##-##
### [1.0.0.2] - 2023-10-08

This is an administrative release, primarily to update officially supported
Python and flake8 versions. There should be no plugin behavior changes between
this version and v1.0.0.1.

#### Dependencies

- Support for Python 3.12 was officially added

- Support for Python 3.6 and 3.7 was officially removed, though the plugin
should continue to work for Python 3.6+

- The minimum supported flake8 version is now 5.0

#### Administrative

- `MANIFEST.in` was augmented with the files needed to allow the test suite to
run from an unpacked sdist.

- The build metadata was completely migrated from `setup.cfg` to
`pyproject.toml`, and the maximum possible metadata is now drawn from
`pyproject.toml` (all but `long_description`).

- The read of the project version and the load of the README contents in
`setup.py` was modernized/improved.

#### Testing

- Python versions in the GitHub Actions and Azure Pipelines matrices were updated.

- An Azure Pipelines job was added to confirm that a built sdist carries all the
files needed to allow the test suite to run.

- Obscure parameters/variables in some tests were given better names, and string
formatting was upgraded to use f-strings.


### [1.0.0.1] - 2021-12-04

This is an administrative/metadata release, primarily to update officially
supported Python versions. There should be no behavior changes between
this version and v1.0.0.

#### Dependencies

- Support for Python 3.10 and 3.11-dev was officially added
- Support for Python 3.10 and 3.11-dev was officially added.

- Support for Python 3.5 was officially removed, though the plugin should
remain compatible
- Support for Python 3.5 was officially removed, though the plugin should remain
compatible.

#### Testing

- Support for running the `tox` matrix on Windows was removed (it doesn't
seem to work right with the batch-files-in-bin-folder approach I use for
multiple Pythons in development)
- Support for running the `tox` matrix on Windows was removed (it doesn't seem
to work right with the batch-files-in-bin-folder approach I use for multiple
Pythons in development).

- Routine CI switched from Travis CI to GitHub Actions
- Routine CI was switched from Travis CI to GitHub Actions.

- CI and `tox` versions updated to focus on Python 3.10
- CI and `tox` versions were updated to focus on Python 3.10.

- `pytest` and `coverage` configs revised to avoid `source`/`include` collision
in `coverage`
- `pytest` and `coverage` configs were revised to avoid `source`/`include`
collision in `coverage`.

#### Administrative

- `setuptools` configuration has been mostly ported to `setup.cfg`, except for the
pieces that still need to be defined dynamically
pieces that still need to be defined dynamically.

- Built artifacts for distribution should now be created using `build`, which
has been added to `requirements-dev.txt`
has been added to `requirements-dev.txt`.


### [1.0.0] - 2019-09-09

#### Features

- Detect any relative imports and report with error code ABS101
- Detect any relative imports and report with error code ABS101.

2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2019-2021 Brian Skinn
Copyright (c) 2019-2023 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
Expand Down
3 changes: 2 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
include LICENSE.txt README.rst CHANGELOG.md pyproject.toml
include AUTHORS.md LICENSE.txt README.rst CHANGELOG.md pyproject.toml
include requirements-dev.txt requirements-flake8.txt tox.ini
20 changes: 14 additions & 6 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ flake8-absolute-import

**Current Development Version:**

.. image:: https://img.shields.io/github/workflow/status/bskinn/flake8-absolute-import/ci-tests?logo=github
.. image:: https://img.shields.io/github/actions/workflow/status/bskinn/flake8-absolute-import/ci_tests.yml?branch=main&logo=github
:alt: GitHub Workflow Status
:target: https://github.com/bskinn/flake8-absolute-import/actions

Expand All @@ -27,13 +27,16 @@ flake8-absolute-import
.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
:target: https://github.com/psf/black

.. image:: https://pepy.tech/badge/flake8-absolute-import/month
:target: https://pepy.tech/project/flake8-absolute-import

----

*Don't like relative imports?*

Lint 'em out!

``flake8-absolute-import`` uses a simple check of the AST for each
``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.
Expand All @@ -49,16 +52,21 @@ Relative imports raise the ``ABS101`` error code:

Available on `PyPI <https://pypi.python.org/pypi/flake8-absolute-import>`__
(``pip install flake8-absolute-import``). ``flake8`` should automatically
detect and load the plugin. ``flake8``>=3.7 is required.
detect and load the plugin. ``flake8``>=5.0 is required.

Source on `GitHub <https://github.com/bskinn/flake8-absolute-import>`__. Bug reports
and feature requests are welcomed at the
`Issues <https://github.com/bskinn/flake8-absolute-import/issues>`__ page there.

Copyright (c) Brian Skinn 2019-2021
Copyright (c) Brian Skinn 2019-2023

License: The MIT License. See `LICENSE.txt <https://github.com/bskinn/flake8-absolute-import/blob/main/LICENSE.txt>`__
for full license terms.
The ``flake8-absolute-import`` documentation (including docstrings and README)
is licensed under a
`Creative Commons Attribution 4.0 International License <http://creativecommons.org/licenses/by/4.0/>`__
(CC-BY). The ``flake8-absolute-import`` codebase is released under the
`MIT License <https://opensource.org/licenses/MIT>`__. See
`LICENSE.txt <https://github.com/bskinn/flake8-absolute-import/blob/main/LICENSE.txt>`__ for
full license terms.

.. _ImportFrom: https://greentreesnakes.readthedocs.io/en/latest/nodes.html#ImportFrom
.. |ImportFrom| replace:: ``ImportFrom``
15 changes: 8 additions & 7 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,30 +12,31 @@ jobs:
- template: azure-coretest.yml
parameters:
pythons:
py37:
spec: '3.7'
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.10'
versionSpec: '3.11'

- script: pip install -U tox
displayName: Install tox

- script: pip install -r requirements-flake8.txt
displayName: Install flake8 & plugins

- script: tox -e flake8
displayName: Lint the codebase

Expand All @@ -45,7 +46,7 @@ jobs:
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '3.10'
versionSpec: '3.11'

- script: pip install -r requirements-ci.txt
displayName: Install CI requirements
Expand Down
74 changes: 74 additions & 0 deletions azure-sdisttest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
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
Loading
Loading