Skip to content

Commit d8e06d2

Browse files
authored
Merge pull request #21 from canonical/post-review-cleanup
Post review cleanup
2 parents 50d35b7 + 725f14b commit d8e06d2

File tree

8 files changed

+242
-44
lines changed

8 files changed

+242
-44
lines changed

.github/workflows/integration_test.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
jobs:
88
integration-tests:
99
name: Integration Tests
10-
runs-on: ubuntu-24.04
10+
runs-on: ubuntu-latest
1111
steps:
1212
- name: Checkout
1313
uses: actions/checkout@v4

.github/workflows/test.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ jobs:
1313
secrets: inherit
1414
with:
1515
self-hosted-runner: false
16+
with-uv: true

.licenserc.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,5 @@ header:
3030
- 'pyproject.toml'
3131
- 'lib/**'
3232
- 'tests/integration/test-ssh-key'
33+
- 'uv.lock'
3334
comment: on-failure

charmcraft.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,10 @@ platforms:
1616

1717
parts:
1818
git-ubuntu-charm:
19-
plugin: charm
19+
plugin: uv
2020
source: .
21+
build-snaps:
22+
- astral-uv
2123

2224
debian-archive-keyring:
2325
plugin: dump

pyproject.toml

Lines changed: 66 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,68 @@
1+
# Copyright 2025 Canonical Ltd.
2+
# See LICENSE file for licensing details.
3+
4+
[project]
5+
name = "git-ubuntu-operator"
6+
version = "1.0.0"
7+
requires-python = ">=3.12"
8+
9+
# Charm code dependencies
10+
dependencies = [
11+
"charmlibs-apt>=1.0.0",
12+
"charmlibs-pathops>=1.0.0",
13+
"ops~=2.17",
14+
]
15+
16+
[dependency-groups]
17+
18+
charmlibs = [
19+
"charmlibs-apt>=1.0.0",
20+
"charmlibs-pathops>=1.0.0",
21+
]
22+
23+
format = [
24+
"black",
25+
"isort",
26+
]
27+
28+
lint = [
29+
"mypy",
30+
"isort",
31+
"black",
32+
"flake8-docstrings",
33+
"flake8-docstrings-complete",
34+
"flake8-builtins",
35+
"flake8-test-docs",
36+
"pep8-naming",
37+
"codespell",
38+
"pylint",
39+
"pyproject-flake8",
40+
"pydocstyle",
41+
"types-PyYAML",
42+
]
43+
44+
unit = [
45+
"pytest",
46+
"coverage[toml]",
47+
"ops[testing]",
48+
]
49+
50+
coverage-report = [
51+
"pytest",
52+
"coverage[toml]",
53+
"ops[testing]",
54+
]
55+
56+
static = [
57+
"pyright",
58+
"ops[testing]",
59+
]
60+
61+
integration = [
62+
"pytest",
63+
"jubilant~=1.0",
64+
]
65+
166
# Testing tools configuration
267
[tool.coverage.run]
368
branch = true
@@ -54,8 +119,8 @@ lint.extend-ignore = [
54119
"D409",
55120
"D413",
56121
]
57-
extend-exclude = ["__pycache__", "*.egg_info"]
58122
lint.per-file-ignores = {"tests/*" = ["D100","D101","D102","D103","D104"]}
123+
extend-exclude = ["__pycache__", "*.egg_info"]
59124

60125
[tool.ruff.lint.mccabe]
61126
max-complexity = 10

requirements.txt

Lines changed: 0 additions & 3 deletions
This file was deleted.

tox.ini

Lines changed: 13 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -25,32 +25,16 @@ pass_env =
2525

2626
[testenv:format]
2727
description = Apply coding style standards to code
28-
deps =
29-
black
30-
isort
28+
dependency_groups = format
3129
commands =
3230
isort {[vars]all_path}
3331
black {[vars]all_path}
3432

3533
[testenv:lint]
3634
description = Check code against coding style standards
37-
deps =
38-
mypy
39-
isort
40-
black
41-
flake8-docstrings
42-
flake8-docstrings-complete
43-
flake8-builtins
44-
flake8-test-docs
45-
pep8-naming
46-
codespell
47-
pylint
48-
pyproject-flake8
49-
pydocstyle
50-
types-PyYAML
51-
ops
52-
charmlibs-pathops
53-
charmlibs-apt
35+
dependency_groups =
36+
lint
37+
charmlibs
5438
commands =
5539
black --check --diff {[vars]all_path}
5640
codespell {[vars]all_path}
@@ -62,11 +46,9 @@ commands =
6246

6347
[testenv:unit]
6448
description = Run unit tests
65-
deps =
66-
pytest
67-
coverage[toml]
68-
ops[testing]
69-
-r {tox_root}/requirements.txt
49+
dependency_groups =
50+
unit
51+
charmlibs
7052
commands =
7153
coverage run --source={[vars]src_path} \
7254
-m pytest \
@@ -79,29 +61,22 @@ commands =
7961

8062
[testenv:coverage-report]
8163
description = Create test coverage report
82-
deps =
83-
pytest
84-
coverage[toml]
85-
ops[testing]
86-
-r {tox_root}/requirements.txt
64+
dependency_groups = coverage-report
8765
commands =
8866
coverage report
8967

9068
[testenv:static]
9169
description = Run static type checks
92-
deps =
93-
pyright
94-
ops[testing]
95-
-r {tox_root}/requirements.txt
70+
dependency_groups =
71+
static
72+
charmlibs
9673
commands =
9774
pyright {posargs}
9875

9976
[testenv:integration]
10077
description = Run integration tests
101-
deps =
102-
pytest
103-
jubilant~=1.0
104-
-r {tox_root}/requirements.txt
78+
dependency_groups =
79+
integration
10580
commands =
10681
pytest -v \
10782
-s \

uv.lock

Lines changed: 157 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)