Skip to content

Commit

Permalink
chore: drop support for Python 3.8
Browse files Browse the repository at this point in the history
  • Loading branch information
hartungstenio committed Oct 11, 2024
1 parent 8f9931d commit c5e6173
Show file tree
Hide file tree
Showing 7 changed files with 61 additions and 88 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v4

Expand Down
67 changes: 14 additions & 53 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,67 +1,28 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v5.0.0
hooks:
- id: debug-statements
- id: trailing-whitespace
- id: check-merge-conflict
- id: check-executables-have-shebangs
- id: check-ast
- id: check-byte-order-marker
- id: check-json
- id: check-merge-conflict
- id: check-symlinks
- id: check-toml
- id: check-vcs-permalinks
- id: check-xml
- id: check-yaml
- id: debug-statements
- id: detect-aws-credentials
args: ["--allow-missing-credentials"]
- id: detect-private-key
- id: end-of-file-fixer
- id: fix-byte-order-marker
- id: forbid-new-submodules
- id: no-commit-to-branch
args: [-b, main]

- repo: local
hooks:
- id: check-datetime-now
name: check_datetime_nowpyenv
description: Prefer datetime.utcnow()
language: pygrep
entry: 'datetime\.now\(\)'
types: [python]

- repo: https://github.com/PyCQA/flake8
rev: 6.1.0
hooks:
- id: flake8
args: ["--exclude=docs/*", "--ignore=E501"]

- repo: https://github.com/PyCQA/isort
rev: 5.12.0
hooks:
- id: isort

- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.10.0
hooks:
- id: python-check-mock-methods

- repo: https://github.com/psf/black
rev: 23.11.0
hooks:
- id: black

- repo: https://github.com/PyCQA/pydocstyle
rev: 6.3.0
hooks:
- id: pydocstyle
args: [--add-ignore=D1, -e]

- repo: https://github.com/asottile/pyupgrade
rev: v3.15.0
hooks:
- id: pyupgrade
args: [--py38-plus]
- id: trailing-whitespace

- repo: https://github.com/olist/hulks.git
rev: 0.4.1
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.6.9
hooks:
- id: check-logger
- id: check-mutable-defaults
- id: ruff
args: [--fix]
- id: ruff-format
17 changes: 3 additions & 14 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,32 +18,20 @@ classifiers = [
"Natural Language :: English",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: System :: Distributed Computing",
]
requires-python = ">=3.8"
requires-python = ">=3.9"
dependencies = ["aiobotocore>=2.0.0,<3.0.0", "taskgroup ; python_version < '3.11'"]

[project.urls]
Download = "https://github.com/olist/olist-loafer/releases"
Repository = "https://github.com/olist/olist-loafer/"

[tool.black]
line-length = 110
target-version = ["py38", "py39", "py310", "py311", "py312"]

[tool.isort]
profile = "black"
line_length = 110
known_localfolder = ["loafer", "tests"]
sections = ["FUTURE", "STDLIB", "THIRDPARTY", "LOCALFOLDER"]
default_section = "THIRDPARTY"

[tool.hatch.build.targets.sdist]
exclude = ["/.devcontainer", "/.github", "/docs"]

Expand Down Expand Up @@ -74,7 +62,7 @@ cov = [
]

[[tool.hatch.envs.all.matrix]]
python = ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
python = ["3.9", "3.10", "3.11", "3.12", "3.13"]

[tool.hatch.envs.types]
dependencies = [
Expand All @@ -85,6 +73,7 @@ check = "mypy --install-types --non-interactive {args:src/loafer tests}"

[tool.hatch.envs.hatch-static-analysis]
config-path = "ruff_defaults.toml"
dependencies = ["ruff==0.6.9"]

[tool.pytest.ini_options]
testpaths = ["tests"]
Expand Down
41 changes: 30 additions & 11 deletions ruff_defaults.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ select = [
"ARG004",
"ARG005",
"ASYNC100",
"ASYNC101",
"ASYNC102",
"B002",
"B003",
"B004",
Expand Down Expand Up @@ -49,6 +47,7 @@ select = [
"B032",
"B033",
"B034",
"B035",
"B904",
"B905",
"BLE001",
Expand Down Expand Up @@ -83,7 +82,6 @@ select = [
"E101",
"E401",
"E402",
"E501",
"E701",
"E702",
"E703",
Expand All @@ -98,7 +96,6 @@ select = [
"E742",
"E743",
"E902",
"E999",
"EM101",
"EM102",
"EM103",
Expand Down Expand Up @@ -173,6 +170,10 @@ select = [
"INT002",
"INT003",
"ISC003",
"LOG001",
"LOG002",
"LOG007",
"LOG009",
"N801",
"N802",
"N803",
Expand All @@ -193,8 +194,6 @@ select = [
"PERF102",
"PERF401",
"PERF402",
"PGH001",
"PGH002",
"PGH005",
"PIE790",
"PIE794",
Expand All @@ -216,6 +215,7 @@ select = [
"PLE0116",
"PLE0117",
"PLE0118",
"PLE0237",
"PLE0241",
"PLE0302",
"PLE0307",
Expand All @@ -239,7 +239,7 @@ select = [
"PLR0133",
"PLR0206",
"PLR0402",
"PLR1701",
"SIM101",
"PLR1711",
"PLR1714",
"PLR1722",
Expand Down Expand Up @@ -330,6 +330,7 @@ select = [
"PYI054",
"PYI055",
"PYI056",
"PYI058",
"RET503",
"RET504",
"RET505",
Expand All @@ -346,13 +347,15 @@ select = [
"RUF008",
"RUF009",
"RUF010",
"RUF011",
"RUF012",
"RUF013",
"RUF015",
"RUF016",
"RUF017",
"RUF018",
"RUF019",
"RUF020",
"RUF100",
"RUF200",
"S101",
"S102",
"S103",
Expand All @@ -364,6 +367,8 @@ select = [
"S110",
"S112",
"S113",
"S201",
"S202",
"S301",
"S302",
"S303",
Expand All @@ -387,7 +392,12 @@ select = [
"S323",
"S324",
"S501",
"S502",
"S503",
"S504",
"S505",
"S506",
"S507",
"S508",
"S509",
"S601",
Expand All @@ -398,8 +408,10 @@ select = [
"S607",
"S608",
"S609",
"S611",
"S612",
"S701",
"S702",
"SIM101",
"SIM102",
"SIM103",
Expand All @@ -409,6 +421,7 @@ select = [
"SIM109",
"SIM110",
"SIM112",
"SIM113",
"SIM114",
"SIM115",
"SIM116",
Expand All @@ -426,6 +439,7 @@ select = [
"SIM223",
"SIM300",
"SIM910",
"SIM911",
"SLF001",
"SLOT000",
"SLOT001",
Expand All @@ -438,17 +452,22 @@ select = [
"TCH003",
"TCH004",
"TCH005",
"TCH010",
"TD004",
"TD005",
"TD006",
"TD007",
"TID251",
"TID252",
"TID253",
"ASYNC100",
"ASYNC105",
"ASYNC109",
"ASYNC110",
"ASYNC115",
"TRY002",
"TRY003",
"TRY004",
"TRY200",
"TRY201",
"TRY300",
"TRY301",
Expand Down Expand Up @@ -479,7 +498,6 @@ select = [
"UP024",
"UP025",
"UP026",
"UP027",
"UP028",
"UP029",
"UP030",
Expand All @@ -493,6 +511,7 @@ select = [
"UP038",
"UP039",
"UP040",
"UP041",
"W291",
"W292",
"W293",
Expand Down
4 changes: 3 additions & 1 deletion src/loafer/dispatchers.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@
import asyncio
import logging
import sys
from typing import TYPE_CHECKING, Any, Sequence
from typing import TYPE_CHECKING, Any

from .compat import TaskGroup
from .exceptions import DeleteMessage

if TYPE_CHECKING:
from collections.abc import Sequence

from .routes import Route

logger = logging.getLogger(__name__)
Expand Down
14 changes: 7 additions & 7 deletions src/loafer/ext/aws/bases.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ class _BotoClient:

def __init__(self, **client_options):
self._client_options = {
"api_version": client_options.get("api_version", None),
"aws_access_key_id": client_options.get("aws_access_key_id", None),
"aws_secret_access_key": client_options.get("aws_secret_access_key", None),
"aws_session_token": client_options.get("aws_session_token", None),
"endpoint_url": client_options.get("endpoint_url", None),
"region_name": client_options.get("region_name", None),
"api_version": client_options.get("api_version"),
"aws_access_key_id": client_options.get("aws_access_key_id"),
"aws_secret_access_key": client_options.get("aws_secret_access_key"),
"aws_session_token": client_options.get("aws_session_token"),
"endpoint_url": client_options.get("endpoint_url"),
"region_name": client_options.get("region_name"),
"use_ssl": client_options.get("use_ssl", True),
"verify": client_options.get("verify", None),
"verify": client_options.get("verify"),
}

def get_client(self):
Expand Down
4 changes: 3 additions & 1 deletion src/loafer/managers.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@
import asyncio
import logging
import os
from typing import TYPE_CHECKING, Sequence
from typing import TYPE_CHECKING

from .dispatchers import LoaferDispatcher
from .runners import LoaferRunner

if TYPE_CHECKING:
from collections.abc import Sequence

from .routes import Route

logger = logging.getLogger(__name__)
Expand Down

0 comments on commit c5e6173

Please sign in to comment.