Skip to content

Commit 0e16bdf

Browse files
authored
Merge pull request #5 from seapagan/update-deps
add a `__hash__` method to base class and update assorted deps
2 parents 42b454c + a1cab2f commit 0e16bdf

5 files changed

Lines changed: 1288 additions & 483 deletions

File tree

.github/workflows/tests.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,12 @@ jobs:
2626
enable-cache: true
2727
cache-dependency-glob: "uv.lock"
2828

29+
- name: Set up Python 3.7 (legacy)
30+
if: matrix.python-version == '3.7'
31+
run: uvx uv@0.6.17 python install 3.7
32+
2933
- name: Set up Python ${{ matrix.python-version }}
34+
if: matrix.python-version != '3.7'
3035
run: uv python install ${{ matrix.python-version }}
3136

3237
- name: Run tests

.pre-commit-config.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ ci:
22
autofix_commit_msg: "[pre-commit.ci] auto fixes from pre-commit.com hooks"
33
repos:
44
- repo: https://github.com/pre-commit/pre-commit-hooks
5-
rev: v5.0.0
5+
rev: v6.0.0
66
hooks:
77
- id: check-yaml
88
args: [--unsafe]
@@ -12,21 +12,21 @@ repos:
1212
- id: end-of-file-fixer
1313

1414
- repo: https://github.com/renovatebot/pre-commit-hooks
15-
rev: 39.113.0
15+
rev: 41.82.6
1616
hooks:
1717
- id: renovate-config-validator
1818
files: ^renovate\.json$
1919

2020
- repo: https://github.com/astral-sh/ruff-pre-commit
21-
rev: v0.9.2
21+
rev: v0.12.10
2222
hooks:
2323
- id: ruff
2424
name: "lint with ruff"
2525
- id: ruff-format
2626
name: "format with ruff"
2727

2828
- repo: https://github.com/pre-commit/mirrors-mypy
29-
rev: "v1.14.1" # Use the sha / tag you want to point at
29+
rev: "v1.17.1" # Use the sha / tag you want to point at
3030
hooks:
3131
- id: mypy
3232
name: "run mypy"
@@ -35,7 +35,7 @@ repos:
3535

3636
- repo: https://github.com/astral-sh/uv-pre-commit
3737
# uv version.
38-
rev: 0.5.21
38+
rev: 0.8.13
3939
hooks:
4040
# Update the uv lockfile
4141
- id: uv-lock

requirements-dev.txt

Lines changed: 136 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,159 @@
11
# This file was autogenerated by uv via the following command:
22
# uv export --no-hashes --no-emit-project --output-file=requirements-dev.txt
33
cfgv==3.3.1 ; python_full_version < '3.8'
4+
# via pre-commit
45
cfgv==3.4.0 ; python_full_version >= '3.8'
6+
# via pre-commit
57
colorama==0.4.6 ; sys_platform == 'win32'
6-
coverage==7.2.7
7-
distlib==0.3.9
8-
exceptiongroup==1.2.2 ; python_full_version < '3.11'
8+
# via pytest
9+
coverage==7.2.7 ; python_full_version < '3.8'
10+
# via pytest-cov
11+
coverage==7.6.1 ; python_full_version == '3.8.*'
12+
# via pytest-cov
13+
coverage==7.10.4 ; python_full_version >= '3.9'
14+
# via pytest-cov
15+
distlib==0.4.0
16+
# via virtualenv
17+
exceptiongroup==1.3.0 ; python_full_version < '3.11'
18+
# via pytest
919
filelock==3.12.2 ; python_full_version < '3.8'
10-
filelock==3.16.1 ; python_full_version >= '3.8'
20+
# via virtualenv
21+
filelock==3.16.1 ; python_full_version == '3.8.*'
22+
# via virtualenv
23+
filelock==3.19.1 ; python_full_version >= '3.9'
24+
# via virtualenv
1125
identify==2.5.24 ; python_full_version < '3.8'
26+
# via pre-commit
1227
identify==2.6.1 ; python_full_version == '3.8.*'
13-
identify==2.6.5 ; python_full_version >= '3.9'
28+
# via pre-commit
29+
identify==2.6.13 ; python_full_version >= '3.9'
30+
# via pre-commit
1431
importlib-metadata==6.7.0 ; python_full_version < '3.8'
15-
iniconfig==2.0.0
16-
mock==5.1.0
17-
mypy==1.4.1
18-
mypy-extensions==1.0.0
32+
# via
33+
# pluggy
34+
# pre-commit
35+
# pytest
36+
# virtualenv
37+
iniconfig==2.0.0 ; python_full_version < '3.8'
38+
# via pytest
39+
iniconfig==2.1.0 ; python_full_version >= '3.8'
40+
# via pytest
41+
mock==5.2.0
42+
mypy==1.4.1 ; python_full_version < '3.8'
43+
mypy==1.14.1 ; python_full_version == '3.8.*'
44+
mypy==1.17.1 ; python_full_version >= '3.9'
45+
mypy-extensions==1.0.0 ; python_full_version < '3.8'
46+
# via mypy
47+
mypy-extensions==1.1.0 ; python_full_version >= '3.8'
48+
# via mypy
1949
nodeenv==1.9.1
20-
packaging==24.0
50+
# via pre-commit
51+
packaging==24.0 ; python_full_version < '3.8'
52+
# via pytest
53+
packaging==25.0 ; python_full_version >= '3.8'
54+
# via pytest
2155
pastel==0.2.1
56+
# via poethepoet
57+
pathspec==0.12.1 ; python_full_version >= '3.9'
58+
# via mypy
2259
platformdirs==4.0.0 ; python_full_version < '3.8'
23-
platformdirs==4.3.6 ; python_full_version >= '3.8'
24-
pluggy==1.2.0
25-
poethepoet==0.19.0
60+
# via virtualenv
61+
platformdirs==4.3.6 ; python_full_version == '3.8.*'
62+
# via virtualenv
63+
platformdirs==4.3.8 ; python_full_version >= '3.9'
64+
# via virtualenv
65+
pluggy==1.2.0 ; python_full_version < '3.8'
66+
# via pytest
67+
pluggy==1.5.0 ; python_full_version == '3.8.*'
68+
# via pytest
69+
pluggy==1.6.0 ; python_full_version >= '3.9'
70+
# via
71+
# pytest
72+
# pytest-cov
73+
poethepoet==0.19.0 ; python_full_version < '3.8'
74+
poethepoet==0.30.0 ; python_full_version == '3.8.*'
75+
poethepoet==0.37.0 ; python_full_version >= '3.9'
2676
pre-commit==2.21.0 ; python_full_version < '3.8'
2777
pre-commit==3.5.0 ; python_full_version == '3.8.*'
28-
pre-commit==4.0.1 ; python_full_version >= '3.9'
29-
pytest==7.4.4
30-
pytest-cov==4.1.0
31-
pytest-mock==3.11.1
32-
pytest-sugar==1.0.0
78+
pre-commit==4.3.0 ; python_full_version >= '3.9'
79+
pygments==2.19.2 ; python_full_version >= '3.9'
80+
# via pytest
81+
pytest==7.4.4 ; python_full_version < '3.8'
82+
# via
83+
# pytest-cov
84+
# pytest-mock
85+
# pytest-sugar
86+
pytest==8.3.5 ; python_full_version == '3.8.*'
87+
# via
88+
# pytest-cov
89+
# pytest-mock
90+
# pytest-sugar
91+
pytest==8.4.1 ; python_full_version >= '3.9'
92+
# via
93+
# pytest-cov
94+
# pytest-mock
95+
# pytest-sugar
96+
pytest-cov==4.1.0 ; python_full_version < '3.8'
97+
pytest-cov==5.0.0 ; python_full_version == '3.8.*'
98+
pytest-cov==6.2.1 ; python_full_version >= '3.9'
99+
pytest-mock==3.11.1 ; python_full_version < '3.8'
100+
pytest-mock==3.14.1 ; python_full_version >= '3.8'
101+
pytest-sugar==1.1.0
33102
pytest-watcher==0.4.3
34103
pyyaml==6.0.1 ; python_full_version < '3.8'
104+
# via pre-commit
35105
pyyaml==6.0.2 ; python_full_version >= '3.8'
36-
ruff==0.9.2
37-
termcolor==2.3.0
38-
tomli==2.0.1
106+
# via
107+
# poethepoet
108+
# pre-commit
109+
ruff==0.12.10
110+
termcolor==2.3.0 ; python_full_version < '3.8'
111+
# via pytest-sugar
112+
termcolor==2.4.0 ; python_full_version == '3.8.*'
113+
# via pytest-sugar
114+
termcolor==3.1.0 ; python_full_version >= '3.9'
115+
# via pytest-sugar
116+
tomli==2.0.1 ; python_full_version < '3.8'
117+
# via
118+
# coverage
119+
# mypy
120+
# poethepoet
121+
# pytest
122+
# pytest-watcher
123+
tomli==2.2.1 ; python_full_version >= '3.8' and python_full_version <= '3.11'
124+
# via
125+
# coverage
126+
# mypy
127+
# poethepoet
128+
# pytest
129+
# pytest-watcher
39130
typed-ast==1.5.5 ; python_full_version < '3.8'
40-
typing-extensions==4.7.1
131+
# via mypy
132+
typing-extensions==4.7.1 ; python_full_version < '3.8'
133+
# via
134+
# exceptiongroup
135+
# importlib-metadata
136+
# mypy
137+
# platformdirs
138+
typing-extensions==4.13.2 ; python_full_version == '3.8.*'
139+
# via
140+
# exceptiongroup
141+
# mypy
142+
# virtualenv
143+
typing-extensions==4.14.1 ; python_full_version >= '3.9'
144+
# via
145+
# exceptiongroup
146+
# mypy
147+
# virtualenv
41148
virtualenv==20.26.6 ; python_full_version < '3.8'
42-
virtualenv==20.29.1 ; python_full_version >= '3.8'
149+
# via pre-commit
150+
virtualenv==20.34.0 ; python_full_version >= '3.8'
151+
# via pre-commit
43152
watchdog==3.0.0 ; python_full_version < '3.8'
153+
# via pytest-watcher
44154
watchdog==4.0.2 ; python_full_version == '3.8.*'
155+
# via pytest-watcher
45156
watchdog==6.0.0 ; python_full_version >= '3.9'
157+
# via pytest-watcher
46158
zipp==3.15.0 ; python_full_version < '3.8'
159+
# via importlib-metadata

src/response_codes/__init__.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,14 @@ def __ge__(cls, other: int) -> bool:
137137
return cls.status_code >= other
138138
return NotImplemented
139139

140+
def __hash__(cls) -> int:
141+
"""Return hash based on the status code.
142+
143+
Returns:
144+
int: Hash value based on the status code
145+
"""
146+
return hash(cls.status_code)
147+
140148

141149
class HTTPStatus(Exception, metaclass=HTTPStatusMeta):
142150
"""Base class for HTTP status code exceptions.

0 commit comments

Comments
 (0)