Skip to content

Commit 54b647f

Browse files
authored
Limit support to latest major Python version (#50)
Signed-off-by: GitHub <noreply@github.com>
1 parent e022329 commit 54b647f

File tree

9 files changed

+35
-36
lines changed

9 files changed

+35
-36
lines changed

.github/workflows/python-ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
strategy:
2020
matrix:
2121
os: [ ubuntu-latest ]
22-
python-version: [ "3.11" ]
22+
python-version: [ "3.12" ]
2323

2424
uses: darbiadev/.github/.github/workflows/python-test.yaml@38577afaee35510b6792495a87b07d49b5cdf387 # v11.0.0
2525
with:

docs/source/changelog.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
Changelog
22
=========
33

4+
- :release:`0.4.0 <27th Decenber 2023>`
5+
- :feature:`49` Limit support to latest major Python version
6+
47
- :release:`0.3.0 <27th Decenber 2023>`
58
- :feature:`47` Setup publishing to PyPI
69

make.ps1

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,28 +41,28 @@ function Invoke-Install-Dev
4141
function Invoke-Update-Deps
4242
{
4343
python -m pip install --upgrade pip-tools
44-
pip-compile --output-file requirements/requirements.txt requirements/requirements.in
45-
pip-compile --output-file requirements/requirements-dev.txt requirements/requirements-dev.in
46-
pip-compile --output-file requirements/requirements-tests.txt requirements/requirements-tests.in
47-
pip-compile --output-file requirements/requirements-docs.txt requirements/requirements-docs.in
44+
pip-compile requirements/requirements.in
45+
pip-compile requirements/requirements-dev.in
46+
pip-compile requirements/requirements-tests.in
47+
pip-compile requirements/requirements-docs.in
4848
}
4949

5050
function Invoke-Upgrade-Deps
5151
{
5252
python -m pip install --upgrade pip-tools pre-commit
5353
pre-commit autoupdate
54-
pip-compile --upgrade --output-file requirements/requirements.txt requirements/requirements.in
55-
pip-compile --upgrade --output-file requirements/requirements-dev.txt requirements/requirements-dev.in
56-
pip-compile --upgrade --output-file requirements/requirements-tests.txt requirements/requirements-tests.in
57-
pip-compile --upgrade --output-file requirements/requirements-docs.txt requirements/requirements-docs.in
54+
pip-compile --upgrade requirements/requirements.in
55+
pip-compile --upgrade requirements/requirements-dev.in
56+
pip-compile --upgrade requirements/requirements-tests.in
57+
pip-compile --upgrade requirements/requirements-docs.in
5858
}
5959

6060
function Invoke-Lint
6161
{
6262
pre-commit run --all-files
6363
python -m ruff --fix .
6464
python -m ruff format .
65-
python -m mypy src/
65+
python -m mypy --strict src/
6666
}
6767

6868
function Invoke-Test

pyproject.toml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
[project]
22
name = "darbiadev-hermes"
3-
version = "0.3.0"
3+
version = "0.4.0"
44
description = "Shipping tooling"
55
readme = "README.md"
66
authors = [
77
{ name = "Bradley Reynolds", email = "bradley.reynolds@darbia.dev" },
88
]
99
license = { text = "MIT" }
10-
requires-python = ">=3.11"
10+
requires-python = ">=3.12,<3.13"
1111
dynamic = ["dependencies", "optional-dependencies"]
1212

1313
[project.urls]
@@ -29,14 +29,10 @@ dev = { file = ["requirements/requirements-dev.txt"] }
2929
tests = { file = ["requirements/requirements-tests.txt"] }
3030
docs = { file = ["requirements/requirements-docs.txt"] }
3131

32-
[tool.black]
33-
target-version = ["py311"]
34-
line-length = 120
35-
3632
[tool.ruff]
3733
preview = true
3834
unsafe-fixes = true
39-
target-version = "py311"
35+
target-version = "py312"
4036
select = ["ALL"]
4137
line-length = 120
4238
ignore = [

requirements/requirements-dev.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#
2-
# This file is autogenerated by pip-compile with Python 3.11
2+
# This file is autogenerated by pip-compile with Python 3.12
33
# by the following command:
44
#
5-
# pip-compile --output-file=requirements/requirements-dev.txt requirements/requirements-dev.in
5+
# pip-compile requirements/requirements-dev.in
66
#
77
build==1.0.3
88
# via pip-tools
@@ -18,7 +18,7 @@ filelock==3.13.1
1818
# via virtualenv
1919
identify==2.5.33
2020
# via pre-commit
21-
mypy==1.7.1
21+
mypy==1.8.0
2222
# via -r requirements/requirements-dev.in
2323
mypy-extensions==1.0.0
2424
# via mypy
@@ -30,7 +30,7 @@ numpy==1.26.2
3030
# pandas-stubs
3131
packaging==23.2
3232
# via build
33-
pandas-stubs==2.1.1.230928
33+
pandas-stubs==2.1.4.231227
3434
# via -r requirements/requirements-dev.in
3535
pip-tools==7.3.0
3636
# via -r requirements/requirements-dev.in
@@ -42,7 +42,7 @@ pyproject-hooks==1.0.0
4242
# via build
4343
pyyaml==6.0.1
4444
# via pre-commit
45-
ruff==0.1.7
45+
ruff==0.1.9
4646
# via -r requirements/requirements-dev.in
4747
types-pytz==2023.3.1.1
4848
# via pandas-stubs

requirements/requirements-docs.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#
2-
# This file is autogenerated by pip-compile with Python 3.11
2+
# This file is autogenerated by pip-compile with Python 3.12
33
# by the following command:
44
#
5-
# pip-compile --output-file=requirements/requirements-docs.txt requirements/requirements-docs.in
5+
# pip-compile requirements/requirements-docs.in
66
#
77
alabaster==0.7.13
88
# via sphinx

requirements/requirements-tests.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#
2-
# This file is autogenerated by pip-compile with Python 3.11
2+
# This file is autogenerated by pip-compile with Python 3.12
33
# by the following command:
44
#
5-
# pip-compile --output-file=requirements/requirements-tests.txt requirements/requirements-tests.in
5+
# pip-compile requirements/requirements-tests.in
66
#
77
iniconfig==2.0.0
88
# via pytest

requirements/requirements.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#
2-
# This file is autogenerated by pip-compile with Python 3.11
2+
# This file is autogenerated by pip-compile with Python 3.12
33
# by the following command:
44
#
5-
# pip-compile --output-file=requirements/requirements.txt requirements/requirements.in
5+
# pip-compile requirements/requirements.in
66
#
77
annotated-types==0.6.0
88
# via pydantic
@@ -19,7 +19,7 @@ click==8.1.7
1919
# via typer
2020
darbiadev-shipping[ups]==0.5.1
2121
# via -r requirements/requirements.in
22-
darbiadev-shipping-types==0.2.0
22+
darbiadev-shipping-types==0.3.0
2323
# via -r requirements/requirements.in
2424
darbiadev-ups==0.7.0
2525
# via darbiadev-shipping
@@ -46,9 +46,9 @@ openpyxl==3.1.2
4646
# via -r requirements/requirements.in
4747
pandas==2.1.4
4848
# via -r requirements/requirements.in
49-
pydantic==2.5.2
49+
pydantic==2.5.3
5050
# via pydantic-settings
51-
pydantic-core==2.14.5
51+
pydantic-core==2.14.6
5252
# via pydantic
5353
pydantic-settings==2.1.0
5454
# via -r requirements/requirements.in

src/hermes/file_parser.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def _guess_column(column_name: str) -> Columns | None:
8383
return None
8484

8585

86-
def get_file_contents(path: Path, sheet_name: str | None = None) -> list[dict]:
86+
def get_file_contents(path: Path, sheet_name: str | None = None) -> list[dict[str, str | float]]:
8787
"""Get file contents."""
8888
if not path.exists():
8989
msg = f"File {path} does not exist"
@@ -103,7 +103,7 @@ def get_file_contents(path: Path, sheet_name: str | None = None) -> list[dict]:
103103
msg = f"File type {path.suffix} is not supported"
104104
raise ValueError(msg)
105105

106-
return data.fillna("").to_dict(orient="records")
106+
return data.fillna("").to_dict(orient="records") # type: ignore[return-value]
107107

108108

109109
def parse_file(path: Path, sheet_name: str | None = None) -> list[ImportedShipment]:
@@ -117,11 +117,11 @@ def parse_file(path: Path, sheet_name: str | None = None) -> list[ImportedShipme
117117
for row in rows:
118118
address = Address(
119119
**{
120-
const.value: row.get(mapping.get(const))
120+
const.value: row.get(mapping.get(const)) # type: ignore[arg-type]
121121
for const in ADDRESS_COLUMNS
122-
if row.get(mapping.get(const)) is not None
122+
if row.get(mapping.get(const)) is not None # type: ignore[arg-type]
123123
},
124124
)
125-
shipment_id = row.get(mapping.get(Columns.REFERENCE))
125+
shipment_id = row.get(mapping.get(Columns.REFERENCE)) # type: ignore[arg-type]
126126
records.append(ImportedShipment(shipment_id=shipment_id, ship_to=address)) # type: ignore[arg-type]
127127
return records

0 commit comments

Comments
 (0)