Skip to content

Commit

Permalink
poetry -> uv
Browse files Browse the repository at this point in the history
  • Loading branch information
newAM committed Jan 14, 2025
1 parent 3ef6220 commit 0ce6e62
Show file tree
Hide file tree
Showing 6 changed files with 1,262 additions and 66 deletions.
53 changes: 19 additions & 34 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,31 +16,26 @@ jobs:
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v4
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
- uses: astral-sh/setup-uv@v5
with:
python-version: ${{ matrix.python-version }}
- uses: abatilo/[email protected]
- run: poetry install
- run: poetry run ruff check
- run: poetry run ruff format --check
- run: poetry run mypy idasen tests
- run: uv sync --all-extras --dev
- run: uv run ruff check
- run: uv run ruff format --check
- run: uv run mypy idasen tests

docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- uses: abatilo/[email protected]
- uses: astral-sh/setup-uv@v5
- run: uv sync --all-extras --dev
- name: Install bluetooth
run: |
sudo apt update
sudo apt install bluetooth
- run: poetry install
- name: Run sphinx
run: poetry run sphinx-build -W -b html docs public
run: uv run sphinx-build -W -b html docs public
- uses: actions/upload-pages-artifact@v3
with:
path: public
Expand All @@ -66,20 +61,18 @@ jobs:
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v4
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
- uses: astral-sh/setup-uv@v5
with:
python-version: ${{ matrix.python-version }}
- uses: abatilo/[email protected]
- run: uv sync --all-extras --dev
- name: Install bluetooth
run: |
sudo apt update
sudo apt install bluetooth
- run: poetry install
- name: Run pytest
run: poetry run pytest -vvv --cov=idasen --doctest-modules
run: uv run pytest -vvv --cov=idasen --doctest-modules
- name: Upload coverage data to coveralls.io
run: poetry run coveralls --service=github
run: uv run coveralls --service=github
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_FLAG_NAME: py${{ matrix.python-version }}
Expand All @@ -91,14 +84,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install Poetry
uses: abatilo/[email protected]
- run: poetry install
- uses: astral-sh/setup-uv@v5
- run: uv sync --all-extras --dev
- name: Finished
run: poetry run coveralls --finish --service=github
run: uv run coveralls --finish --service=github
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand All @@ -109,12 +98,8 @@ jobs:
needs: [pytest, docs, style]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install Poetry
uses: abatilo/[email protected]
- run: poetry install
- run: poetry publish --build
- uses: astral-sh/setup-uv@v5
- run: uv sync --all-extras --dev
- run: uv publish
env:
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }}
UV_PUBLISH_TOKEN: ${{ secrets.PYPI_TOKEN }}
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
### Changed
- Changed the build system from poetry to uv.

### Removed
- Removed support for end-of-life python version 3.8.

Expand Down
3 changes: 1 addition & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,7 @@ Related projects and packaging:
* `huserben/idasen-rest-bridge`_
* Repository this was forked from: `rhyst/idasen-controller`_

.. _poetry: https://python-poetry.org/
.. _install poetry: https://python-poetry.org/docs/#installation

.. _rhyst/idasen-controller: https://github.com/rhyst/idasen-controller
.. _NixOS package: https://search.nixos.org/packages?channel=unstable&show=idasen&query=idasen
.. _Arch Linux package: https://aur.archlinux.org/packages/idasen
Expand Down
14 changes: 7 additions & 7 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import inspect
import os
import sys
import toml
import tomllib

this_dir = os.path.dirname(os.path.abspath(__file__))
repo_root = os.path.abspath(os.path.join(this_dir, ".."))
Expand All @@ -46,18 +46,18 @@
source_suffix = ".rst"

with open(os.path.join(repo_root, "pyproject.toml"), "r") as f:
pyproject = toml.load(f)
pyproject = tomllib.load(f)

# The master toctree document.
master_doc = "index"

# General information about the project.
project = pyproject["tool"]["poetry"]["name"]
project = pyproject["project"]["name"]
year = datetime.datetime.now().year
author = pyproject["tool"]["poetry"]["authors"][0].split("<", 1)[0].rstrip()
author = pyproject["project"]["authors"][0]["name"]
copyright = f"{year}, {author}"
version = pyproject["tool"]["poetry"]["version"]
release = pyproject["tool"]["poetry"]["version"]
version = pyproject["project"]["version"]
release = pyproject["project"]["version"]
language = "en"
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store", ".tox"]
pygments_style = "sphinx"
Expand All @@ -67,7 +67,7 @@

# HTML Options
html_theme = "sphinx_rtd_theme"
htmlhelp_basename = pyproject["tool"]["poetry"]["name"]
htmlhelp_basename = pyproject["project"]["name"]
github_user = "newAM"
html_context = {
"display_github": True,
Expand Down
40 changes: 17 additions & 23 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ license = "MIT"
readme = "README.rst"
keywords = ["ikea", "idasen", "bluetooth", "linak", "ble"]
requires-python = ">= 3.9"
dependencies = [
"bleak>=0.15",
"pyyaml>=5.3.1",
"voluptuous>=0.12",
]

[project.urls]
Repository = "https://github.com/newAM/idasen"
Expand All @@ -17,29 +22,18 @@ Issues = "https://github.com/newAM/idasen/issues"
[project.scripts]
idasen = "idasen.cli:main"


[tool.poetry.dependencies]
python = "^3.9"

bleak = ">=0.15"
pyyaml = ">=5.3.1"
voluptuous = ">=0.12"

[tool.poetry.dev-dependencies]
coveralls = "^3"
mypy = "^1.14"
pytest = "^8.3.4"
pytest-asyncio = "^0.24"
pytest-cov = "^5.0.0"
ruff = "^0.9.1"
sphinx = "^7.1.2"
sphinx-rtd-theme = "^3.0.2"
toml = "^0.10.2"
types-PyYAML = "^6.0.12"

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
[dependency-groups]
dev = [
"coveralls>=4.0.1",
"mypy>=1.14.1",
"pytest>=8.3.4",
"pytest-asyncio>=0.25.2",
"pytest-cov>=6.0.0",
"ruff>=0.9.1",
"sphinx>=7.4.7",
"sphinx-rtd-theme>=3.0.2",
"types-pyyaml>=6.0.12.20241230",
]

[tool.pytest.ini_options]
asyncio_mode = "auto"
Expand Down
Loading

0 comments on commit 0ce6e62

Please sign in to comment.