-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
916 additions
and
1,260 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
root = true | ||
|
||
[*] | ||
end_of_line = lf | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
charset = utf-8 | ||
|
||
[*.{py,ini}] | ||
indent_style = space | ||
indent_size = 4 | ||
|
||
[*.{yaml,yml,tf}] | ||
indent_style = space | ||
indent_size = 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,26 @@ | ||
venv/ | ||
build/ | ||
venv | ||
build | ||
*.charm | ||
.tox/ | ||
.tox | ||
.coverage | ||
__pycache__/ | ||
*.py[cod] | ||
.idea | ||
.vscode/ | ||
requirements.txt | ||
.vscode | ||
version | ||
cover | ||
|
||
# Managed by repository.py | ||
.charmhub.secret | ||
_build | ||
external | ||
|
||
# Ignore libs except the filesystem_client | ||
# Managed by Charmcraft | ||
**/lib/charms/* | ||
|
||
lib/charms/* | ||
!lib/charms/filesystem_client/ | ||
# Managed by uv | ||
.venv | ||
.ruff_cache | ||
.pytest_cache | ||
requirements.txt | ||
dev-requirements.txt |
This file was deleted.
Oops, something went wrong.
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,74 +1,21 @@ | ||
uv := `which uv` | ||
charmcraft := `which charmcraft` | ||
|
||
project_dir := justfile_directory() | ||
|
||
src := project_dir / "src" | ||
tests := project_dir / "tests" | ||
lib := project_dir / "lib/charms/filesystem_client" | ||
all := src + " " + tests + " " + lib | ||
|
||
export PYTHONPATH := project_dir + ":" + project_dir / "lib" + ":" + src | ||
export PY_COLORS := "1" | ||
export PYTHONBREAKPOINT := "pdb.set_trace" | ||
|
||
uv_run := "uv run --frozen --extra dev" | ||
|
||
# Regenerate uv.lock. | ||
lock: | ||
uv lock --no-cache | ||
|
||
# Fetch the required charm libraries. | ||
fetch-libs: | ||
charmcraft fetch-libs | ||
uv lock | ||
|
||
# Create a development environment. | ||
env: lock fetch-libs | ||
env: lock | ||
uv sync --extra dev | ||
|
||
# Upgrade uv.lock with the latest deps | ||
upgrade: | ||
uv lock --upgrade --no-cache | ||
|
||
# Generate requirements.txt from pyproject.toml | ||
requirements: lock | ||
uv export --frozen --no-hashes --format=requirements-txt -o requirements.txt | ||
|
||
# Apply coding style standards to code | ||
fmt: lock | ||
{{uv_run}} ruff format {{all}} | ||
{{uv_run}} ruff check --fix {{all}} | ||
|
||
# Check code against coding style standards | ||
lint: lock fetch-libs | ||
{{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 | ||
typecheck *args: lock fetch-libs | ||
{{uv_run}} pyright {{args}} | ||
|
||
# Run unit tests | ||
unit *args: lock fetch-libs | ||
{{uv_run}} coverage run \ | ||
--source={{src}} \ | ||
--source={{lib}} \ | ||
-m pytest \ | ||
--tb native \ | ||
-v \ | ||
-s \ | ||
{{args}} \ | ||
{{tests}}/unit | ||
{{uv_run}} coverage report | ||
uv lock --upgrade | ||
|
||
# Run integration tests | ||
integration *args: lock fetch-libs | ||
{{uv_run}} pytest \ | ||
-v \ | ||
-s \ | ||
--tb native \ | ||
--log-cli-level=INFO \ | ||
{{args}} \ | ||
{{tests}}/integration | ||
repository *args: lock | ||
{{uv_run}} repository.py {{args}} |
Oops, something went wrong.