Skip to content

Commit

Permalink
Switch to uv+pdm
Browse files Browse the repository at this point in the history
  • Loading branch information
offbyone committed Apr 14, 2024
1 parent 6de0222 commit d5475a4
Show file tree
Hide file tree
Showing 7 changed files with 431 additions and 193 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
- name: Set up Python & PDM
uses: pdm-project/setup-pdm@v3
with:
python-version: "3.11"
python-version: "3.12"
cache: true

- name: install python libs
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Set up Python & PDM
uses: pdm-project/setup-pdm@v3
with:
python-version: "3.11"
python-version: "3.12"
cache: true

- name: install python libs
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ themes/fuji
node_modules/
themes/offby1/static/webfonts/
requirements-dev*
/.pdm-python
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ repos:
- id: check-useless-excludes

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.3.3
rev: v0.3.7
hooks:
- id: ruff
- id: ruff-format
args: ["--check"]

- repo: https://github.com/antonbabenko/pre-commit-terraform
rev: v1.88.2
rev: v1.88.4
hooks:
- id: terraform_fmt
- id: terraform_validate
Expand Down
27 changes: 9 additions & 18 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,27 +34,18 @@ generate-dev: build
publish: generate upload invalidate

compile-deps:
.venv/bin/pip-compile --no-emit-index-url \
--no-emit-trusted-host \
--unsafe-package=distribute \
--unsafe-package=offby1-website \
--unsafe-package=offby1.website \
--unsafe-package=pip \
--unsafe-package=setuptools \
requirements.in
pdm lock

update-deps:
.venv/bin/pip-compile --no-emit-index-url \
--upgrade \
--no-emit-trusted-host \
--unsafe-package=distribute \
--unsafe-package=offby1-website \
--unsafe-package=offby1.website \
--unsafe-package=pip \
--unsafe-package=setuptools \
requirements.in
pdm update --update-all

install-deps:
.venv/bin/pip-sync requirements.txt
pdm install

deps: compile-deps install-deps

plan:
terraform plan -out plan.just

apply:
terraform apply plan.just
562 changes: 408 additions & 154 deletions pdm.lock

Large diffs are not rendered by default.

26 changes: 9 additions & 17 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,24 +41,16 @@ name = "Chris Rose"
email = "offline@offby1.net"

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[tool.hatch]

[tool.hatch.metadata]
# enabled because we are using git dependencies
allow-direct-references = true

[tool.hatch.build.targets.sdist]
ignore-vcs = true
only-include = [
"plugins/*.py",
]

[tool.hatch.build.targets.wheel]
packages = ["plugins"]
requires = ["pdm-backend"]
build-backend = "pdm.backend"

[tool.black]
line-length = 100
target-version = ['py38']

[tool.pdm.dev-dependencies]
dev = [
"boto3>=1.34.23",
"click>=8.1.7",
"aws-log-parser>=2.3.0",
]

0 comments on commit d5475a4

Please sign in to comment.