diff --git a/docs/contrib.md b/docs/contrib.md index dd8f72f..903ce89 100644 --- a/docs/contrib.md +++ b/docs/contrib.md @@ -21,16 +21,7 @@ We use uv for managing dependencies. To install it, please follow the official g After you have cloned the taskiq repo, install dependencies using this command: ```bash -uv sync -``` - -It will install all required dependencies. -If you want to run pytest against different python environments, please install `pyenv` using instructions from its [readme](https://github.com/pyenv/pyenv). - -After pyenv is ready, you can install all python versions using this command: - -```bash -pyenv install +uv sync --all-extras ``` ## Linting @@ -43,7 +34,6 @@ But even without installation, you can run all lints manually: pre-commit run -a ``` - ## Testing You can run `pytest` without any parameters and it will do the thing. @@ -61,9 +51,29 @@ pytest -n 2 Also we use `tox` to test against different environments. You can publish a PR to run pytest with different python versions, but if you want to do it locally, just run `tox` command. - ```bash tox ``` -Tox assumes that you've installed python versions using pyenv with command above. +## Working with documentation + +For documentation we use [VuePress 2](https://vuepress.vuejs.org/). To run documentation locally, use steps below. + +First of all, install dependencies for documentation. We recommend to use `pnpm` for managing dependencies, but `package.json` is compatible with `npm` and `bun` for example as well: + +```bash +pnpm i +``` + +After that, you can run documentation server with hot-reloading using: + +```bash +pnpm docs:dev +``` + +If you want to check how documentation looks like in production mode, you can build it and then serve using: + +```bash +pnpm docs:build +pnpm docs:serve +``` diff --git a/pyproject.toml b/pyproject.toml index 47bd43d..b769985 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -64,11 +64,13 @@ dev = [ "pytest-cov>=7.0.0", "coverage>=7.11.3", "pytest-xdist[psutil]>=3.8.0", - "tox>=4.32.0", "freezegun>=1.5.5", "tzdata>=2025.2; sys_platform == 'win32'", "opentelemetry-test-utils (>=0.59b0,<1)", "polyfactory>=3.1.0", + # tests with all python versions + "tox>=4.32.0", + "tox-uv>=1.29.0", ] [project.urls] @@ -122,7 +124,7 @@ omit = [ ] [build-system] -requires = ["uv_build>=0.8.14,<0.9.0"] +requires = ["uv_build>=0.9.16,<0.10.0"] build-backend = "uv_build" [tool.uv.build-backend] @@ -213,3 +215,16 @@ extend-immutable-calls = ["taskiq_dependencies.Depends", "taskiq.TaskiqDepends"] extend-exclude = [ "docs/README.md", # because of identifier in head section ] + +[tool.tox] +requires = ["tox>=4"] +isolated_build = true +env_list = ["3.13", "3.12", "3.11", "3.10"] + +[tool.tox.env_run_base] +description = "Run tests with Python {base_python}" +runner = "uv-venv-lock-runner" +uv_sync_flags = ["--all-extras"] +commands = [ + ["pytest", "-vv", "-n", "auto"] +] diff --git a/tox.ini b/tox.ini deleted file mode 100644 index 23371ed..0000000 --- a/tox.ini +++ /dev/null @@ -1,15 +0,0 @@ -[tox] -isolated_build = true -env_list = - py313 - py312 - py311 - py310 - -[testenv] -skip_install = true -allowlist_externals = uv -commands_pre = - uv sync --all-extras -commands = - uv run pytest -vv -n auto diff --git a/uv.lock b/uv.lock index 2828eb5..1aed9c0 100644 --- a/uv.lock +++ b/uv.lock @@ -1871,6 +1871,7 @@ dev = [ { name = "pytest-xdist", extra = ["psutil"] }, { name = "ruff" }, { name = "tox" }, + { name = "tox-uv" }, { name = "tzdata", marker = "sys_platform == 'win32'" }, ] @@ -1912,6 +1913,7 @@ dev = [ { name = "pytest-xdist", extras = ["psutil"], specifier = ">=3.8.0" }, { name = "ruff", specifier = ">=0.14.5" }, { name = "tox", specifier = ">=4.32.0" }, + { name = "tox-uv", specifier = ">=1.29.0" }, { name = "tzdata", marker = "sys_platform == 'win32'", specifier = ">=2025.2" }, ] @@ -1995,6 +1997,21 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/fc/cc/e09c0d663a004945f82beecd4f147053567910479314e8d01ba71e5d5dea/tox-4.32.0-py3-none-any.whl", hash = "sha256:451e81dc02ba8d1ed20efd52ee409641ae4b5d5830e008af10fe8823ef1bd551", size = 175905, upload-time = "2025-10-24T18:03:36.337Z" }, ] +[[package]] +name = "tox-uv" +version = "1.29.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "packaging" }, + { name = "tomli", marker = "python_full_version < '3.11'" }, + { name = "tox" }, + { name = "uv" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/4f/90/06752775b8cfadba8856190f5beae9f552547e0f287e0246677972107375/tox_uv-1.29.0.tar.gz", hash = "sha256:30fa9e6ad507df49d3c6a2f88894256bcf90f18e240a00764da6ecab1db24895", size = 23427, upload-time = "2025-10-09T20:40:27.384Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/5c/17/221d62937c4130b044bb437caac4181e7e13d5536bbede65264db1f0ac9f/tox_uv-1.29.0-py3-none-any.whl", hash = "sha256:b1d251286edeeb4bc4af1e24c8acfdd9404700143c2199ccdbb4ea195f7de6cc", size = 17254, upload-time = "2025-10-09T20:40:25.885Z" }, +] + [[package]] name = "typing-extensions" version = "4.15.0" @@ -2025,6 +2042,32 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/5c/23/c7abc0ca0a1526a0774eca151daeb8de62ec457e77262b66b359c3c7679e/tzdata-2025.2-py2.py3-none-any.whl", hash = "sha256:1a403fada01ff9221ca8044d701868fa132215d84beb92242d9acd2147f667a8", size = 347839, upload-time = "2025-03-23T13:54:41.845Z" }, ] +[[package]] +name = "uv" +version = "0.9.16" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/bc/21/1a01209d34d49135151edd058bfefe395fd8c7f17233754d85c036311c4c/uv-0.9.16.tar.gz", hash = "sha256:b73269213e22e8638d14d0f8ae1bef34a0a3c20a3bd2010544456d36159e357d", size = 3806010, upload-time = "2025-12-06T14:19:17.889Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/1f/3c/dfea2ce3f863f5fe3762d6305ff54b05d49c36d531c452e0483b226899b4/uv-0.9.16-py3-none-linux_armv6l.whl", hash = "sha256:748b6d408429d9d9ee3e59a33e714bf41471b8534c8fc1526e0d8b695c7304e1", size = 21086205, upload-time = "2025-12-06T14:18:49.667Z" }, + { url = "https://files.pythonhosted.org/packages/21/73/9b8059692dff670b10cc91aa7fb130397e35e22895f47a0d87b1fcd3c1b9/uv-0.9.16-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:a4add59e5fb179ff01a8dc02cd24a9c7dcd8a60d3744c2dfacf2818eb709a1de", size = 20271218, upload-time = "2025-12-06T14:19:36.686Z" }, + { url = "https://files.pythonhosted.org/packages/73/d3/2f81803f4fe818b8a1f0c256523a1fed17372d8b901798a92b6316c42757/uv-0.9.16-py3-none-macosx_11_0_arm64.whl", hash = "sha256:ac60c04510e4710370762c8d7f9382f269b881efacc4262e2229ef27df39441c", size = 18831407, upload-time = "2025-12-06T14:19:03.524Z" }, + { url = "https://files.pythonhosted.org/packages/16/42/13bd057513b7616ec0416d070186e410474f8f9c9fa48b965561a8d214af/uv-0.9.16-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.musllinux_1_1_aarch64.whl", hash = "sha256:5cacb026d93e9be53f9c74ee4907d2df8c3d94c7b24b1c3130f0aee62b6a0b86", size = 20551474, upload-time = "2025-12-06T14:18:37.936Z" }, + { url = "https://files.pythonhosted.org/packages/94/83/94c46b6f00fb9602cdb1c4f38f0226643f0151ba082544c516d866af84c8/uv-0.9.16-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:cd1a625a4cd13a45a667297c30cceb1393167c413ee3fb7ed46606a857abb4fd", size = 20704842, upload-time = "2025-12-06T14:19:20.861Z" }, + { url = "https://files.pythonhosted.org/packages/8e/0c/30fa6f16f31931d20db626f607783ada5e2f01d2307ee51fc477054b779b/uv-0.9.16-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:69b405c7de06a8290eae6b246397ad2a3bda8b52e3b8f445a8417d9f62d938e8", size = 21681575, upload-time = "2025-12-06T14:18:54.972Z" }, + { url = "https://files.pythonhosted.org/packages/3c/e6/6a6acdde5d7df54c65ea277fded6e480ff79ffc00d6c8c3404d0142ca5d5/uv-0.9.16-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:7e2ea8e2c8e77c6d3406a66155b07b445107085d240fe52e33d7f5180f356028", size = 23322212, upload-time = "2025-12-06T14:19:11.298Z" }, + { url = "https://files.pythonhosted.org/packages/1d/40/189099b44b9bd02d594dedafcd5da39f4d758e4690c504b624a61cb9eea8/uv-0.9.16-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f231876fa98247e8e009a91a5ea4c032e2f3315f141510259507f847f154254d", size = 22901411, upload-time = "2025-12-06T14:19:24.856Z" }, + { url = "https://files.pythonhosted.org/packages/a7/76/f09c9967648dc22c01d6cf8ce9eeb8b83fdf19c6f0a4090607be608dbcf9/uv-0.9.16-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:c43af679a125f41b2f0fe9801ec640e9971d6c24d9e3bea2eaea4d56f240d5ed", size = 21970469, upload-time = "2025-12-06T14:19:15.531Z" }, + { url = "https://files.pythonhosted.org/packages/d1/24/3d737f69753143bba3808d18a1ec7e972cf5d337fbe1dbad6223a3d8d88f/uv-0.9.16-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:13217422d30f5c70d37409dd5064d8dbc5a58c1cbaa29f081f43586195a50cc9", size = 22009128, upload-time = "2025-12-06T14:19:28.771Z" }, + { url = "https://files.pythonhosted.org/packages/c6/1a/261d30ac548290bf13c743101c4a08bc3c37f001d3a45b8d0684fe2d151a/uv-0.9.16-py3-none-manylinux_2_28_aarch64.whl", hash = "sha256:f06a6e172f34c70865784ff9108a1eabc5a99c97363d9ee587884b111bb220d2", size = 20698915, upload-time = "2025-12-06T14:19:40.497Z" }, + { url = "https://files.pythonhosted.org/packages/21/31/be1651da4398ee7d5064e712a80f0ad83dc47533531f78fb35ae237f1917/uv-0.9.16-py3-none-manylinux_2_31_riscv64.whl", hash = "sha256:307336087b53e0a1e6e1c7ec4633ca0bf11be786c692e23c3a343cac37b3e013", size = 21936423, upload-time = "2025-12-06T14:18:41.815Z" }, + { url = "https://files.pythonhosted.org/packages/81/2d/953ddab1cbef688ceb365b571249ce333e7bc8a70af894d1f85e969dc427/uv-0.9.16-py3-none-musllinux_1_1_armv7l.whl", hash = "sha256:0b1e32a5c4024b8628b2799d407ffa7aa913ca1554258e963a516936119baba1", size = 20656496, upload-time = "2025-12-06T14:19:44.2Z" }, + { url = "https://files.pythonhosted.org/packages/e8/9d/ef3ff37c6485a3d482c774da0cdb0cb7415a3e267af3b000978c10e0264b/uv-0.9.16-py3-none-musllinux_1_1_i686.whl", hash = "sha256:c21aa40106a902a531a3890d414dd3a418db4a17275f3a3829d08ddc1888bb2d", size = 21154195, upload-time = "2025-12-06T14:19:07.217Z" }, + { url = "https://files.pythonhosted.org/packages/b5/8b/645a28fa9ff93dfe037385a04e27b45cd7335173c7c6239d157b6a09d623/uv-0.9.16-py3-none-musllinux_1_1_x86_64.whl", hash = "sha256:0d012ef231699cad1eaf9ab1f5b076522970dcf87bfba3a684e66a02c6a1575d", size = 22207319, upload-time = "2025-12-06T14:18:59.521Z" }, + { url = "https://files.pythonhosted.org/packages/a7/7a/c4e8bc5b759d5da4fcabe0b1fc876f67913da4880d0cec34e9e6418ff93c/uv-0.9.16-py3-none-win32.whl", hash = "sha256:0229a4dfd0ff7e257bcd791f2d78cf1d682b01856d52d95602c56bb5ed97cc72", size = 19908839, upload-time = "2025-12-06T14:18:46.032Z" }, + { url = "https://files.pythonhosted.org/packages/3b/21/6ecf7db074235552d7b0be84c48d934e9916809d7dafb96d9a1019dd2ded/uv-0.9.16-py3-none-win_amd64.whl", hash = "sha256:e3e9a69a463607b9886afa34ce68dadf9a378eb6d191c878156fd8864e604c1e", size = 22033348, upload-time = "2025-12-06T14:19:48.091Z" }, + { url = "https://files.pythonhosted.org/packages/db/a1/4c44988817b72b17f09010983fd40b05f76ce54988fbdd707a8a33cfd498/uv-0.9.16-py3-none-win_arm64.whl", hash = "sha256:18d430980e7f4915a42854bc98a76f87f30da8859469a864fcf33e0a31fafdd1", size = 20396419, upload-time = "2025-12-06T14:19:32.586Z" }, +] + [[package]] name = "uvloop" version = "0.22.1"