Skip to content

Commit

Permalink
fix: cleanup names and add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jedel1043 committed Dec 11, 2024
1 parent 93e44e6 commit 9bfa16d
Show file tree
Hide file tree
Showing 13 changed files with 1,111 additions and 545 deletions.
2 changes: 1 addition & 1 deletion charmcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ parts:
- astral-uv
charm-requirements: ["requirements.txt"]
charm-binary-python-packages:
- jsonschema ~= 4.23.0
- rpds_py ~= 0.22.3
override-build: |
just requirements
craftctl default
Expand Down
16 changes: 10 additions & 6 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,33 +13,37 @@ export PYTHONBREAKPOINT := "pdb.set_trace"

uv_run := "uv run --frozen --extra dev"

# Regenerate uv.lock
lock:
uv lock --no-cache

# Upgrade uv.lock with the latest deps
upgrade:
uv lock --upgrade --no-cache

# Generate requirements.txt from pyproject.toml
requirements:
requirements: lock
uv export --frozen --no-hashes --format=requirements-txt -o requirements.txt

# Apply coding style standards to code
fmt:
fmt: lock
echo {{PYTHONPATH}}
{{uv_run}} ruff format {{all}}
{{uv_run}} ruff check --fix {{all}}

# Check code against coding style standards
lint:
lint: lock
{{uv_run}} codespell {{lib}}
{{uv_run}} codespell {{project_dir}}
{{uv_run}} ruff check {{all}}
{{uv_run}} ruff format --check --diff {{all}}

# Run static type checks
static *args:
static *args: lock
{{uv_run}} pyright {{args}}

# Run unit tests
unit *args:
unit *args: lock
{{uv_run}} coverage run \
--source={{src}} \
--source={{lib}} \
Expand All @@ -52,7 +56,7 @@ unit *args:
{{uv_run}} coverage report

# Run integration tests
integration *args:
integration *args: lock
{{uv_run}} pytest \
-v \
-s \
Expand Down
Loading

0 comments on commit 9bfa16d

Please sign in to comment.