Skip to content

Commit 025badb

Browse files
committed
move to uv
1 parent 4e70cdf commit 025badb

10 files changed

Lines changed: 86 additions & 2851 deletions

File tree

.github/workflows/python-publish.yml

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,12 @@ jobs:
1616
uses: actions/setup-python@v2
1717
with:
1818
python-version: "3.13"
19+
- name: Install uv
20+
uses: astral-sh/setup-uv@v4
1921
- name: Install dependencies
20-
run: |
21-
python -m pip install --upgrade pip poetry
22-
poetry config virtualenvs.create false
23-
poetry install
24-
25-
- name: build release distributions
26-
run: |
27-
# NOTE: put your own distribution build steps here.
28-
poetry build
22+
run: uv sync
23+
- name: Build release distributions
24+
run: uv build
2925

3026
- name: upload dists
3127
uses: actions/upload-artifact@v4
@@ -48,4 +44,4 @@ jobs:
4844
path: dist/
4945

5046
- name: Publish release distributions to PyPI
51-
uses: pypa/gh-action-pypi-publish@release/v1
47+
uses: pypa/gh-action-pypi-publish@release/v1

.github/workflows/test-suite.yml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,13 @@ on:
44
paths:
55
- "**.py"
66
- "pyproject.toml"
7-
- "poetry.lock"
87
pull_request:
98
branches:
109
- master
1110
- dev
1211
paths:
1312
- "**.py"
1413
- "pyproject.toml"
15-
- "poetry.lock"
1614
workflow_dispatch:
1715

1816
jobs:
@@ -28,16 +26,16 @@ jobs:
2826
uses: actions/checkout@v3
2927
with:
3028
ref: ${{ github.event.pull_request.head.sha }}
29+
- name: Install uv
30+
uses: astral-sh/setup-uv@v4
3131
- name: Install Dependencies
32-
run: |
33-
pip install poetry
34-
poetry install --with styling
32+
run: uv sync --group styling
3533
- name: Run Ruff format
36-
run: poetry run ruff format homeassistant_api
34+
run: uv run ruff format homeassistant_api
3735
- name: Run Ruff linting
38-
run: poetry run ruff check homeassistant_api
36+
run: uv run ruff check homeassistant_api
3937
- name: Run MyPy
40-
run: poetry run mypy homeassistant_api --show-error-codes
38+
run: uv run mypy homeassistant_api --show-error-codes
4139

4240
code_functionality:
4341
name: "Code Functionality"

.readthedocs.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,9 @@ build:
66
tools:
77
python: "3.10"
88
jobs:
9-
pre_create_environment:
10-
- asdf plugin add poetry
11-
- asdf install poetry 1.8.3
12-
- asdf global poetry 1.8.3
13-
- poetry export -f requirements.txt --output requirements.txt --with docs
149
post_install:
15-
- pip install -r requirements.txt
10+
- pip install uv
11+
- uv export --group docs --no-hashes | uv pip install --system -r -
1612

1713
# Build documentation in the docs/ directory with Sphinx
1814
sphinx:

Dockerfile

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,12 @@
1-
ARG BUILD_FROM
2-
3-
FROM ${BUILD_FROM} AS base
1+
FROM ghcr.io/astral-sh/uv:python3.13-bookworm AS base
42
ENV PYTHONPATH=.
53
WORKDIR /app
64
COPY ./ /app/
75

86
FROM base AS dependencies
9-
RUN pip install --upgrade pip wheel
10-
RUN pip install poetry
11-
RUN python3 -m venv .venv && \
12-
. .venv/bin/activate && \
13-
poetry install --with testing && \
14-
deactivate
7+
RUN uv sync --group testing
158

169
FROM base AS final
1710
COPY --from=dependencies /app/.venv /app/.venv
1811

19-
ENTRYPOINT [ "sh", "entrypoint.sh" ]
20-
12+
ENTRYPOINT [ "sh", "entrypoint.sh" ]

compose.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ services:
88
tests:
99
build:
1010
context: .
11-
args:
12-
BUILD_FROM: "python:3.13"
1311
image: homeassistant-tests:latest
1412
volumes:
1513
- ./volumes/coverage:/app/coverage:rw

docs/CONTRIBUTING.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,12 @@ Next run in your terminal.
3737
Step Three: Installing Dependencies
3838
======================================
3939

40-
Firstly, you need to have Python 3.7 or newer with Pip installed.
40+
Firstly, you need to have Python 3.9 or newer installed.
4141
Download the latest Python Version from `here <https://www.python.org/>`__.
42-
Then you need to install the very popular Python Package Manager, :code:`poetry`.
43-
Checkout the `Poetry Docs <https://python-poetry.org/docs/>`__.
44-
You can install that with :code:`pip` by running :code:`pip install poetry`.
45-
Now you can install the project's dependencies by running :code:`cd HomeAssistantAPI && poetry install`
42+
Then you need to install :code:`uv`, a fast Python package manager.
43+
Checkout the `uv Docs <https://docs.astral.sh/uv/>`__.
44+
You can install it with :code:`pip` by running :code:`pip install uv`, or see the uv docs for other installation methods.
45+
Now you can install the project's dependencies by running :code:`cd HomeAssistantAPI && uv sync`
4646

4747
Step Four: [Optional] Setting Up a Home Assistant Development Environment.
4848
=============================================================================

docs/quickstart.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,28 +55,28 @@ Installation with pip is really easy and will install the dependencies this proj
5555
# To install the latest stable version from PyPI
5656
$ pip install homeassistant_api
5757
58-
# To install the latest dev version (you'll need to use poetry because pip, by itself, does not understand poetry dependencies.)
59-
$ poetry add git+https://github.com/GrandMoff100/HomeassistantAPI
58+
# To install the latest dev version
59+
$ pip install git+https://github.com/GrandMoff100/HomeassistantAPI
6060
6161
6262
Installing with :code:`git`
6363
----------------------------------
6464

65-
To install with git we're going to clone the repository and then run :code:`$ poetry install` like so.
65+
To install with git we're going to clone the repository and then run :code:`$ uv sync` like so.
6666

6767
.. code-block:: bash
6868
6969
# Clone with git
7070
git clone https://github.com/GrandMoff100/HomeassistantAPI
7171
7272
# CD into your project
73-
cd <path/to/my/awesome/homeassistant/project>
73+
cd HomeAssistantAPI
7474
75-
# Install poetry
76-
python -m pip install poetry
75+
# Install uv (see https://docs.astral.sh/uv/ for other methods)
76+
python -m pip install uv
7777
78-
# Run poetry install
79-
python -m poetry install ~/HomeAssistantAPI
78+
# Install dependencies
79+
uv sync
8080
8181
8282
Then you should be all set to start using the library!

0 commit comments

Comments
 (0)