Skip to content

Commit

Permalink
Added support to Python 3.12
Browse files Browse the repository at this point in the history
  • Loading branch information
amenezes committed Oct 23, 2023
1 parent 6df72a6 commit 3022ca3
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Expand Up @@ -6,7 +6,7 @@ jobs:
tests:
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11']
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
os: [ubuntu]
fail-fast: true
runs-on: ${{ matrix.os }}-latest
Expand Down
2 changes: 1 addition & 1 deletion config/_config.py
Expand Up @@ -51,7 +51,7 @@ def merge_list(config: dict) -> None:
config.pop(f"{key}[{i}]")


def _merge(config: dict):
def _merge(config: dict) -> None:
merge_list(config)
for k, v in config.items():
merge_list(config[k])
Expand Down
4 changes: 3 additions & 1 deletion config/auth.py
@@ -1,3 +1,5 @@
from typing import Dict

from attrs import field, mutable, validators
from requests.auth import HTTPBasicAuth
from requests.exceptions import HTTPError, MissingSchema
Expand Down Expand Up @@ -28,7 +30,7 @@ def token(self, value) -> None:
logger.debug(f"set: [access_token='{self._token}']")

@property
def authorization_header(self) -> dict:
def authorization_header(self) -> Dict[str, str]:
return {"Authorization": f"Bearer {self.token}"}

def request_token(self, client_auth: HTTPBasicAuth, data: dict, **kwargs) -> None:
Expand Down
11 changes: 5 additions & 6 deletions config/spring.py
@@ -1,11 +1,10 @@
"""Module for retrieve application's config from Spring Cloud Config."""
import asyncio
import os
from distutils.util import strtobool
from functools import partial, wraps
from typing import Any, Callable, Dict, KeysView, Optional, Tuple

from attrs import field, fields_dict, mutable, validators
from attrs import converters, field, fields_dict, mutable, validators
from glom import glom

from . import http
Expand Down Expand Up @@ -36,10 +35,10 @@ class ConfigClient:
default=os.getenv("PROFILE", "development"),
validator=validators.instance_of(str),
)
fail_fast: bool = field(
default=bool(strtobool(str(os.getenv("CONFIG_FAIL_FAST", True)))),
fail_fast: bool = field( # type: ignore
default=os.getenv("CONFIG_FAIL_FAST", True),
validator=validators.instance_of(bool),
converter=bool,
converter=converters.to_bool,
)
oauth2: Optional[OAuth2] = field(
default=None,
Expand Down Expand Up @@ -188,7 +187,7 @@ def decrypt(
return response.text

@property
def config(self) -> Dict:
def config(self) -> dict:
"""Getter from configurations retrieved from ConfigClient."""
return self._config

Expand Down
3 changes: 2 additions & 1 deletion setup.cfg
Expand Up @@ -30,6 +30,7 @@ classifiers =
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Programming Language :: Python :: 3.12
Programming Language :: Python :: Implementation :: CPython
Programming Language :: Python :: Implementation :: PyPy
Topic :: Software Development :: Libraries
Expand Down Expand Up @@ -84,7 +85,7 @@ warn_unused_ignores = True
warn_unreachable = True

[tox:tox]
envlist = py{37,38,39,310,311},pypy{3.6,3.7,3.8,3.9,3.10}
envlist = py{37,38,39,310,311,312},pypy{3.8,3.9,3.10}

[testenv]
deps = -rrequirements-dev.txt
Expand Down

0 comments on commit 3022ca3

Please sign in to comment.