Skip to content

Commit

Permalink
refactor: switch to uv for managing packages
Browse files Browse the repository at this point in the history
  • Loading branch information
jcwillox committed Nov 19, 2024
1 parent 24ffb17 commit 0e99f66
Show file tree
Hide file tree
Showing 8 changed files with 2,007 additions and 1,958 deletions.
9 changes: 2 additions & 7 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,7 @@
"name": "jcwillox/hass-auto-backup",

// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "mcr.microsoft.com/devcontainers/python:1-3.11-bookworm",

// Features to add to the dev container. More info: https://containers.dev/features.
"features": {
"ghcr.io/devcontainers-contrib/features/poetry:2": {}
},
"image": "mcr.microsoft.com/devcontainers/python:3.12-bookworm",

// Use 'forwardPorts' to make a list of ports inside the container available locally.
"forwardPorts": [8123],
Expand All @@ -21,7 +16,7 @@
},

// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "poetry install",
"postCreateCommand": "pipx install uv && uv sync",

// Configure tool-specific properties.
"customizations": {
Expand Down
13 changes: 7 additions & 6 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,20 @@ jobs:
- name: "Checkout the repository"
uses: actions/checkout@v4

- name: "Install poetry"
run: pipx install poetry
- name: "Install uv"
uses: astral-sh/setup-uv@v3
with:
enable-cache: true

- name: "Setup Python"
uses: actions/setup-python@v5
with:
python-version-file: "pyproject.toml"
cache: "poetry"
python-version-file: ".python-version"

- name: "Install dependencies"
run: poetry install --only docs
run: uv sync --only-group docs

- name: "Build & Deploy 🚀"
run: poetry run mkdocs gh-deploy --force
run: uv run mkdocs gh-deploy --force
env:
SITE_DESCRIPTION: ${{ github.event.repository.description }}
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.12
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"editor.linkedEditing": true,
"editor.renderWhitespace": "trailing",
"editor.codeActionsOnSave": {
"source.fixAll": true
"source.fixAll": "explicit"
},
"files.associations": {
"**/.github/workflows/*.yaml": "github-actions-workflow",
Expand Down
2 changes: 1 addition & 1 deletion .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{
"label": "Run Home Assistant on port 8123",
"type": "shell",
"command": "poetry run .devcontainer/hass.sh",
"command": "uv run .devcontainer/hass.sh",
"problemMatcher": []
}
]
Expand Down
1,927 changes: 0 additions & 1,927 deletions poetry.lock

This file was deleted.

26 changes: 10 additions & 16 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,21 +1,15 @@
[tool.poetry]
[project]
name = "hass-auto-backup"
version = "0.0.0"
description = ""
authors = []
license = "MIT"
readme = "README.md"
packages = [{ include = "auto_backup", from = "custom_components" }]
requires-python = ">=3.12"
dependencies = [
"colorlog>=6.9.0",
"homeassistant>=2024.11.2",
]

[tool.poetry.dependencies]
python = "^3.11"
homeassistant = "^2023.7.3"
colorlog = "^6.7.0"
securetar = "^2023.3.0"

[tool.poetry.group.docs.dependencies]
mkdocs-material = "^9.1.18"

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
[dependency-groups]
docs = [
"mkdocs-material>=9.5.44",
]
1,985 changes: 1,985 additions & 0 deletions uv.lock

Large diffs are not rendered by default.

0 comments on commit 0e99f66

Please sign in to comment.