Skip to content

Commit

Permalink
feat: drop py38, add py312
Browse files Browse the repository at this point in the history
  • Loading branch information
klen committed Jul 31, 2024
1 parent 01ee564 commit e6506bf
Show file tree
Hide file tree
Showing 8 changed files with 1,053 additions and 913 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11']
python-version: ['3.9', '3.10', '3.11', '3.12']

steps:
- uses: actions/checkout@main
Expand All @@ -32,7 +32,7 @@ jobs:
run: poetry install --with dev

- name: Check code
run: poetry run ruff muffin
run: poetry run ruff check muffin

- name: Check typing
run: poetry run mypy
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,4 @@ docs/_build
/settings
/test*.py
/todo.txt
/TODO.md
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ repos:
hooks:
- id: ruff
name: ruff
entry: poetry run ruff muffin
entry: poetry run ruff check muffin
language: system
pass_filenames: false
files: \.py$
Expand Down
24 changes: 17 additions & 7 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,21 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Added

### Changed

### Removed

## [0.102.0] - 2024-06-31

### Added
- Python 3.12 support

### Removed

- Drop Python 3.8 support

## [0.92.0] - 2023-03-04

### Removed
Expand All @@ -33,13 +48,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- First public release

### Added

### Changed

### Removed

[unreleased]: https://github.com/klen/muffin/compare/0.92.0...HEAD
[unreleased]: https://github.com/klen/muffin/compare/0.102.0...HEAD
[0.102.0]: https://github.com/klen/muffin/compare/0.92.2...0.102.0
[0.92.0]: https://github.com/klen/muffin/compare/0.87.1...0.92.0
[0.87.1]: https://github.com/klen/muffin/compare/0.87.0...0.87.1
[0.87.0]: https://github.com/klen/muffin/compare/0.86.2...0.87.0
Expand Down
4 changes: 2 additions & 2 deletions muffin/manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
from .types import TVShellCtx

VERSION = metadata.version("muffin")
PARAM_RE = re.compile(r"^\s+:param (\w+): (.+)$", re.M)
PARAM_RE = re.compile(r"^\s+:param (\w+): (.+)$", re.MULTILINE)


class Manager:
Expand Down Expand Up @@ -70,7 +70,7 @@ def __init__(self, app: "Application"):
)

self.subparsers = self.parser.add_subparsers(dest="subparser")
self.commands: Dict[str, Callable] = {} # noqa: FA100
self.commands: Dict[str, Callable] = {}

self.shell(
getattr(
Expand Down
1,905 changes: 1,014 additions & 891 deletions poetry.lock

Large diffs are not rendered by default.

16 changes: 9 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ classifiers = [
"License :: OSI Approved :: MIT License",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"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 :: Implementation :: PyPy",
"Topic :: Internet :: WWW/HTTP",
"Framework :: AsyncIO",
Expand All @@ -30,8 +30,8 @@ packages = [{ include = "muffin" }]
changelog = "https://raw.githubusercontent.com/klen/muffin/master/CHANGELOG.md"

[tool.poetry.dependencies]
python = "^3.8"
asgi-tools = "^0"
python = "^3.9"
asgi-tools = "^1"
modconfig = "^1"
ujson = "*"

Expand Down Expand Up @@ -77,24 +77,26 @@ ignore_missing_imports = true

[tool.ruff]
line-length = 100
target-version = "py38"
target-version = "py39"
exclude = [".venv", "docs", "example"]

[tool.ruff.lint]
select = ["ALL"]
ignore = ["D", "UP", "ANN", "DJ", "EM", "RSE", "SLF", "RET", "S101", "PLR2004", "N804", "COM"]

[tool.ruff.per-file-ignores]
[tool.ruff.lint.per-file-ignores]
"tests/*" = ["ARG", "TRY", "F", "PGH", "PLR", "PLW", "PTH", "SIM", "RET504", "T20"]

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

[tool.tox]
legacy_tox_ini = """
[tox]
isolated_build = true
envlist = py38,py39,py310,py311,pypy310
envlist = py39,py310,py311,py312,pypy310
[testenv]
allowlist_externals = poetry
Expand Down
10 changes: 7 additions & 3 deletions tests/test_pytest.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
import pytest
from asgi_tools._compat import aio_sleep


@pytest.fixture()
def name(app):
return app.cfg.name


def test_app_imported(app):
async def test_app_imported(app):
assert app.cfg.name == "muffin"
await aio_sleep(0.2)


def test_app_available_in_fixture(name):
async def test_app_available_in_fixture(name):
assert name == "muffin"
await aio_sleep(0.2)


def test_app_lifespan(app):
async def test_app_lifespan(app):
assert app.state == "started"
await aio_sleep(0.2)

0 comments on commit e6506bf

Please sign in to comment.