Skip to content

Commit bcc7140

Browse files
author
Denis Navarro
committed
chore(*): Remove Python 3.7 and Python 3.8 support and add Python 3.11, Python 3.12 and Python 3.13 support
1 parent 42dc93e commit bcc7140

File tree

21 files changed

+186
-120
lines changed

21 files changed

+186
-120
lines changed

.github/workflows/cd.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ jobs:
1515
env:
1616
VERSION: ${{ github.event.inputs.release_version }}
1717
steps:
18-
- uses: actions/checkout@v3
19-
- uses: actions/setup-python@v4
18+
- uses: actions/checkout@v4
19+
- uses: actions/setup-python@v5
2020
with:
21-
python-version: '3.10'
21+
python-version: '3.13'
2222
- name: version
2323
run: sed -i "s/__version__ = '.*'/__version__ = '$VERSION'/g" aiodi/__init__.py
2424
- name: deps

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ jobs:
1414
strategy:
1515
matrix:
1616
os: [ ubuntu-latest ]
17-
python-version: [ '3.7', '3.8', '3.9', '3.10' ]
17+
python-version: [ 3.9', '3.10', '3.11', '3.12', '3.13 ]
1818
steps:
19-
- uses: actions/checkout@v3
20-
- uses: actions/setup-python@v4
19+
- uses: actions/checkout@v4
20+
- uses: actions/setup-python@v5
2121
with:
2222
python-version: ${{ matrix.python-version }}
2323
- name: deps

Containerfile

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
FROM docker.io/library/python:3.9-slim AS production
2+
3+
WORKDIR /app
4+
5+
RUN apt update -y && apt upgrade -y
6+
RUN --mount=type=cache,target=/root/.cache/pip python3 -m pip install --upgrade pip
7+
8+
COPY LICENSE README.md pyproject.toml ./
9+
COPY aiodi ./aiodi/
10+
11+
RUN --mount=type=cache,target=/root/.cache/pip python3 -m pip install .
12+
13+
ENTRYPOINT ["python3"]
14+
CMD []
15+
16+
FROM production AS development
17+
18+
RUN apt install -y gcc
19+
20+
COPY .pre-commit-config.yaml run-script ./
21+
22+
RUN --mount=type=cache,target=/root/.cache/pip python3 run-script dev-install
23+
24+
COPY docs_src ./docs_src
25+
COPY tests ./tests
26+
27+
ENTRYPOINT ["python3", "run-script"]

Dockerfile

Lines changed: 0 additions & 27 deletions
This file was deleted.

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2022 aiopy
3+
Copyright (c) 2022 - 2024 aiopy
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ if __name__ == '__main__':
167167

168168
## Requirements
169169

170-
- Python >= 3.7
170+
- Python >= 3.9
171171

172172
## Contributing
173173

aiodi/builder.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def __init__(
5555
'variable': VariableResolver(),
5656
}
5757
self._decoders = {
58-
'toml': lambda path: (toml_decoder or lazy_toml_decoder())(path).get('tool', {}).get(tool_key, {}), # type: ignore
58+
'toml': lambda path: (toml_decoder or lazy_toml_decoder())(path).get('tool', {}).get(tool_key, {}),
5959
}
6060

6161
def map_items(items: Dict[str, Dict[str, Any]]) -> List[Tuple[str, Any, Dict[str, Any]]]:
@@ -67,7 +67,7 @@ def map_items(items: Dict[str, Dict[str, Any]]) -> List[Tuple[str, Any, Dict[str
6767
}.items()
6868
]
6969

70-
self._map_items = map_items # type: ignore
70+
self._map_items = map_items
7171

7272
def load(self) -> Container:
7373
extra: Dict[str, Any] = {

aiodi/container.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def resolve_parameter(self, fn: Callable[['Container'], Any]) -> Tuple[int, Call
4747
return len(self._parameter_resolvers) - 1, fn
4848

4949
def resolve(self, items: List[Union[ContainerKey, Tuple[ContainerKey, _T, Dict[str, Any]]]]) -> None:
50-
items_ = list(map(self._sanitize_item_before_resolve, items))
50+
items_: List[Any] = list(map(self._sanitize_item_before_resolve, items))
5151
while items_:
5252
for index, item in enumerate(items_):
5353
# Check if already exist
@@ -68,7 +68,7 @@ def resolve(self, items: List[Union[ContainerKey, Tuple[ContainerKey, _T, Dict[s
6868
if kwargs is not None:
6969
if self.debug:
7070
logger.debug('Resolving {0}'.format(item[1]))
71-
inst = item[1](**kwargs) # type: ignore
71+
inst = item[1](**kwargs)
7272
if self.debug:
7373
logger.debug('Adding {0} - {1}'.format(item[0], item[1]))
7474
self.set(item[0], inst)
@@ -162,7 +162,7 @@ def _sanitize_item_before_resolve(
162162
if length == 2:
163163
return item[0], item[1], {}
164164
if length >= 3:
165-
return item[:3] # type: ignore
165+
return item[:3]
166166
raise ValueError('Tuple must be at least of one item')
167167

168168
def _resolve_or_postpone_item(

aiodi/resolver/service.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,8 @@ class ServiceResolver(Resolver[ServiceMetadata, Any]):
188188
@staticmethod
189189
def _define_service_type(name: str, typ: str, cls: str) -> Tuple[Type[Any], Type[Any]]:
190190
if typ is _SVC_DEFAULTS and cls is _SVC_DEFAULTS: # type: ignore
191-
cls = typ = import_module_and_get_attr(name=name) # type: ignore
192-
return typ, cls # type: ignore
191+
cls = typ = import_module_and_get_attr(name=name)
192+
return typ, cls
193193

194194
if typ is not _SVC_DEFAULTS: # type: ignore
195195
typ = import_module_and_get_attr(name=typ) # type: ignore
@@ -198,7 +198,7 @@ def _define_service_type(name: str, typ: str, cls: str) -> Tuple[Type[Any], Type
198198

199199
if typ is _SVC_DEFAULTS: # type: ignore
200200
try:
201-
typ = import_module_and_get_attr(name=name) # type: ignore
201+
typ = import_module_and_get_attr(name=name)
202202
except Exception:
203203
typ = cls
204204
if cls is _SVC_DEFAULTS: # type: ignore
@@ -226,7 +226,7 @@ def extract_metadata(self, data: Dict[str, Any], extra: Dict[str, Any]) -> Servi
226226
clazz=clazz,
227227
arguments=kwargs,
228228
params=[
229-
ServiceMetadata.ParameterMetadata.from_param_inspected_and_args(param=param, arguments=kwargs)
229+
ServiceMetadata.ParameterMetadata.from_param_inspected_and_args(param=param, arguments=kwargs) # type: ignore
230230
for param in signature(clazz).parameters.items()
231231
],
232232
defaults=defaults,

aiodi/resolver/variable.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def extract_metadata(
7070
name=key,
7171
value=val,
7272
matches=[
73-
VariableMetadata.MatchMetadata.from_match(match=match)
73+
VariableMetadata.MatchMetadata.from_match(match=match) # type: ignore
7474
for match in self._metadata_matches(key=key, val=val)
7575
],
7676
)
@@ -93,7 +93,7 @@ def parse_value(
9393
if typ_val is None:
9494
# can only concatenate str to str
9595
return typ_val
96-
if metadata_.default is _VAR_DEFAULTS and typ_val == metadata_.default:
96+
if metadata_.default is _VAR_DEFAULTS and typ_val == metadata_.default: # type: ignore
9797
raise EnvironmentVariableNotFound(name=metadata_.source_name)
9898
elif metadata_.source_kind == 'var':
9999
if metadata_.source_name not in _variables:

aiodi/toml.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88

99
def _decoder_from_builtin_lib() -> TOMLDecoder:
10-
from tomllib import load # type: ignore
10+
from tomllib import load
1111

1212
def decorator(path: TOMLPath) -> TOMLDecoded:
1313
with open(path, 'rb') as file:
@@ -17,13 +17,13 @@ def decorator(path: TOMLPath) -> TOMLDecoded:
1717

1818

1919
def _decoder_from_pytomlpp_lib() -> TOMLDecoder:
20-
from pytomlpp import load # type: ignore
20+
from pytomlpp import load
2121

2222
return load # type: ignore
2323

2424

2525
def _decoder_from_rtoml_lib() -> TOMLDecoder:
26-
from rtoml import load # type: ignore
26+
from rtoml import load
2727

2828
def decorator(path: TOMLPath) -> TOMLDecoded:
2929
with open(path, 'r', encoding='utf-8') as file:
@@ -43,7 +43,7 @@ def decorator(path: TOMLPath) -> TOMLDecoded:
4343

4444

4545
def _decoder_from_pytoml_lib() -> TOMLDecoder:
46-
from pytoml import load # type: ignore
46+
from pytoml import load
4747

4848
def decorator(path: TOMLPath) -> TOMLDecoded:
4949
with open(path, 'rb') as file:
@@ -59,7 +59,7 @@ def _decoder_from_toml_lib() -> TOMLDecoder:
5959

6060

6161
def _decoder_from_qtoml_lib() -> TOMLDecoder:
62-
from qtoml import load # type: ignore
62+
from qtoml import load
6363

6464
def decorator(path: TOMLPath) -> TOMLDecoded:
6565
with open(path, 'r', encoding='utf-8') as file:

docker-compose.yml renamed to compose.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,8 @@ services:
22
aiodi:
33
build:
44
context: .
5-
dockerfile: Dockerfile
5+
dockerfile: Containerfile
66
target: development
77
image: ghcr.io/aiopy/python-aiodi:${VERSION:-latest}
88
volumes:
99
- .:/app
10-
11-
version: "3.7"

docs_src/docs/en/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Key Features:
1010

1111
## Requirements
1212

13-
- Python 3.7+
13+
- Python 3.9+
1414

1515
## Installation
1616

docs_src/docs/es/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Funcionalidades clave:
1010

1111
## Requisitos
1212

13-
- Python 3.7+
13+
- Python 3.9+
1414

1515
## Instalación
1616

docs_src/generated/en/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ <h1 id="aiodi">AIODI</h1>
418418
</ul>
419419
<h2 id="requirements">Requirements</h2>
420420
<ul>
421-
<li>Python 3.7+</li>
421+
<li>Python 3.9+</li>
422422
</ul>
423423
<h2 id="installation">Installation</h2>
424424
<div class="highlight"><pre><span></span><code>python3 -m pip install aiodi
@@ -609,4 +609,4 @@ <h2 id="license">License</h2>
609609

610610

611611
</body>
612-
</html>
612+
</html>

0 commit comments

Comments
 (0)