Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/integration_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
jobs:
integration-tests:
name: Integration Tests
runs-on: ubuntu-24.04
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ jobs:
secrets: inherit
with:
self-hosted-runner: false
with-uv: true
1 change: 1 addition & 0 deletions .licenserc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,5 @@ header:
- 'pyproject.toml'
- 'lib/**'
- 'tests/integration/test-ssh-key'
- 'uv.lock'
comment: on-failure
4 changes: 3 additions & 1 deletion charmcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@ platforms:

parts:
git-ubuntu-charm:
plugin: charm
plugin: uv
source: .
build-snaps:
- astral-uv

debian-archive-keyring:
plugin: dump
Expand Down
67 changes: 66 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,68 @@
# Copyright 2025 Canonical Ltd.
# See LICENSE file for licensing details.

[project]
name = "git-ubuntu-operator"
version = "1.0.0"
requires-python = ">=3.12"

# Charm code dependencies
dependencies = [
"charmlibs-apt>=1.0.0",
"charmlibs-pathops>=1.0.0",
"ops~=2.17",
]

[dependency-groups]

charmlibs = [
"charmlibs-apt>=1.0.0",
"charmlibs-pathops>=1.0.0",
]

format = [
"black",
"isort",
]

lint = [
"mypy",
"isort",
"black",
"flake8-docstrings",
"flake8-docstrings-complete",
"flake8-builtins",
"flake8-test-docs",
"pep8-naming",
"codespell",
"pylint",
"pyproject-flake8",
"pydocstyle",
"types-PyYAML",
]

unit = [
"pytest",
"coverage[toml]",
"ops[testing]",
]

coverage-report = [
"pytest",
"coverage[toml]",
"ops[testing]",
]

static = [
"pyright",
"ops[testing]",
]

integration = [
"pytest",
"jubilant~=1.0",
]

# Testing tools configuration
[tool.coverage.run]
branch = true
Expand Down Expand Up @@ -54,8 +119,8 @@ lint.extend-ignore = [
"D409",
"D413",
]
extend-exclude = ["__pycache__", "*.egg_info"]
lint.per-file-ignores = {"tests/*" = ["D100","D101","D102","D103","D104"]}
extend-exclude = ["__pycache__", "*.egg_info"]

[tool.ruff.lint.mccabe]
max-complexity = 10
Expand Down
3 changes: 0 additions & 3 deletions requirements.txt

This file was deleted.

51 changes: 13 additions & 38 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -25,32 +25,16 @@ pass_env =

[testenv:format]
description = Apply coding style standards to code
deps =
black
isort
dependency_groups = format
commands =
isort {[vars]all_path}
black {[vars]all_path}

[testenv:lint]
description = Check code against coding style standards
deps =
mypy
isort
black
flake8-docstrings
flake8-docstrings-complete
flake8-builtins
flake8-test-docs
pep8-naming
codespell
pylint
pyproject-flake8
pydocstyle
types-PyYAML
ops
charmlibs-pathops
charmlibs-apt
dependency_groups =
lint
charmlibs
commands =
black --check --diff {[vars]all_path}
codespell {[vars]all_path}
Expand All @@ -62,11 +46,9 @@ commands =

[testenv:unit]
description = Run unit tests
deps =
pytest
coverage[toml]
ops[testing]
-r {tox_root}/requirements.txt
dependency_groups =
unit
charmlibs
commands =
coverage run --source={[vars]src_path} \
-m pytest \
Expand All @@ -79,29 +61,22 @@ commands =

[testenv:coverage-report]
description = Create test coverage report
deps =
pytest
coverage[toml]
ops[testing]
-r {tox_root}/requirements.txt
dependency_groups = coverage-report
commands =
coverage report

[testenv:static]
description = Run static type checks
deps =
pyright
ops[testing]
-r {tox_root}/requirements.txt
dependency_groups =
static
charmlibs
commands =
pyright {posargs}

[testenv:integration]
description = Run integration tests
deps =
pytest
jubilant~=1.0
-r {tox_root}/requirements.txt
dependency_groups =
integration
commands =
pytest -v \
-s \
Expand Down
157 changes: 157 additions & 0 deletions uv.lock

Large diffs are not rendered by default.

Loading