Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions .github/workflows/lint_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,8 @@ jobs:
just-version: 1.14.0

- name: Setup environment to run tox
env:
UV_SYSTEM_PYTHON: 1
run:
just setup-runner
run: |-
just setup-ci-runner

- name: Run linters
run:
Expand Down Expand Up @@ -83,10 +81,8 @@ jobs:
just-version: 1.14.0

- name: Setup environment to run tox
env:
UV_SYSTEM_PYTHON: 1
run:
just setup-runner
run: |-
just setup-ci-runner

- name: Run tests with coverage
if: ${{ (matrix.python_version.cov && github.event_name == 'pull_request') }}
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/test_all_oses.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,8 @@ jobs:
just-version: 1.14.0

- name: Setup environment to run tox
env:
UV_SYSTEM_PYTHON: 1
run:
just setup-runner
run: |-
just setup-ci-runner

- name: Run tests
run:
Expand Down
14 changes: 9 additions & 5 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,16 @@ build:
os: ubuntu-22.04
tools:
python: "3.11"
jobs:
pre_create_environment:
- asdf plugin add uv
- asdf install uv latest
- asdf global uv latest
create_environment:
- uv venv "${READTHEDOCS_VIRTUALENV_PATH}"
install:
- UV_PROJECT_ENVIRONMENT="${READTHEDOCS_VIRTUALENV_PATH}" just uv-sync-group doc

python:
install:
- requirements: requirements/doc.txt
- method: pip
path: .

sphinx:
configuration: docs/conf.py
Expand Down
2 changes: 2 additions & 0 deletions _typos.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
[files]
extend-exclude = [
"docs/_static/",
"benchmarks/benchmarks/gh_issues/data.json",
"*.svg",
]

[default.extend-words]
Expand Down
37 changes: 26 additions & 11 deletions justfile
Original file line number Diff line number Diff line change
@@ -1,21 +1,28 @@
set windows-shell := ["powershell.exe", "-NoLogo", "-Command"]

just := "just --justfile " + justfile()
uv_sync_group := "uv sync --active --locked --only-group"

[private]
@install-initial:
pip install pip==25.1.1
pip install uv==0.9.8


[private]
@default:
just --list
{{ just }} --list

# prepare venv and repo for developing
@bootstrap:
pip install -r requirements/pre.txt
uv pip install -e .
uv pip install -r requirements/dev.txt
{{ just }} install-initial
{{ just }} venv-sync
prek
prek install

# sync version of installed packages
@venv-sync:
uv pip sync requirements/pre.txt requirements/dev.txt
uv pip install -e .
{{ uv_sync_group }} dev

# run all linters
@lint:
Expand All @@ -42,10 +49,10 @@ inv := "inv -r scripts -c invoke_tasks"
--parallel

@deps-compile:
{{ inv }} deps-compile
uv lock

@deps-compile-upgrade:
{{ inv }} deps-compile --upgrade
uv lock --upgrade

doc_source := "docs"
doc_target := "docs-build"
Expand All @@ -66,9 +73,17 @@ doc_target := "docs-build"
# Continious integration

[private]
@setup-runner:
pip install -r requirements/pre.txt
uv pip install -r requirements/runner.txt
@setup-ci-runner:
{{ just }} install-initial
{{ uv_sync_group }} ci-runner
echo ".venv/bin" >> "$GITHUB_PATH"
echo "VIRTUAL_ENV=.venv" >> $GITHUB_ENV


[private]
@uv-sync-group group:
{{ uv_sync_group }} {{ group }}


[private]
@inv *ARGS:
Expand Down
137 changes: 137 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,12 @@ msgspec-strict = ['msgspec >= 0.18.5, <= 0.19.0']
name = 'A. Tikhonov'
email = '17@itishka.org'


# ┌ ┐
# │ TESTING │
# └ ┘


[tool.pytest.ini_options]
python_classes = 'WeDoNotUseClassTestCase'
python_files = [
Expand All @@ -85,6 +87,141 @@ exclude_also = [
"^\\s*\\.\\.\\.\\s*(:?#.*)?$",
]


# ┌ ┐
# │ CI DEPENDENCIES │
# └ ┘


[dependency-groups]
pytest = [
"pytest==8.3.5"
]

test-extra-none = [
{include-group = "pytest"},
"adaptix", # local package
"tests_helpers", # local package
"phonenumberslite==9.0.5",
"dirty-equals==0.9.0",
"coverage==7.8.1",
"jsonschema-rs==0.30.0; implementation_name != 'pypy' and python_version < '3.14'",
]

test-extra-old = [
{include-group = "test-extra-none"},
"attrs==21.3.0",
"sqlalchemy==2.0.0",
"pydantic==2.1.0",
"msgspec==0.18.5; implementation_name != 'pypy'",
]

test-extra-old-py313 = [
{include-group = "test-extra-none"},
"attrs==21.3.0",
"sqlalchemy==2.0.31",
"pydantic==2.8.2",
"msgspec==0.19.0; implementation_name != 'pypy'",
]

test-extra-new = [
{include-group = "test-extra-none"},
"attrs==24.2.0",
"sqlalchemy==2.0.36",
"pydantic==2.10.3",
"msgspec==0.19.0; implementation_name != 'pypy'",
]

bench = [
{include-group = "pytest"},
"adaptix", # local package
"benchmarks", # local package

"pyperf==2.6.1",
"psutil==5.9.5",

"mashumaro==3.10",
"pydantic==2.10.3",
"cattrs==23.1.2",
"schematics==2.1.1",
"dataclass-factory==2.16",
"marshmallow==3.20.1",
"msgspec==0.19.0; implementation_name != 'pypy'",
]

doc = [
{include-group = "bench"},

"sphinx==8.2.3",
"sphinx-copybutton==0.5.2",
"sphinx-design==0.6.1",
"sphinx-paramlinks==0.6.0",
"myst-parser==4.0.1",
"sphinxext-opengraph==0.10.0",
"sphinx-better-subsection==0.2",
"sphinx-reredirects==0.1.6",
"sphinxcontrib-globalsubs==0.1.2",
"sphinxcontrib-apidoc==0.6.0",
"furo==2024.8.6",

"docutils-stubs==0.0.22",

"gitpython==3.1.44",
"plotly==6.1.1",
]

ci-runner = [
"uv==0.9.8",
"tox-uv==1.25.0",
"invoke==2.2.0",
"coverage==7.8.1",
]

lint = [
{include-group = "test-extra-new"},
{include-group = "doc"},

"prek==0.2.5",

"mypy[faster-cache]==1.15.0",

"vulture==2.10",

"ruff==0.14.0",

"radon==6.0.1",
"dlint==0.14.1",
"typos==1.39.0",

"astpath[xpath]==0.9.1",
]

dev = [
{include-group = "ci-runner"},
{include-group = "lint"},
"towncrier==24.8.0",
]

[tool.uv.dependency-groups]
test-extra-old-py313 = {requires-python = ">=3.13"}
doc = {requires-python = ">=3.11"}


[tool.uv]
conflicts = [
[
{ group = "test-extra-old" },
{ group = "test-extra-old-py313" },
{ group = "test-extra-new" },
{ group = "bench" },
],
]

[tool.uv.sources]
benchmarks = { path = "./benchmarks", editable = true }
tests_helpers = { path = "./tests/tests_helpers", editable = true }
adaptix = { path = ".", editable = true }

# ┌ ┐
# │ LINTING │
# └ ┘
Expand Down
47 changes: 0 additions & 47 deletions requirements/bench.txt

This file was deleted.

Loading
Loading