diff options
author | Dennis Eriksen <d@ennis.no> | 2023-11-07 10:45:29 +0100 |
---|---|---|
committer | Dennis Eriksen <d@ennis.no> | 2023-11-07 10:45:29 +0100 |
commit | cbf38a81ab1634c9b87b36d6dc3ec787922fd3da (patch) | |
tree | d15bd8ce001acf6e5f88a5f12432153edd756537 | |
parent | adding .mailmap (diff) | |
download | energyscripts-cbf38a81ab1634c9b87b36d6dc3ec787922fd3da.tar.gz |
move deps from requirements.txt to pyproject.toml
-rw-r--r-- | README.md | 24 | ||||
-rw-r--r-- | pyproject.toml | 41 | ||||
-rw-r--r-- | requirements-no-cryptography.txt | 39 | ||||
-rw-r--r-- | requirements.txt | 42 |
4 files changed, 45 insertions, 101 deletions
@@ -9,28 +9,13 @@ energyconsumption. ``` python3 -m venv venv source venv/bin/activate -pip3 install -r requirements.txt +pip install --upgrade pip +pip install . ``` +If running `scripts/neihub.py` or `scripts/esphomeapi.py`, also run `pip install +".[esphome]"` and `pip install ".[neohub]"`. -## Handling pip - -``` -# Create requirements.txt -pip3 freeze > requirements.txt - -# Show outdated packages -pip3 list --outdated - -# Upgrade package -pip3 install -U name - -# Upgrade everything -pip3 install -U -r requirements.txt - -# Update requirements.txt -pip3 freeze > requirements.txt -``` ## Schema @@ -65,4 +50,3 @@ journalctl -fu "energyscripts-*" ## TODO: Put every state in `states`-table. Entities in an entity-table, and devices in a device-table. - diff --git a/pyproject.toml b/pyproject.toml index de2c150..8c3700d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,44 @@ +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[project] +name = "energyscripts" +version = "0.0.1" +description = "Some pythonscripts to query different energy-APIs" +readme = "README.md" +requires-python = ">=3.9" + +dependencies = [ + "DateTime~=5.2", + "litequeue~=0.7", + "paho-mqtt~=1.6", + "psycopg~=3.1", + "python-dateutil~=2.8", + "requests~=2.31", + "tzlocal~=5.2", + "urllib3<=2", # urllib3 >v2 warns about not using openssl. See https://github.com/urllib3/urllib3/issues/3020 + "xmltodict~=0.13", +] + +[project.optional-dependencies] +dev = [ + "ruff~=0.1", +] +esphome = [ # aioesphome requires "cryptography" + "aioesphomeapi~=18.2", + "zeroconf~=0.120", +] +neohub = [ + "neohubapi~=1.1", +] + +[project.urls] +"Homepage" = "https://git.dnns.no/energyscripts/" + +[tool.hatch.build.targets.sdist] +include = [] + [tool.ruff] # https://docs.astral.sh/ruff/rules/ # Enable: diff --git a/requirements-no-cryptography.txt b/requirements-no-cryptography.txt deleted file mode 100644 index d77e2ea..0000000 --- a/requirements-no-cryptography.txt +++ /dev/null @@ -1,39 +0,0 @@ -astroid==2.15.6 -async-property==0.2.2 -async-timeout==4.0.2 -asyncio==3.4.3 -certifi==2023.5.7 -cffi==1.15.1 -charset-normalizer==3.2.0 -colorlog==6.7.0 -DateTime==5.1 -dill==0.3.6 -idna==3.4 -ifaddr==0.2.0 -isort==5.12.0 -lazy-object-proxy==1.9.0 -litequeue==0.6 -mccabe==0.7.0 -neohubapi==1.1 -paho-mqtt==1.6.1 -platformdirs==3.8.1 -protobuf==4.23.4 -psycopg==3.1.9 -pycparser==2.21 -pylint==2.17.4 -python-dateutil==2.8.2 -pytz==2023.3 -pytz-deprecation-shim==0.1.0.post0 -requests==2.31.0 -six==1.16.0 -tomli==2.0.1 -tomlkit==0.11.8 -typing_extensions==4.7.1 -tzdata==2023.3 -tzlocal==5.0.1 -urllib3==2.0.3 -websockets==11.0.3 -wrapt==1.15.0 -xmltodict==0.13.0 -zeroconf==0.71.0 -zope.interface==6.0 diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 41b0f40..0000000 --- a/requirements.txt +++ /dev/null @@ -1,42 +0,0 @@ -aioesphomeapi==13.6.0 -astroid==2.14.1 -async-property==0.2.1 -async-timeout==4.0.2 -asyncio==3.4.3 -certifi==2022.12.7 -cffi==1.15.1 -charset-normalizer==3.0.1 -colorlog==6.7.0 -cryptography==40.0.1 -DateTime==5.0 -dill==0.3.6 -idna==3.4 -ifaddr==0.2.0 -isort==5.12.0 -lazy-object-proxy==1.9.0 -litequeue==0.5 -mccabe==0.7.0 -neohubapi==1.0 -noiseprotocol==0.3.1 -paho-mqtt==1.6.1 -platformdirs==2.6.2 -protobuf==4.22.1 -psycopg==3.1.8 -pycparser==2.21 -pylint==2.16.0 -python-dateutil==2.8.2 -pytz==2022.7.1 -pytz-deprecation-shim==0.1.0.post0 -requests==2.28.2 -six==1.16.0 -tomli==2.0.1 -tomlkit==0.11.6 -typing_extensions==4.4.0 -tzdata==2022.7 -tzlocal==4.2 -urllib3==1.26.14 -websockets==10.4 -wrapt==1.14.1 -xmltodict==0.13.0 -zeroconf==0.47.4 -zope.interface==5.5.2 |