mirror of
https://github.com/Akkudoktor-EOS/EOS.git
synced 2026-02-24 01:46:21 +00:00
fix: Adapt versioning scheme to Home Assistant and switch to uv (#896)
Some checks are pending
Bump Version / Bump Version Workflow (push) Waiting to run
docker-build / platform-excludes (push) Waiting to run
docker-build / build (push) Blocked by required conditions
docker-build / merge (push) Blocked by required conditions
pre-commit / pre-commit (push) Waiting to run
Run Pytest on Pull Request / test (push) Waiting to run
Some checks are pending
Bump Version / Bump Version Workflow (push) Waiting to run
docker-build / platform-excludes (push) Waiting to run
docker-build / build (push) Blocked by required conditions
docker-build / merge (push) Blocked by required conditions
pre-commit / pre-commit (push) Waiting to run
Run Pytest on Pull Request / test (push) Waiting to run
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:
@@ -120,7 +120,7 @@
|
||||
}
|
||||
},
|
||||
"general": {
|
||||
"version": "0.2.0.dev58204789",
|
||||
"version": "0.2.0.dev2602231150315077",
|
||||
"data_folder_path": "/home/user/.local/share/net.akkudoktoreos.net",
|
||||
"data_output_subpath": "output",
|
||||
"latitude": 52.52,
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
| latitude | `EOS_GENERAL__LATITUDE` | `Optional[float]` | `rw` | `52.52` | Latitude in decimal degrees between -90 and 90. North is positive (ISO 19115) (°) |
|
||||
| longitude | `EOS_GENERAL__LONGITUDE` | `Optional[float]` | `rw` | `13.405` | Longitude in decimal degrees within -180 to 180 (°) |
|
||||
| timezone | | `Optional[str]` | `ro` | `N/A` | Computed timezone based on latitude and longitude. |
|
||||
| version | `EOS_GENERAL__VERSION` | `str` | `rw` | `0.2.0.dev58204789` | Configuration file version. Used to check compatibility. |
|
||||
| version | `EOS_GENERAL__VERSION` | `str` | `rw` | `0.2.0.dev2602231150315077` | Configuration file version. Used to check compatibility. |
|
||||
:::
|
||||
<!-- pyml enable line-length -->
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
```json
|
||||
{
|
||||
"general": {
|
||||
"version": "0.2.0.dev58204789",
|
||||
"version": "0.2.0.dev2602231150315077",
|
||||
"data_folder_path": "/home/user/.local/share/net.akkudoktoreos.net",
|
||||
"data_output_subpath": "output",
|
||||
"latitude": 52.52,
|
||||
@@ -46,7 +46,7 @@
|
||||
```json
|
||||
{
|
||||
"general": {
|
||||
"version": "0.2.0.dev58204789",
|
||||
"version": "0.2.0.dev2602231150315077",
|
||||
"data_folder_path": "/home/user/.local/share/net.akkudoktoreos.net",
|
||||
"data_output_subpath": "output",
|
||||
"latitude": 52.52,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Akkudoktor-EOS
|
||||
|
||||
**Version**: `v0.2.0.dev58204789`
|
||||
**Version**: `v0.2.0.dev2602231150315077`
|
||||
|
||||
<!-- pyml disable line-length -->
|
||||
**Description**: This project provides a comprehensive solution for simulating and optimizing an energy system based on renewable energy sources. With a focus on photovoltaic (PV) systems, battery storage (batteries), load management (consumer requirements), heat pumps, electric vehicles, and consideration of electricity price data, this system enables forecasting and optimization of energy flow and costs over a specified period.
|
||||
|
||||
@@ -27,13 +27,13 @@ Example:
|
||||
|
||||
.. code-block:: powershell
|
||||
|
||||
.venv\Scripts\python src/akkudoktoreos/server/eos.py --log-level DEBUG
|
||||
uv run python src/akkudoktoreos/server/eos.py --log-level DEBUG
|
||||
|
||||
.. tab:: Linux
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
.venv/bin/python src/akkudoktoreos/server/eos.py --log-level DEBUG
|
||||
uv run python src/akkudoktoreos/server/eos.py --log-level DEBUG
|
||||
|
||||
```
|
||||
|
||||
|
||||
@@ -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