Skip to content

Commit

Permalink
Allow Python 3.10-3.12, format for 3.10
Browse files Browse the repository at this point in the history
  • Loading branch information
athornton committed Jan 3, 2024
1 parent ff54ff3 commit 3b90ae6
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 8 deletions.
6 changes: 6 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ repos:
# args: [--fix, --exit-non-zero-on-fix]
# - id: ruff-format

# FIXME: replace with ruff, eventually
- repo: https://github.com/psf/black
rev: 23.12.1
hooks:
- id: black

- repo: https://github.com/adamchainz/blacken-docs
rev: 1.16.0
hooks:
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ $(SENTINELS):
mkdir $@

$(SENTINELS)/dist-setup: | $(SENTINELS)
$(PIP) install -U pip wheel twine
$(PIP) install -U pip wheel twine pre-commit
@touch $@

$(SENTINELS)/dist: $(SENTINELS)/dist-setup $(DIST_DIR)/$(PACKAGE_NAME)-$(VERSION).tar.gz $(DIST_DIR)/$(PACKAGE_NAME)-$(VERSION)-py3-none-any.whl | $(SENTINELS)
Expand Down
4 changes: 3 additions & 1 deletion giftless/auth/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,9 @@ def _create_authenticator(spec: Union[str, dict[str, Any]]) -> Authenticator:
return get_callable(spec, __name__)

log.debug("Creating authenticator using factory: %s", spec["factory"])
factory = get_callable(spec["factory"], __name__) # type: Callable[..., Authenticator]
factory = get_callable(
spec["factory"], __name__
) # type: Callable[..., Authenticator]
options = spec.get("options", {})
return factory(**options)

Expand Down
6 changes: 4 additions & 2 deletions giftless/storage/azure.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import posixpath
from collections import namedtuple
from collections.abc import Iterable
from datetime import UTC, datetime, timedelta
from datetime import datetime, timedelta, timezone
from typing import IO, Any, Optional
from urllib.parse import urlencode
from xml.sax.saxutils import escape as xml_escape
Expand Down Expand Up @@ -248,7 +248,9 @@ def _get_signed_url(
) -> str:
blob_name = self._get_blob_path(prefix, oid)
blob_permissions = BlobSasPermissions(**permissions)
token_expires = datetime.now(tz=UTC) + timedelta(seconds=expires_in)
token_expires = datetime.now(tz=timezone.utc) + timedelta(
seconds=expires_in
)

extra_args: dict[str, Any] = {}
if filename and disposition:
Expand Down
6 changes: 4 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,14 @@ classifiers = [
"License :: OSI Approved:: MIT License",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Natural Language :: English",
"Operating System :: POSIX",
"Typing :: Typed",
]
requires-python = ">=3.11"
requires-python = ">=3.10"
dependencies = []
dynamic = ["version"]

Expand Down Expand Up @@ -53,7 +55,7 @@ build-backend = "setuptools.build_meta"

[tool.black]
line-length = 79
target-version = ["py311"]
target-version = ["py310"]
exclude = '''
/(
\.eggs
Expand Down
2 changes: 1 addition & 1 deletion requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ azure-storage-blob~=12.19
google-cloud-storage~=2.14
boto3~=1.34

importlib-metadata; python_version < '3.11'
importlib-metadata; python_version < '3.13'
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ idna==3.6
# via
# anyio
# requests
importlib-metadata==7.0.0 ; python_version < "3.11"
importlib-metadata==7.0.0 ; python_version < "3.13"
# via -r requirements.in
isodate==0.6.1
# via azure-storage-blob
Expand Down

0 comments on commit 3b90ae6

Please sign in to comment.