mirror of
https://github.com/Akkudoktor-EOS/EOS.git
synced 2026-02-24 09:56:20 +00:00
fix: Adapt versioning scheme to Home Assistant and switch to uv (#896)
Some checks failed
Bump Version / Bump Version Workflow (push) Has been cancelled
docker-build / platform-excludes (push) Has been cancelled
docker-build / build (push) Has been cancelled
docker-build / merge (push) Has been cancelled
pre-commit / pre-commit (push) Has been cancelled
Run Pytest on Pull Request / test (push) Has been cancelled
Some checks failed
Bump Version / Bump Version Workflow (push) Has been cancelled
docker-build / platform-excludes (push) Has been cancelled
docker-build / build (push) Has been cancelled
docker-build / merge (push) Has been cancelled
pre-commit / pre-commit (push) Has been cancelled
Run Pytest on Pull Request / test (push) Has been cancelled
Home Assistant expects versioning always increases numbers. Add a date component to the development version to comply with this expectation. The scheme is now 0.0.0.dev<date><hash>. Use uv for creating and managing the virtual environment for developement. This enourmously speeds up dependency updates. For this change dependency requirements are now solely handled in pyproject.toml. requirements.tx and requirements-dev.txt are deleted. Signed-off-by: Bobby Noelte <b0661n0e17e@gmail.com>
This commit is contained in:
@@ -80,21 +80,15 @@ This is recommended for developers who want to modify the source code and test c
|
||||
|
||||
.. code-block:: powershell
|
||||
|
||||
python -m venv .venv
|
||||
.venv\Scripts\pip install --upgrade pip
|
||||
.venv\Scripts\pip install -r requirements-dev.txt
|
||||
.venv\Scripts\pip install build
|
||||
.venv\Scripts\pip install -e .
|
||||
uv run python scripts/get_version.py > version.txt
|
||||
uv sync --extra dev
|
||||
|
||||
.. tab:: Linux
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
python3 -m venv .venv
|
||||
.venv/bin/pip install --upgrade pip
|
||||
.venv/bin/pip install -r requirements-dev.txt
|
||||
.venv/bin/pip install build
|
||||
.venv/bin/pip install -e .
|
||||
uv run python scripts/get_version.py > version.txt
|
||||
uv sync --extra dev
|
||||
|
||||
.. tab:: Linux Make
|
||||
|
||||
@@ -103,25 +97,7 @@ This is recommended for developers who want to modify the source code and test c
|
||||
make install
|
||||
```
|
||||
|
||||
### Step 2.2 – Activate the Virtual Environment
|
||||
|
||||
```{eval-rst}
|
||||
.. tabs::
|
||||
|
||||
.. tab:: Windows
|
||||
|
||||
.. code-block:: powershell
|
||||
|
||||
.venv\Scripts\activate.bat
|
||||
|
||||
.. tab:: Linux
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
source .venv/bin/activate
|
||||
```
|
||||
|
||||
### Step 2.3 - Install pre-commit
|
||||
### Step 2.2 - Install pre-commit
|
||||
|
||||
Our code style and commit message checks use [`pre-commit`](https://pre-commit.com).
|
||||
|
||||
@@ -157,13 +133,13 @@ Make EOS accessible at [http://localhost:8503/docs](http://localhost:8503/docs)
|
||||
|
||||
.. code-block:: powershell
|
||||
|
||||
python -m akkudoktoreos.server.eos
|
||||
uv run python -m akkudoktoreos.server.eos
|
||||
|
||||
.. tab:: Linux
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
python -m akkudoktoreos.server.eos
|
||||
uv run python -m akkudoktoreos.server.eos
|
||||
|
||||
.. tab:: Linux Make
|
||||
|
||||
@@ -194,13 +170,13 @@ interfere with the EOS server trying to start EOSdash.
|
||||
|
||||
.. code-block:: powershell
|
||||
|
||||
python -m akkudoktoreos.server.eosdash --host localhost --port 8504 --log_level DEBUG --reload true
|
||||
uv run python -m akkudoktoreos.server.eosdash --host localhost --port 8504 --log_level DEBUG --reload true
|
||||
|
||||
.. tab:: Linux
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
python -m akkudoktoreos.server.eosdash --host localhost --port 8504 --log_level DEBUG --reload true
|
||||
uv run python -m akkudoktoreos.server.eosdash --host localhost --port 8504 --log_level DEBUG --reload true
|
||||
|
||||
.. tab:: Linux Make
|
||||
|
||||
@@ -216,13 +192,13 @@ interfere with the EOS server trying to start EOSdash.
|
||||
|
||||
.. code-block:: powershell
|
||||
|
||||
python -m akkudoktoreos.server.eos --host localhost --port 8503 --log_level DEBUG --startup_eosdash false --reload true
|
||||
uv run python -m akkudoktoreos.server.eos --host localhost --port 8503 --log_level DEBUG --startup_eosdash false --reload true
|
||||
|
||||
.. tab:: Linux
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
python -m akkudoktoreos.server.eos --host localhost --port 8503 --log_level DEBUG --startup_eosdash false --reload true
|
||||
uv run python -m akkudoktoreos.server.eos --host localhost --port 8503 --log_level DEBUG --startup_eosdash false --reload true
|
||||
|
||||
.. tab:: Linux Make
|
||||
|
||||
@@ -381,13 +357,13 @@ At a minimum, you should run the module tests:
|
||||
|
||||
.. code-block:: powershell
|
||||
|
||||
pytest -vs --cov src --cov-report term-missing
|
||||
uv run pytest -vs --cov src --cov-report term-missing
|
||||
|
||||
.. tab:: Linux
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
pytest -vs --cov src --cov-report term-missing
|
||||
uv run pytest -vs --cov src --cov-report term-missing
|
||||
|
||||
.. tab:: Linux Make
|
||||
|
||||
@@ -413,13 +389,13 @@ resources:
|
||||
|
||||
.. code-block:: powershell
|
||||
|
||||
pytest --system-test -vs --cov src --cov-report term-missing
|
||||
uv run pytest --system-test -vs --cov src --cov-report term-missing
|
||||
|
||||
.. tab:: Linux
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
pytest --system-test -vs --cov src --cov-report term-missing
|
||||
uv run pytest --system-test -vs --cov src --cov-report term-missing
|
||||
|
||||
.. tab:: Linux Make
|
||||
|
||||
@@ -437,13 +413,13 @@ To do profiling use:
|
||||
|
||||
.. code-block:: powershell
|
||||
|
||||
python tests/single_test_optimization.py --profile
|
||||
uv run python tests/single_test_optimization.py --profile
|
||||
|
||||
.. tab:: Linux
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
python tests/single_test_optimization.py --profile
|
||||
uv run python tests/single_test_optimization.py --profile
|
||||
|
||||
.. tab:: Linux Make
|
||||
|
||||
@@ -575,13 +551,13 @@ Ensure your changes do not break existing functionality:
|
||||
|
||||
.. code-block:: powershell
|
||||
|
||||
pytest -vs --cov src --cov-report term-missing
|
||||
uv run pytest -vs --cov src --cov-report term-missing
|
||||
|
||||
.. tab:: Linux
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
pytest -vs --cov src --cov-report term-missing
|
||||
uv run pytest -vs --cov src --cov-report term-missing
|
||||
|
||||
.. tab:: Linux Make
|
||||
|
||||
|
||||
@@ -25,8 +25,8 @@ Before installing, ensure you have the following:
|
||||
|
||||
### For Source / Release Installation (M1/M2)
|
||||
|
||||
- Python 3.10 or higher
|
||||
- pip
|
||||
- Python 3.11+
|
||||
- uv (recommended)
|
||||
- Git (only for source)
|
||||
- Tar/Zip (for release package)
|
||||
|
||||
@@ -52,6 +52,24 @@ Akkudoktor-EOS is a [Home Assistant add-on](https://www.home-assistant.io/addons
|
||||
have access to add-ons.
|
||||
:::
|
||||
|
||||
## Install uv (one-time setup)
|
||||
|
||||
```{eval-rst}
|
||||
.. tabs::
|
||||
|
||||
.. tab:: Windows
|
||||
|
||||
.. code-block:: powershell
|
||||
|
||||
irm https://astral.sh/uv/install.ps1 | iex
|
||||
|
||||
.. tab:: Linux
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
curl -LsSf https://astral.sh/uv/install.sh | sh
|
||||
```
|
||||
|
||||
## Installation from Source (GitHub) (M1)
|
||||
|
||||
Recommended for developers or users wanting the latest updates.
|
||||
@@ -85,17 +103,13 @@ Recommended for developers or users wanting the latest updates.
|
||||
|
||||
.. code-block:: powershell
|
||||
|
||||
python -m venv .venv
|
||||
.venv\Scripts\pip install -r requirements.txt
|
||||
.venv\Scripts\pip install -e .
|
||||
uv sync --extra dev
|
||||
|
||||
.. tab:: Linux
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
python -m venv .venv
|
||||
.venv/bin/pip install -r requirements.txt
|
||||
.venv/bin/pip install -e .
|
||||
uv sync --extra dev
|
||||
|
||||
```
|
||||
|
||||
@@ -108,13 +122,13 @@ Recommended for developers or users wanting the latest updates.
|
||||
|
||||
.. code-block:: powershell
|
||||
|
||||
.venv\Scripts\python -m akkudoktoreos.server.eos
|
||||
uv run python -m akkudoktoreos.server.eos
|
||||
|
||||
.. tab:: Linux
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
.venv/bin/python -m akkudoktoreos.server.eos
|
||||
uv run python -m akkudoktoreos.server.eos
|
||||
|
||||
```
|
||||
|
||||
@@ -134,13 +148,13 @@ stage of the installation provide appropriate IP addresses on startup.
|
||||
|
||||
.. code-block:: powershell
|
||||
|
||||
.venv\Scripts\python -m akkudoktoreos.server.eos --host 0.0.0.0 --eosdash-host 0.0.0.0
|
||||
uv run python -m akkudoktoreos.server.eos --host 0.0.0.0 --eosdash-host 0.0.0.0
|
||||
|
||||
.. tab:: Linux
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
.venv/bin/python -m akkudoktoreos.server.eos --host 0.0.0.0 --eosdash-host 0.0.0.0
|
||||
uv run python -m akkudoktoreos.server.eos --host 0.0.0.0 --eosdash-host 0.0.0.0
|
||||
|
||||
```
|
||||
<!-- pyml enable line-length -->
|
||||
|
||||
@@ -51,7 +51,7 @@ git checkout v0.1.0
|
||||
Then reinstall dependencies:
|
||||
|
||||
```bash
|
||||
.venv/bin/pip install -r requirements.txt --upgrade
|
||||
uv sync
|
||||
```
|
||||
|
||||
#### Release package (M2)
|
||||
@@ -62,7 +62,7 @@ Refer to **Method 2** in the [Installation Guideline](install-page).
|
||||
### 3) Restart EOS (M1/M2)
|
||||
|
||||
```bash
|
||||
.venv/bin/python -m akkudoktoreos.server.eos
|
||||
uv run python -m akkudoktoreos.server.eos
|
||||
```
|
||||
|
||||
### 4) Restore configuration (optional) (M1/M2)
|
||||
|
||||
Reference in New Issue
Block a user