Skip to content

Commit 92f4675

Browse files
committed
🔧 Migrate from Poetry to UV for dependency management
Switch from Poetry to UV for faster, more reliable dependency handling - Update pyproject.toml to use standard PEP 621 format instead of Poetry - Modify dependency management in docs to reference UV instead of Poetry - Lower Python requirement from 3.12 to 3.9 for broader compatibility - Update release script to work with UV instead of Poetry commands - Add uv.lock file for dependency tracking - Adjust development documentation with UV-specific commands
1 parent 1ba6b53 commit 92f4675

File tree

6 files changed

+1479
-72
lines changed

6 files changed

+1479
-72
lines changed

‎.github/workflows/ci-cd.yml

Lines changed: 25 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,18 @@ jobs:
1717
uses: actions/setup-python@v4
1818
with:
1919
python-version: '3.12'
20+
- name: Set up uv
21+
uses: astral-sh/setup-uv@v5
22+
with:
23+
version: "0.6.3"
2024
- name: Install dependencies
25+
run: uv sync
26+
- name: Run lint checks
2127
run: |
22-
pip install poetry
23-
poetry install
28+
uv run ruff check .
29+
uv run mypy signalrgb
2430
- name: Run tests
25-
run: poetry run pytest
31+
run: uv run pytest
2632
- name: Upload test results
2733
uses: actions/upload-artifact@v3
2834
with:
@@ -38,13 +44,15 @@ jobs:
3844
uses: actions/setup-python@v4
3945
with:
4046
python-version: '3.12'
47+
- name: Set up uv
48+
uses: astral-sh/setup-uv@v5
49+
with:
50+
version: "0.6.3"
4151
- name: Install dependencies
4252
run: |
43-
pip install poetry
44-
poetry install
45-
poetry add mkdocs mkdocs-material mkdocstrings[python]
53+
uv sync --groups dev
4654
- name: Build documentation
47-
run: poetry run mkdocs build
55+
run: uv run mkdocs build
4856
- name: Upload documentation
4957
uses: actions/upload-artifact@v3
5058
with:
@@ -94,15 +102,18 @@ jobs:
94102
uses: actions/setup-python@v4
95103
with:
96104
python-version: '3.12'
105+
- name: Set up uv
106+
uses: astral-sh/setup-uv@v5
107+
with:
108+
version: "0.6.3"
97109
- name: Install dependencies
98110
run: |
99-
pip install poetry
100-
poetry install
111+
uv sync --groups dev
112+
uv pip install build twine
101113
- name: Build package
102-
run: poetry build
114+
run: uv run python -m build
103115
- name: Publish to PyPI
104116
env:
105-
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
106-
run: |
107-
poetry config pypi-token.pypi $PYPI_TOKEN
108-
poetry publish
117+
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
118+
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
119+
run: uv run twine upload dist/*

‎docs/development.md

Lines changed: 25 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ This guide will help you set up your development environment for contributing to
66

77
Before you begin, ensure you have the following installed on your system:
88

9-
- Python 3.12 or higher
10-
- [Poetry](https://python-poetry.org/docs/#installation) for dependency management
9+
- Python 3.9 or higher
10+
- [UV](https://github.com/astral-sh/uv) for dependency management
1111
- Git for version control
1212

1313
## Setting Up the Development Environment
@@ -18,50 +18,55 @@ Before you begin, ensure you have the following installed on your system:
1818
cd signalrgb-python
1919
```
2020

21-
2. Install the project dependencies using Poetry:
21+
2. Install the project dependencies using UV:
2222
```bash
23-
poetry install
23+
uv sync --groups dev
2424
```
2525

26-
3. Activate the virtual environment:
26+
3. To run commands in the development environment:
2727
```bash
28-
poetry shell
28+
uv run [command]
29+
```
30+
31+
For example, to run a Python script:
32+
```bash
33+
uv run python scripts/some_script.py
2934
```
3035

3136
## Running Tests
3237

3338
We use pytest for our test suite. To run the tests:
3439

3540
```bash
36-
poetry run pytest
41+
uv run pytest
3742
```
3843

3944
To run tests with coverage report:
4045

4146
```bash
42-
poetry run pytest --cov=signalrgb --cov-report=term-missing
47+
uv run pytest --cov=signalrgb --cov-report=term-missing
4348
```
4449

4550
## Linting
4651

4752
We use Ruff for linting and formatting. To run the linter:
4853

4954
```bash
50-
poetry run ruff check .
55+
uv run ruff check .
5156
```
5257

5358
To automatically fix linting issues:
5459

5560
```bash
56-
poetry run ruff check --fix .
61+
uv run ruff check --fix .
5762
```
5863

5964
## Type Checking
6065

6166
We use mypy for static type checking. To run the type checker:
6267

6368
```bash
64-
poetry run mypy signalrgb
69+
uv run mypy signalrgb
6570
```
6671

6772
## Pre-commit Hooks
@@ -70,12 +75,12 @@ We use pre-commit hooks to ensure code quality before committing. To set up pre-
7075

7176
1. Install pre-commit:
7277
```bash
73-
poetry run pre-commit install
78+
uv run pre-commit install
7479
```
7580

7681
2. Run pre-commit on all files:
7782
```bash
78-
poetry run pre-commit run --all-files
83+
uv run pre-commit run --all-files
7984
```
8085

8186
The pre-commit hooks will now run automatically on `git commit`.
@@ -84,14 +89,14 @@ The pre-commit hooks will now run automatically on `git commit`.
8489

8590
To build the documentation locally:
8691

87-
1. Install the documentation dependencies:
92+
1. Make sure you've installed the development dependencies:
8893
```bash
89-
poetry add mkdocs mkdocs-material mkdocstrings[python]
94+
uv sync --groups dev
9095
```
9196

9297
2. Build and serve the documentation:
9398
```bash
94-
poetry run mkdocs serve
99+
uv run mkdocs serve
95100
```
96101

97102
3. Open your browser and navigate to `http://127.0.0.1:8000/` to view the documentation.
@@ -100,7 +105,7 @@ To build the documentation locally:
100105

101106
1. Update the version number in `pyproject.toml`:
102107
```bash
103-
poetry version patch # or minor, or major
108+
# Edit manually or use a version update script
104109
```
105110

106111
2. Update the `CHANGELOG.md` file with the changes for the new version.
@@ -127,10 +132,9 @@ The CI/CD pipeline will handle the rest, including building and publishing the p
127132

128133
If you encounter any issues during development, please check the following:
129134

130-
1. Ensure you're using the correct version of Python (3.12+).
131-
2. Make sure all dependencies are up to date (`poetry update`).
132-
3. Check that your virtual environment is activated (`poetry shell`).
133-
4. Clear any cached files: `find . -name '*.pyc' -delete` and `find . -name '__pycache__' -type d -delete`
135+
1. Ensure you're using the correct version of Python (3.9+).
136+
2. Make sure all dependencies are up to date (`uv sync`).
137+
3. Clear any cached files: `find . -name '*.pyc' -delete` and `find . -name '__pycache__' -type d -delete`
134138

135139
If you're still having problems, please open an issue on the GitHub repository with a detailed description of the problem and steps to reproduce it.
136140

‎docs/installation.md

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
Before installing signalrgb-python, ensure you have the following:
66

7-
- Python 3.12 or higher
7+
- Python 3.9 or higher
88
- [SignalRGB Pro](https://www.signalrgb.com/pro/) (required for API access)
99

1010
This library uses the [SignalRGB REST API](https://docs.signalrgb.com/signalrgb-api), which is only available in SignalRGB Pro.
@@ -17,12 +17,29 @@ The easiest way to install signalrgb-python is using pip:
1717
pip install signalrgb
1818
```
1919

20-
## Installing with Poetry
20+
## Installing with UV
2121

22-
If you prefer to use Poetry for dependency management:
22+
For faster, more reliable dependency resolution, you can use [UV](https://github.com/astral-sh/uv) to install signalrgb-python:
2323

2424
```bash
25-
poetry add signalrgb
25+
# Install UV if you don't have it already
26+
pip install uv
27+
28+
# Install signalrgb using UV
29+
uv pip install signalrgb
30+
```
31+
32+
## Development Installation
33+
34+
If you're working on signalrgb-python development, you can install it with development dependencies:
35+
36+
```bash
37+
# Clone the repository
38+
git clone https://github.com/hyperb1iss/signalrgb-python.git
39+
cd signalrgb-python
40+
41+
# Using UV
42+
uv sync --groups dev
2643
```
2744

2845
## Verifying the Installation

0 commit comments

Comments
 (0)