Skip to content

Commit a34c72d

Browse files
authored
chore: fix broken pre-commit hooks (#60)
* chore: bump pre-commit hook versions for Python 3.12 / click 8.1 black 20.8b1 was broken against click>=8.1 (ImportError: _unicodefun), and flake8 3.9.2 was broken on Python 3.12 (EntryPoints.get removed). Bumps black, flake8, their transitive plugins, and blacken-docs to currently-maintained versions. * chore: remove invalid 'safe = true' from [tool.black] in pyproject.toml Modern black does not recognize 'safe' as a pyproject config key and emits "Invalid config keys detected: 'safe'" on every run. --safe is still the default CLI behavior, so removing the key is a no-op for actual formatting. * chore: apply black 24 reformat and fix flake8 lint errors Applies black 24.10.0 formatting to the repo (mostly trailing-comma and blank-line-after-module-docstring changes from 4 years of black style evolution) and fixes the 29 E501 line-length errors plus 1 D419 empty-docstring that the upgraded flake8 surfaced. Bundled together because the formatting hook and the lint hook block each other in intermediate states — keeping them in one commit avoids a red midpoint in the series. * chore: bump black and flake8 dev-deps to align with pre-commit black ^22.0.0 -> ^24.0.0 and flake8 ^6.0.0 -> ^7.0.0 so that 'poetry run black' / 'poetry run flake8' (and editor integrations using the poetry venv) produce the same output as the pre-commit hooks. Regenerates poetry.lock; transitive bumps are scoped to black/flake8 deps only (packaging, pycodestyle, pyflakes, typing-extensions). * chore: pin pre-commit flake8 to 7.3.0 to match poetry-resolved version Keeps the pre-commit hook and the poetry dev-dep on the exact same flake8 version so local and CI runs can't diverge.
1 parent f6f7eae commit a34c72d

28 files changed

Lines changed: 188 additions & 131 deletions

.pre-commit-config.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
repos:
22
- repo: https://github.com/psf/black
3-
rev: 20.8b1
3+
rev: 24.10.0
44
hooks:
55
- id: black
66
args: [ "--safe", "--diff", "--color"]
77
verbose: true
88
- repo: https://github.com/psf/black
9-
rev: 20.8b1
9+
rev: 24.10.0
1010
hooks:
1111
- id: black
1212
args: [ "--safe", "--quiet"]
@@ -17,10 +17,10 @@ repos:
1717
- id: isort
1818
args: ["--profile", "black", "--filter-files"]
1919
- repo: https://github.com/asottile/blacken-docs
20-
rev: v1.10.0
20+
rev: 1.19.1
2121
hooks:
2222
- id: blacken-docs
23-
additional_dependencies: [ black==20.8b1 ]
23+
additional_dependencies: [ black==24.10.0 ]
2424
- repo: https://github.com/pre-commit/pre-commit-hooks
2525
rev: v4.0.1
2626
hooks:
@@ -41,10 +41,10 @@ repos:
4141
- id: python-use-type-annotations
4242
- id: rst-backticks
4343
- repo: https://github.com/pycqa/flake8
44-
rev: 3.9.2
44+
rev: 7.3.0
4545
hooks:
4646
- id: flake8
4747
language_version: python3
4848
additional_dependencies:
49-
- flake8-typing-imports==1.9.0
50-
- flake8-docstrings==1.5.0
49+
- flake8-typing-imports==1.15.0
50+
- flake8-docstrings==1.7.0

docs/list_labels_by_tracking_number.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@ def list_labels_by_tracking_number_demo():
3131
{"api_key": api_key, "page_size": 75, "retries": 3, "timeout": 10}
3232
)
3333
try:
34-
result = shipengine.list_labels_by_tracking_number(tracking_number="1ZXXXXXXXXXXXXXXXX")
34+
result = shipengine.list_labels_by_tracking_number(
35+
tracking_number="1ZXXXXXXXXXXXXXXXX"
36+
)
3537
print("::SUCCESS::")
3638
print(result)
3739
except ShipEngineError as err:

poetry.lock

Lines changed: 55 additions & 58 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ fuuid = "^0.1.0"
4444
pytest = "^7.0.0"
4545
pytest-cov = "^2.11.1"
4646
pytest-mock = "^3.6.1"
47-
black = "^22.0.0"
48-
flake8 = "^6.0.0"
47+
black = "^24.0.0"
48+
flake8 = "^7.0.0"
4949
Sphinx = "^3.5.2"
5050
tox = "^3.23.0"
5151
coverage = "^5.5"
@@ -58,7 +58,6 @@ responses = "^0.13.3"
5858
[tool.black]
5959
line-length = 100
6060
target-version = ["py310"]
61-
safe = true
6261

6362
[tool.isort]
6463
profile = "black"

shipengine/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""ShipEngine SDK."""
2+
23
__version__ = "2.0.5"
34

45
import logging

shipengine/enums/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""ShipEngine SDK Enumerations"""
2+
23
from enum import Enum
34

45
from .country import Country

shipengine/enums/country.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""An enumeration of valid/supported countries."""
2+
23
from enum import Enum
34

45

shipengine/enums/error_code.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Enumeration of error sources returned by ShipEngine API."""
2+
23
from enum import Enum
34

45

shipengine/enums/error_source.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Enumeration of error sources returned by ShipEngine API."""
2+
23
from enum import Enum
34

45

shipengine/enums/error_type.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
"""Enumeration of error types returned by ShipEngine API."""
2+
23
from enum import Enum
34

45

56
class ErrorType(Enum):
6-
"""Indicates the type of an error. Think of this as a broad category rather than a specific error."""
7+
"""Indicates the type of an error.
8+
9+
Think of this as a broad category rather than a specific error.
10+
"""
711

812
ACCOUNT_STATUS = "account_status"
913
"""

0 commit comments

Comments
 (0)