@@ -6,8 +6,8 @@ This guide will help you set up your development environment for contributing to
6
6
7
7
Before you begin, ensure you have the following installed on your system:
8
8
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
11
11
- Git for version control
12
12
13
13
## Setting Up the Development Environment
@@ -18,50 +18,55 @@ Before you begin, ensure you have the following installed on your system:
18
18
cd signalrgb-python
19
19
```
20
20
21
- 2 . Install the project dependencies using Poetry :
21
+ 2 . Install the project dependencies using UV :
22
22
``` bash
23
- poetry install
23
+ uv sync --groups dev
24
24
```
25
25
26
- 3 . Activate the virtual environment:
26
+ 3 . To run commands in the development environment:
27
27
``` 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
29
34
```
30
35
31
36
## Running Tests
32
37
33
38
We use pytest for our test suite. To run the tests:
34
39
35
40
``` bash
36
- poetry run pytest
41
+ uv run pytest
37
42
```
38
43
39
44
To run tests with coverage report:
40
45
41
46
``` bash
42
- poetry run pytest --cov=signalrgb --cov-report=term-missing
47
+ uv run pytest --cov=signalrgb --cov-report=term-missing
43
48
```
44
49
45
50
## Linting
46
51
47
52
We use Ruff for linting and formatting. To run the linter:
48
53
49
54
``` bash
50
- poetry run ruff check .
55
+ uv run ruff check .
51
56
```
52
57
53
58
To automatically fix linting issues:
54
59
55
60
``` bash
56
- poetry run ruff check --fix .
61
+ uv run ruff check --fix .
57
62
```
58
63
59
64
## Type Checking
60
65
61
66
We use mypy for static type checking. To run the type checker:
62
67
63
68
``` bash
64
- poetry run mypy signalrgb
69
+ uv run mypy signalrgb
65
70
```
66
71
67
72
## Pre-commit Hooks
@@ -70,12 +75,12 @@ We use pre-commit hooks to ensure code quality before committing. To set up pre-
70
75
71
76
1 . Install pre-commit:
72
77
``` bash
73
- poetry run pre-commit install
78
+ uv run pre-commit install
74
79
```
75
80
76
81
2 . Run pre-commit on all files:
77
82
``` bash
78
- poetry run pre-commit run --all-files
83
+ uv run pre-commit run --all-files
79
84
```
80
85
81
86
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`.
84
89
85
90
To build the documentation locally:
86
91
87
- 1 . Install the documentation dependencies:
92
+ 1 . Make sure you've installed the development dependencies:
88
93
``` bash
89
- poetry add mkdocs mkdocs-material mkdocstrings[python]
94
+ uv sync --groups dev
90
95
```
91
96
92
97
2 . Build and serve the documentation:
93
98
``` bash
94
- poetry run mkdocs serve
99
+ uv run mkdocs serve
95
100
```
96
101
97
102
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:
100
105
101
106
1 . Update the version number in ` pyproject.toml ` :
102
107
``` bash
103
- poetry version patch # or minor, or major
108
+ # Edit manually or use a version update script
104
109
```
105
110
106
111
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
127
132
128
133
If you encounter any issues during development, please check the following:
129
134
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 `
134
138
135
139
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.
136
140
0 commit comments