Switch to the newer uv package manager (#114)
This commit is contained in:
committed by
Christiaan Goossens
parent
11b29f2f3b
commit
17a96da715
14
.github/workflows/lint.yaml
vendored
14
.github/workflows/lint.yaml
vendored
@@ -10,11 +10,15 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
- name: Install the latest version of rye
|
||||
uses: eifinger/setup-rye@v4
|
||||
- name: "Set up Python"
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version-file: ".python-version"
|
||||
- name: Install the latest version of uv
|
||||
uses: astral-sh/setup-uv@v6
|
||||
with:
|
||||
enable-cache: true
|
||||
- name: Sync dependencies
|
||||
run: rye sync
|
||||
- name: Lint (pylint/rye lint)
|
||||
run: rye run check
|
||||
run: scripts/sync
|
||||
- name: Lint (pylint/ruff lint)
|
||||
run: scripts/check
|
||||
|
||||
@@ -13,9 +13,30 @@ If you are not a programmer, you can still contribute by:
|
||||
You may also submit Pull Requests (PRs) to add features yourself! You can find a list that we are currently working on below. Please note that workflows will be run on your pull request and a pull request will only be merged when all checks pass and a review has been conducted (together with a manual test).
|
||||
|
||||
### Development
|
||||
This project uses the Rye package manager for development. You can find installation instructions here: https://rye.astral.sh/guide/installation/. Start by installing the dependencies using rye sync and then point your editor towards the environment created in the .venv directory.
|
||||
This project uses the uv package manager for development. You can find installation instructions here: https://docs.astral.sh/uv/getting-started/installation/. Start by installing the dependencies using `uv sync` and then point your editor towards the environment created in the .venv directory.
|
||||
You can then run Home Assistant and put the `custom_components/auth_oidc` directory in your HA `config` folder.
|
||||
|
||||
#### Other useful commands
|
||||
Some useful scripts are in the `scripts` directory. If you run Linux (or WSL under Windows), you can run these directly:
|
||||
|
||||
- `scripts/check` will check your Python files for linting errors
|
||||
- `scripts/fix` will fix some formatting mistakes automatically
|
||||
|
||||
You can also run these commands manually on Windows:
|
||||
|
||||
##### Check
|
||||
```
|
||||
uv run ruff check
|
||||
uv run ruff format --check
|
||||
uv run pylint custom_components
|
||||
```
|
||||
|
||||
##### Fix
|
||||
```
|
||||
uv run ruff check --fix
|
||||
uv run ruff format
|
||||
```
|
||||
|
||||
### Docker Compose Development Environment
|
||||
You can also use the following Docker Compose configuration to automatically start up the latest HA release with the `auth_oidc` integration:
|
||||
|
||||
|
||||
@@ -19,24 +19,16 @@ requires-python = ">= 3.13"
|
||||
requires = ["hatchling"]
|
||||
build-backend = "hatchling.build"
|
||||
|
||||
[tool.rye]
|
||||
[tool.uv]
|
||||
managed = true
|
||||
dev-dependencies = [
|
||||
"homeassistant~=2024.12",
|
||||
"pylint~=3.3",
|
||||
"ruff>=0.12.11",
|
||||
]
|
||||
|
||||
[tool.hatch.metadata]
|
||||
allow-direct-references = true
|
||||
|
||||
[tool.hatch.build.targets.wheel]
|
||||
packages = ["custom_components/auth_oidc"]
|
||||
|
||||
[tool.rye.scripts]
|
||||
check = { chain = ["check-lint", "check-fmt", "check-pylint" ] }
|
||||
"check-lint" = "rye lint"
|
||||
"check-fmt" = "rye fmt --check"
|
||||
"check-pylint" = "pylint custom_components"
|
||||
fix = { chain = ["fix-lint", "fix-fmt" ] }
|
||||
"fix-lint" = "rye lint --fix"
|
||||
"fix-fmt" = "rye fmt"
|
||||
packages = ["custom_components/auth_oidc"]
|
||||
@@ -14,6 +14,9 @@
|
||||
],
|
||||
"prCreation": "immediate"
|
||||
},
|
||||
"lockFileMaintenance": {
|
||||
"enabled": true
|
||||
},
|
||||
"packageRules": [
|
||||
{
|
||||
"description": "Group all GitHub Actions updates",
|
||||
@@ -36,7 +39,7 @@
|
||||
{
|
||||
"description": "Version updates for other pip packages",
|
||||
"matchDatasources": [
|
||||
"pypi"
|
||||
"uv"
|
||||
],
|
||||
"automerge": false
|
||||
}
|
||||
|
||||
@@ -1,286 +0,0 @@
|
||||
# generated by rye
|
||||
# use `rye lock` or `rye sync` to update this lockfile
|
||||
#
|
||||
# last locked with the following flags:
|
||||
# pre: false
|
||||
# features: []
|
||||
# all-features: false
|
||||
# with-sources: false
|
||||
# generate-hashes: false
|
||||
# universal: false
|
||||
|
||||
-e file:.
|
||||
acme==3.0.1
|
||||
# via hass-nabucasa
|
||||
aiodns==3.2.0
|
||||
# via homeassistant
|
||||
aiofiles==24.1.0
|
||||
# via hass-oidc-auth
|
||||
aiohappyeyeballs==2.4.4
|
||||
# via aiohttp
|
||||
aiohasupervisor==0.2.1
|
||||
# via homeassistant
|
||||
aiohttp==3.11.11
|
||||
# via aiohasupervisor
|
||||
# via aiohttp-cors
|
||||
# via aiohttp-fast-zlib
|
||||
# via hass-nabucasa
|
||||
# via homeassistant
|
||||
# via snitun
|
||||
aiohttp-cors==0.7.0
|
||||
# via homeassistant
|
||||
aiohttp-fast-zlib==0.2.0
|
||||
# via homeassistant
|
||||
aiooui==0.1.7
|
||||
# via bluetooth-adapters
|
||||
aiosignal==1.3.2
|
||||
# via aiohttp
|
||||
aiozoneinfo==0.2.1
|
||||
# via homeassistant
|
||||
anyio==4.7.0
|
||||
# via httpx
|
||||
astral==2.2
|
||||
# via homeassistant
|
||||
astroid==3.3.8
|
||||
# via pylint
|
||||
async-interrupt==1.2.0
|
||||
# via habluetooth
|
||||
# via homeassistant
|
||||
async-timeout==5.0.1
|
||||
# via snitun
|
||||
atomicwrites-homeassistant==1.4.1
|
||||
# via hass-nabucasa
|
||||
# via homeassistant
|
||||
attrs==24.2.0
|
||||
# via aiohttp
|
||||
# via hass-nabucasa
|
||||
# via homeassistant
|
||||
# via snitun
|
||||
audioop-lts==0.2.1
|
||||
# via homeassistant
|
||||
# via standard-aifc
|
||||
awesomeversion==24.6.0
|
||||
# via homeassistant
|
||||
bcrypt==4.2.0
|
||||
# via hass-oidc-auth
|
||||
# via homeassistant
|
||||
bleak==0.22.3
|
||||
# via bleak-retry-connector
|
||||
# via bluetooth-adapters
|
||||
# via habluetooth
|
||||
bleak-retry-connector==3.6.0
|
||||
# via habluetooth
|
||||
bluetooth-adapters==0.20.2
|
||||
# via bleak-retry-connector
|
||||
# via bluetooth-auto-recovery
|
||||
# via habluetooth
|
||||
bluetooth-auto-recovery==1.4.2
|
||||
# via habluetooth
|
||||
bluetooth-data-tools==1.20.0
|
||||
# via habluetooth
|
||||
boto3==1.35.87
|
||||
# via pycognito
|
||||
botocore==1.35.87
|
||||
# via boto3
|
||||
# via s3transfer
|
||||
btsocket==0.3.0
|
||||
# via bluetooth-auto-recovery
|
||||
certifi==2024.12.14
|
||||
# via homeassistant
|
||||
# via httpcore
|
||||
# via httpx
|
||||
# via requests
|
||||
cffi==1.17.1
|
||||
# via cryptography
|
||||
# via pycares
|
||||
charset-normalizer==3.4.0
|
||||
# via requests
|
||||
ciso8601==2.3.1
|
||||
# via hass-nabucasa
|
||||
# via homeassistant
|
||||
cryptography==43.0.1
|
||||
# via acme
|
||||
# via bluetooth-data-tools
|
||||
# via hass-nabucasa
|
||||
# via homeassistant
|
||||
# via josepy
|
||||
# via pyjwt
|
||||
# via pyopenssl
|
||||
# via securetar
|
||||
# via snitun
|
||||
dbus-fast==2.24.4
|
||||
# via bleak
|
||||
# via bleak-retry-connector
|
||||
# via bluetooth-adapters
|
||||
dill==0.3.9
|
||||
# via pylint
|
||||
ecdsa==0.19.0
|
||||
# via python-jose
|
||||
envs==1.4
|
||||
# via pycognito
|
||||
fnv-hash-fast==1.0.2
|
||||
# via homeassistant
|
||||
fnvhash==0.1.0
|
||||
# via fnv-hash-fast
|
||||
frozenlist==1.5.0
|
||||
# via aiohttp
|
||||
# via aiosignal
|
||||
h11==0.14.0
|
||||
# via httpcore
|
||||
habluetooth==3.6.0
|
||||
# via home-assistant-bluetooth
|
||||
hass-nabucasa==0.86.0
|
||||
# via homeassistant
|
||||
home-assistant-bluetooth==1.13.0
|
||||
# via homeassistant
|
||||
homeassistant==2024.12.5
|
||||
httpcore==1.0.7
|
||||
# via httpx
|
||||
httpx==0.27.2
|
||||
# via homeassistant
|
||||
idna==3.10
|
||||
# via anyio
|
||||
# via httpx
|
||||
# via requests
|
||||
# via yarl
|
||||
ifaddr==0.2.0
|
||||
# via homeassistant
|
||||
isort==5.13.2
|
||||
# via pylint
|
||||
jinja2==3.1.4
|
||||
# via hass-oidc-auth
|
||||
# via homeassistant
|
||||
jmespath==1.0.1
|
||||
# via boto3
|
||||
# via botocore
|
||||
josepy==1.14.0
|
||||
# via acme
|
||||
lru-dict==1.3.0
|
||||
# via homeassistant
|
||||
markupsafe==3.0.2
|
||||
# via jinja2
|
||||
mashumaro==3.15
|
||||
# via aiohasupervisor
|
||||
# via webrtc-models
|
||||
mccabe==0.7.0
|
||||
# via pylint
|
||||
multidict==6.1.0
|
||||
# via aiohttp
|
||||
# via yarl
|
||||
orjson==3.10.12
|
||||
# via aiohasupervisor
|
||||
# via homeassistant
|
||||
# via webrtc-models
|
||||
packaging==24.2
|
||||
# via homeassistant
|
||||
pillow==11.0.0
|
||||
# via homeassistant
|
||||
platformdirs==4.3.6
|
||||
# via pylint
|
||||
propcache==0.2.1
|
||||
# via aiohttp
|
||||
# via homeassistant
|
||||
# via yarl
|
||||
psutil==6.1.1
|
||||
# via psutil-home-assistant
|
||||
psutil-home-assistant==0.0.1
|
||||
# via homeassistant
|
||||
pyasn1==0.6.1
|
||||
# via python-jose
|
||||
# via rsa
|
||||
pycares==4.5.0
|
||||
# via aiodns
|
||||
pycognito==2024.5.1
|
||||
# via hass-nabucasa
|
||||
pycparser==2.22
|
||||
# via cffi
|
||||
pyjwt==2.10.1
|
||||
# via hass-nabucasa
|
||||
# via homeassistant
|
||||
# via pycognito
|
||||
pylint==3.3.3
|
||||
pyopenssl==24.2.1
|
||||
# via acme
|
||||
# via homeassistant
|
||||
# via josepy
|
||||
pyrfc3339==2.0.1
|
||||
# via acme
|
||||
pyric==0.1.6.3
|
||||
# via bluetooth-auto-recovery
|
||||
python-dateutil==2.9.0.post0
|
||||
# via botocore
|
||||
python-jose==3.3.0
|
||||
# via hass-oidc-auth
|
||||
python-slugify==8.0.4
|
||||
# via homeassistant
|
||||
pytz==2024.2
|
||||
# via acme
|
||||
# via astral
|
||||
pyyaml==6.0.2
|
||||
# via homeassistant
|
||||
requests==2.32.3
|
||||
# via acme
|
||||
# via homeassistant
|
||||
# via pycognito
|
||||
rsa==4.9
|
||||
# via python-jose
|
||||
s3transfer==0.10.4
|
||||
# via boto3
|
||||
securetar==2024.11.0
|
||||
# via homeassistant
|
||||
setuptools==75.6.0
|
||||
# via acme
|
||||
six==1.17.0
|
||||
# via ecdsa
|
||||
# via python-dateutil
|
||||
sniffio==1.3.1
|
||||
# via anyio
|
||||
# via httpx
|
||||
snitun==0.39.1
|
||||
# via hass-nabucasa
|
||||
sqlalchemy==2.0.36
|
||||
# via homeassistant
|
||||
standard-aifc==3.13.0
|
||||
# via homeassistant
|
||||
standard-chunk==3.13.0
|
||||
# via standard-aifc
|
||||
standard-telnetlib==3.13.0
|
||||
# via homeassistant
|
||||
text-unidecode==1.3
|
||||
# via python-slugify
|
||||
tomlkit==0.13.2
|
||||
# via pylint
|
||||
typing-extensions==4.12.2
|
||||
# via homeassistant
|
||||
# via mashumaro
|
||||
# via sqlalchemy
|
||||
tzdata==2024.2
|
||||
# via aiozoneinfo
|
||||
uart-devices==0.1.0
|
||||
# via bluetooth-adapters
|
||||
ulid-transform==1.0.2
|
||||
# via homeassistant
|
||||
urllib3==1.26.20
|
||||
# via botocore
|
||||
# via homeassistant
|
||||
# via requests
|
||||
usb-devices==0.4.5
|
||||
# via bluetooth-adapters
|
||||
# via bluetooth-auto-recovery
|
||||
uv==0.5.4
|
||||
# via homeassistant
|
||||
voluptuous==0.15.2
|
||||
# via homeassistant
|
||||
# via voluptuous-openapi
|
||||
# via voluptuous-serialize
|
||||
voluptuous-openapi==0.0.5
|
||||
# via homeassistant
|
||||
voluptuous-serialize==2.6.0
|
||||
# via homeassistant
|
||||
webrtc-models==0.3.0
|
||||
# via hass-nabucasa
|
||||
# via homeassistant
|
||||
yarl==1.18.3
|
||||
# via aiohasupervisor
|
||||
# via aiohttp
|
||||
# via homeassistant
|
||||
@@ -1,31 +0,0 @@
|
||||
# generated by rye
|
||||
# use `rye lock` or `rye sync` to update this lockfile
|
||||
#
|
||||
# last locked with the following flags:
|
||||
# pre: false
|
||||
# features: []
|
||||
# all-features: false
|
||||
# with-sources: false
|
||||
# generate-hashes: false
|
||||
# universal: false
|
||||
|
||||
-e file:.
|
||||
aiofiles==24.1.0
|
||||
# via hass-oidc-auth
|
||||
bcrypt==4.2.1
|
||||
# via hass-oidc-auth
|
||||
ecdsa==0.19.0
|
||||
# via python-jose
|
||||
jinja2==3.1.5
|
||||
# via hass-oidc-auth
|
||||
markupsafe==3.0.2
|
||||
# via jinja2
|
||||
pyasn1==0.6.1
|
||||
# via python-jose
|
||||
# via rsa
|
||||
python-jose==3.3.0
|
||||
# via hass-oidc-auth
|
||||
rsa==4.9
|
||||
# via python-jose
|
||||
six==1.17.0
|
||||
# via ecdsa
|
||||
4
scripts/check
Executable file
4
scripts/check
Executable file
@@ -0,0 +1,4 @@
|
||||
#! /bin/bash
|
||||
uv run ruff check
|
||||
uv run ruff format --check
|
||||
uv run pylint custom_components
|
||||
3
scripts/fix
Executable file
3
scripts/fix
Executable file
@@ -0,0 +1,3 @@
|
||||
#! /bin/bash
|
||||
uv run ruff check --fix
|
||||
uv run ruff format
|
||||
2
scripts/sync
Executable file
2
scripts/sync
Executable file
@@ -0,0 +1,2 @@
|
||||
#! /bin/bash
|
||||
uv sync --locked
|
||||
Reference in New Issue
Block a user