Skip to content

Commit

Permalink
Merge pull request #598 from jodal/tooling
Browse files Browse the repository at this point in the history
Update tooling
  • Loading branch information
jodal authored Dec 25, 2024
2 parents 6118e60 + e803e8c commit 13cb909
Show file tree
Hide file tree
Showing 9 changed files with 1,154 additions and 1,882 deletions.
16 changes: 6 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
fail-fast: false
matrix:
include:
- name: "Tests"
- name: "pytest"
python: "3.12"
tox: py312
coverage: true
Expand All @@ -25,7 +25,7 @@ jobs:
- name: "mypy"
python: "3.12"
tox: mypy
- name: "Docs"
- name: "docs"
python: "3.12"
tox: docs

Expand All @@ -34,17 +34,13 @@ jobs:

steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- uses: astral-sh/setup-uv@v5
with:
python-version: ${{ matrix.python }}
- uses: actions/cache@v4
with:
path: ~/.cache/pip
key: poetry-dev-${{ runner.os }}-${{ hashFiles('poetry.lock') }}
- run: python -m pip install poetry==1.8.2 tox==4.15.1
- run: python -m tox -e ${{ matrix.tox }}
- run: uv pip install tox tox-uv
- run: tox -e ${{ matrix.tox }}
if: ${{ ! matrix.coverage }}
- run: python -m tox -e ${{ matrix.tox }} -- --cov-report=xml
- run: tox -e ${{ matrix.tox }} -- --cov-report=xml
if: ${{ matrix.coverage }}
- uses: codecov/codecov-action@v4
if: ${{ matrix.coverage }}
Expand Down
1 change: 0 additions & 1 deletion .python-version

This file was deleted.

2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
author = "Stein Magnus Jodal and contributors"
copyright = f"2009-2024, {author}" # noqa: A001

release = toml.load("../pyproject.toml")["tool"]["poetry"]["version"]
release = toml.load("../pyproject.toml")["project"]["version"]
version = ".".join(release.split(".")[:2])

extensions = [
Expand Down
6 changes: 3 additions & 3 deletions docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,10 @@ formats, run::
Development dependencies
------------------------

If you're setting up Comics for development, you should install `Poetry
<https://python-poetry.org/>`_, and in the Comics git repository, run::
If you're setting up Comics for development, you should install `uv
<https://docs.astral.sh/uv/>`_, and in the Comics git repository, run::

poetry install
uv sync

This installs both the minimum dependencies as described above and all extra
dependencies required for development.
1,792 changes: 0 additions & 1,792 deletions poetry.lock

This file was deleted.

2 changes: 0 additions & 2 deletions poetry.toml

This file was deleted.

115 changes: 56 additions & 59 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,55 +1,60 @@
[tool.poetry]
[project]
name = "comics"
version = "4.2.0"
description = ""
authors = ["Stein Magnus Jodal <[email protected]>"]
license = "AGPL-3.0-only"

[tool.poetry.dependencies]
Django = "^3.2"
Pillow = "^10.3.0"
PyYAML = { version = "^6.0.1", optional = true }
biplist = { version = "^1.0.3", optional = true }
cssmin = "^0.2.0"
cssselect = "^1.2.0"
defusedxml = "^0.7.1"
django-allauth = "^0.51.0"
django-bootstrap-form = "^3.4"
django-compressor = "^3.1"
django-environ = "^0.9.0"
django-invitations = "^1.9.3"
django-tastypie = "^0.14.4"
feedparser = "^6.0.11"
gunicorn = { version = "^22.0.0", optional = true }
httpx = "^0.27.0"
jsmin = "^3.0.1"
lxml = "^5.2.2"
psycopg2-binary = { version = "^2.9.9", optional = true }
pymemcache = { version = "^4.0.0", optional = true }
python = "^3.12"
pytz = "^2024.1"
sentry-sdk = "^2.7.1"
setuptools = "^72.1.0"

[tool.poetry.group.dev.dependencies]
django-debug-toolbar = "^3.8.1"
django-extensions = "^3.2.3"
django-stubs = "^1.16.0"
mypy = "^1.10.0"
pytest = "^8.2.2"
pytest-cov = "^5.0.0"
pytest-django = "^4.8.0"
pytest-mock = "^3.14.0"
ruff = "^0.5.0"
tox = "^4.15.1"
types-pytz = "^2024.1.0.20240417"
types-toml = "^0.10.8.20240310"

[tool.poetry.extras]
api = ["biplist", "PyYAML"]
cache = ["pymemcache"]
pgsql = ["psycopg2-binary"]
server = ["gunicorn"]
description = "Comics is a webcomics aggregator."
authors = [{ name = "Stein Magnus Jodal", email = "[email protected]" }]
readme = "README.md"
license = { text = "AGPL-3.0-only" }
classifiers = ["Private :: Do Not Upload"]
requires-python = ">=3.12,<3.13"
dependencies = [
"django==3.2.25",
"pillow==10.3.0",
"cssmin==0.2.0",
"cssselect==1.2.0",
"defusedxml==0.7.1",
"django-allauth==0.51",
"django-bootstrap-form==3.4",
"django-compressor==3.1",
"django-environ==0.9.0",
"django-invitations==1.9.3",
"django-tastypie==0.14.7",
"feedparser==6.0.11",
"httpx==0.27.0",
"jsmin==3.0.1",
"lxml==5.2.2",
"pytz==2024.1",
"sentry-sdk>=2.7.1",
"setuptools>=72.1",
]

[project.optional-dependencies]
api = ["biplist>=1.0.3,<2", "pyyaml>=6.0.1,<7"]
cache = ["pymemcache>=4.0.0,<5"]
pgsql = ["psycopg2-binary>=2.9.9,<3"]
server = ["gunicorn>=22.0,<23"]

[dependency-groups]
dev = [
"django-debug-toolbar>=3.8.1,<4",
"django-extensions>=3.2.3,<4",
"django-stubs>=1.16.0,<2",
"mypy>=1.10.0,<2",
"pytest>=8.2.2,<9",
"pytest-cov>=5.0.0,<6",
"pytest-django>=4.8.0,<5",
"pytest-mock>=3.14.0,<4",
"ruff>=0.5.0,<1",
"tox-uv>=1.16.2",
"tox>=4.15.1,<5",
"types-pytz>=2024.1.0.20240417,<2025",
"types-toml>=0.10.8.20240310,<0.11",
]


[tool.django-stubs]
django_settings_module = "comics.settings"


[tool.pytest.ini_options]
filterwarnings = [
Expand All @@ -60,10 +65,6 @@ filterwarnings = [
DJANGO_SETTINGS_MODULE = "comics.settings"


[tool.django-stubs]
django_settings_module = "comics.settings"


[tool.mypy]
no_implicit_optional = true
strict_equality = true
Expand Down Expand Up @@ -127,6 +128,7 @@ ignore = [
"RET504", # unnecessary-assign
"RUF012", # mutable-class-default # TODO
"S101", # assert
"SIM115", # open-file-with-context-handler # TODO
"SLF", # flake8-self # TODO
"TD", # flake8-todos
"TRY", # tryceratops # TODO
Expand All @@ -140,8 +142,3 @@ ignore = [

[tool.ruff.lint.isort]
known-first-party = ["comics"]


[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
28 changes: 14 additions & 14 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,33 @@ envlist = py312, docs, ruff-format, ruff-lint, mypy
skipsdist = true

[testenv]
allowlist_externals = poetry
runner = uv-venv-lock-runner
dependency_groups = dev
setenv =
DJANGO_SECRET_KEY=test-only-s3cret
commands =
poetry install
poetry run python -m pytest \
uv run pytest \
--basetemp={envtmpdir} \
--cov=comics --cov-report=term-missing \
{posargs}

[testenv:docs]
changedir = docs
commands =
python -m pip install -r requirements.txt
python -m sphinx -b html -d {envtmpdir}/doctrees . {envtmpdir}/html
uv pip install -r requirements.txt
uv run sphinx-build -b html -d {envtmpdir}/doctrees . {envtmpdir}/html

[testenv:ruff-format]
commands =
poetry install
poetry run python -m ruff format --check
runner = uv-venv-lock-runner
dependency_groups = dev
commands = uv run ruff format --check

[testenv:ruff-lint]
commands =
poetry install
poetry run python -m ruff check
runner = uv-venv-lock-runner
dependency_groups = dev
commands = uv run ruff check

[testenv:mypy]
commands =
poetry install
poetry run python -m mypy comics
runner = uv-venv-lock-runner
dependency_groups = dev
commands = uv run mypy comics
Loading

0 comments on commit 13cb909

Please sign in to comment.