Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate poetry to uv #350

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
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
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ We're very happy about contributions to aiomqtt! 🎉

## Development setup

- Clone the aiomqtt repository
- Install the Python version noted in `.python-version` via `pyenv`
- Install poetry; Then run `./scripts/setup` to install the dependencies and aiomqtt itself
- Clone the repository
- [Install uv](https://docs.astral.sh/uv/getting-started/installation/)
- Then run `./scripts/setup` to install the dependencies and aiomqtt itself
- Run ruff and mypy with `./scripts/check`
- Run the tests with `./scripts/test`

Expand Down
1,084 changes: 0 additions & 1,084 deletions poetry.lock

This file was deleted.

3 changes: 0 additions & 3 deletions poetry.toml

This file was deleted.

79 changes: 35 additions & 44 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
[tool.poetry]
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[project]
name = "aiomqtt"
version = "0.0.0" # Placeholder: Managed by poetry-dynamic-versioning
description = "The idiomatic asyncio MQTT client, wrapped around paho-mqtt"
license = "BSD-3-Clause"
version = "0.0.0"
description = "The idiomatic asyncio MQTT client"
authors = [
"Frederik Aalund <[email protected]>",
"Felix Böhm <[email protected]>",
"Jonathan Plasse <[email protected]>",
{ name = "Frederik Aalund", email = "[email protected]" },
{ name = "Felix Böhm", email = "[email protected]" },
{ name = "Jonathan Plasse", email = "[email protected]" },
]
readme = "README.md"
packages = [{ include = "aiomqtt" }]
repository = "https://github.com/empicano/aiomqtt"
documentation = "https://aiomqtt.bo3hm.com"
keywords = [
"mqtt",
"iot",
Expand All @@ -21,44 +21,35 @@ keywords = [
"mqttv5",
]
classifiers = [
"Development Status :: 3 - Alpha",
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Operating System :: OS Independent",
"License :: OSI Approved :: BSD License",
]
requires-python = ">=3.8,<4.0"
dependencies = [
"paho-mqtt>=2.1.0,<3.0.0",
"typing-extensions>=4.4.0,<5.0.0; python_version < \"3.10\"",
]

[tool.poetry.urls]
"Issue tracker" = "https://github.com/empicano/aiomqtt/issues"

[tool.poetry.dependencies]
python = "^3.8"
paho-mqtt = "^2.1.0"
typing-extensions = { version = "^4.4.0", markers = "python_version < '3.10'" }

[tool.poetry.group.dev]
optional = true

[tool.poetry.group.dev.dependencies]
mypy = "^1.10.0"
ruff = "^0.4.8"
pytest = "^7.3.1"
pytest-cov = "^4.0.0"
anyio = "^3.6.2"
furo = "^2023.3.27"
sphinx-autobuild = "^2021.3.14"
myst-parser = "^1.0.0"
sphinx-copybutton = "^0.5.2"
sphinx = "^5.3"

[tool.poetry-dynamic-versioning]
enable = true
vcs = "git"
style = "pep440"
strict = true
metadata = false

[build-system]
requires = ["poetry-core>=1.0.0", "poetry-dynamic-versioning>=1.0.0"]
build-backend = "poetry_dynamic_versioning.backend"
[project.urls]
source = "https://github.com/empicano/aiomqtt"
documentation = "https://aiomqtt.bo3hm.com"
issues = "https://github.com/empicano/aiomqtt/issues"

[dependency-groups]
dev = [
"mypy>=1.10.0,<2.0.0",
"ruff>=0.4.8,<0.5.0",
"pytest>=7.3.1,<8.0.0",
"pytest-cov>=4.0.0,<5.0.0",
"anyio>=3.6.2,<4.0.0",
"furo>=2023.3.27,<2024.0.0",
"sphinx-autobuild>=2021.3.14,<2022.0.0",
"myst-parser>=1.0.0,<2.0.0",
"sphinx-copybutton>=0.5.2,<0.6.0",
"sphinx>=5.3,<6.0",
]

[tool.ruff]
target-version = "py38"
Expand Down
10 changes: 5 additions & 5 deletions scripts/check
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ done

# Run checks
if [ "${dry}" = true ]; then
poetry run ruff check aiomqtt tests
poetry run ruff format --check --diff aiomqtt tests
uv run ruff check aiomqtt tests
uv run ruff format --check --diff aiomqtt tests
else
poetry run ruff check --fix aiomqtt tests
poetry run ruff format aiomqtt tests
uv run ruff check --fix aiomqtt tests
uv run ruff format aiomqtt tests
fi
poetry run mypy aiomqtt tests --junit-xml="reports/mypy.xml"
uv run mypy aiomqtt tests --junit-xml="reports/mypy.xml"
4 changes: 2 additions & 2 deletions scripts/docs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ done

# Serve the documentation
if [ "${reload}" = true ]; then
poetry run sphinx-autobuild --open-browser --delay 0 --port 8145 docs docs/_build
uv run sphinx-autobuild --open-browser --delay 0 --port 8145 docs docs/_build
else
poetry run sphinx-build -b html docs docs/_build
uv run sphinx-build -b html docs docs/_build
fi
2 changes: 1 addition & 1 deletion scripts/setup
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ set -o errexit -o pipefail -o nounset
cd "$(dirname "$0")/.."

# Install the dependencies and the local version of aiomqtt
poetry install --with dev --sync
uv sync
2 changes: 1 addition & 1 deletion scripts/test
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ set -o errexit -o pipefail -o nounset
cd "$(dirname "$0")/.."

# Run tests with pytest
poetry run pytest --failed-first --verbosity=2 --cov=aiomqtt --cov-report=term-missing --cov-report=xml --junitxml=reports/pytest.xml --strict-config --strict-markers tests
uv run pytest --failed-first --verbosity=2 --cov=aiomqtt --cov-report=term-missing --cov-report=xml --junitxml=reports/pytest.xml --strict-config --strict-markers tests
Loading