Skip to content

Commit

Permalink
Support Python3.13 (#42)
Browse files Browse the repository at this point in the history
* test against 3.13

* updated version to v0.0.10

* upgraded python deps

* migrated to uv

* removed requirements.txt and pip-audit precommit hook

* added --all-extras to 'uv sync' command in ci

* added uvicorn as dev dependency

* pin blacksheep to 2.0.6

* added uv config to pyproject.toml

* replaced msgspec with pydantic and blacksheep with quart (#43)

* replaced msgspec with pydantic and blacksheep with quart

* updated type from BaseException -> Exception

* Revert "updated type from BaseException -> Exception"

This reverts commit d97c1b6.

* added arbitrary_types_allowed=True to pydantic model config

* updated test server response

* removed arg
  • Loading branch information
fullerzz authored Nov 9, 2024
1 parent c34cc0a commit 8779f03
Show file tree
Hide file tree
Showing 10 changed files with 1,784 additions and 2,605 deletions.
32 changes: 18 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python

name: CI
name: ci-tests

on:
push:
branches: [ "*" ]
pull_request:
branches: [ "main", "dev" ]
branches: [ "*" ]

jobs:
build:
Expand All @@ -16,29 +16,31 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]
python-version: ["3.10", "3.11", "3.12", "3.13"]

env:
# Configure a constant location for the uv cache
UV_CACHE_DIR: /tmp/.uv-cache
FORCE_COLOR: 1

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
- name: Load cached venv
id: cached-poetry-dependencies
id: cached-uv-dependencies
uses: actions/cache@v4
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
path: /tmp/.uv-cache
key: uv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/uv.lock') }}
- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction --all-extras
run: |
pip install uv==0.5.1
uv venv
source .venv/bin/activate
uv sync --all-extras
- name: Code linting
run: |
source .venv/bin/activate
Expand All @@ -49,3 +51,5 @@ jobs:
run: |
source .venv/bin/activate
bash -c tests/run_tests.sh
- name: Minimize uv cache
run: uv cache prune --ci
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -159,4 +159,5 @@ cython_debug/
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
.idea/

.vscode/
.vscode/
.python-version
13 changes: 1 addition & 12 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
repos:
- repo: https://github.com/python-poetry/poetry
rev: "1.8.2"
hooks:
- id: poetry-check
- id: poetry-lock
- id: poetry-export
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
Expand All @@ -13,14 +7,9 @@ repos:
- id: trailing-whitespace
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.3.7
rev: v0.7.0
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
- id: ruff-format
args: [src/loamy/]
- repo: https://github.com/pypa/pip-audit
rev: v2.7.2
hooks:
- id: pip-audit
args: ["-r", "requirements.txt"]
2,027 changes: 0 additions & 2,027 deletions poetry.lock

This file was deleted.

71 changes: 39 additions & 32 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,41 +1,52 @@
[tool.poetry]
[project]
name = "loamy"
version = "0.0.9"
version = "0.0.10"
description = "This project allows you to execute a list of http operations asynchronously from within a synchronous context."
authors = ["Zach Fuller <[email protected]>"]
readme = "README.md"
license = "MIT"
repository = "https://github.com/fullerzz/loamy"
packages = [{include = "loamy", from = "src"}]

[tool.poetry.dependencies]
python = "^3.10"
aiohttp = ">=3.9.5"
aiodns = "~3.1.1"
msgspec = "~0.18.6"
uvloop = { version = "0.19.0", optional = true }
loguru = "^0.7.2"

[tool.poetry.group.dev.dependencies]
ruff = "^0.4.0"
pre-commit = "3.5.0"
pytest = "^7.4.4"
pytest-asyncio = "^0.21.1"
blacksheep = "^2.0.7"
uvicorn = "^0.24.0.post1"
mypy = "^1.9.0"
pip-audit = "^2.7.2"
httpx = "^0.27.0"

[tool.poetry.extras]
uvloop = ["uvloop"]
requires-python = ">=3.10"
dependencies = [
"aiodns>=3.2.0",
"aiohttp>=3.10.10",
"loguru>=0.7.2",
"pydantic>=2.9.2",
]

[project.optional-dependencies]
uvloop = [
"uvloop>=0.21.0",
]

[dependency-groups]
dev = [
"httpx>=0.27.2",
"mypy>=1.13.0",
"pip-audit>=2.7.3",
"pre-commit>=4.0.1",
"pytest>=8.3.3",
"pytest-asyncio>=0.24.0",
"ruff>=0.7.3",
"uvicorn>=0.32.0",
"quart>=0.19.8",
]

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[tool.uv]
python-preference = "system"
python-downloads = "manual"

[tool.uv.pip]
strict = true

[tool.ruff]
extend-exclude = ["tests"]
line-length = 88
indent-width = 4

target-version = "py310"
target-version = "py311"

[tool.ruff.lint]
select = ["E", "F", "W", "C90", "I", "N", "UP", "ASYNC", "S", "B", "ERA", "PLE", "PLW", "PERF", "RUF"]
Expand All @@ -53,7 +64,3 @@ quote-style = "double"
indent-style = "space"
skip-magic-trailing-comma = false
line-ending = "auto"

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
Loading

0 comments on commit 8779f03

Please sign in to comment.