Skip to content

Commit 0c31bed

Browse files
committed
reorganize yml and toml contents
1 parent 612c06b commit 0c31bed

File tree

2 files changed

+41
-47
lines changed

2 files changed

+41
-47
lines changed

.github/workflows/ci.yml

Lines changed: 34 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,10 @@ jobs:
2727
pip3 --quiet install --upgrade hatch uv
2828
hatch --version
2929
uv --version
30-
- name: Run formatter check
31-
run: |
32-
hatch run lint:format-check || true
30+
- name: Run formatter
31+
run: hatch run lint:format-check || true
3332
- name: Run linter
34-
run: |
35-
hatch run lint:check || true
33+
run: hatch run lint:check || true
3634
# TODO: Remove '|| true' when linting issues are resolved in future PR
3735

3836
test-python:
@@ -56,12 +54,10 @@ jobs:
5654
cache: pip
5755

5856
- name: Install dependencies
59-
run: |
60-
python -m pip install --upgrade pip hatch uv
57+
run: python -m pip install --upgrade pip hatch uv
6158

6259
- name: Show environment
63-
run: |
64-
hatch test --show --python ${{ matrix.python-version }}
60+
run: hatch test --show --python ${{ matrix.python-version }}
6561

6662
- name: Run tests
6763
run: |
@@ -92,12 +88,38 @@ jobs:
9288
cache: pip
9389

9490
- name: Install dependencies
95-
run: |
96-
python -m pip install --upgrade pip hatch uv
91+
run: python -m pip install --upgrade pip hatch uv
9792

9893
- name: Run functional tests
94+
run: hatch run functional:test
95+
96+
build-python:
97+
name: Build Python
98+
runs-on: ubuntu-latest
99+
permissions:
100+
contents: read
101+
needs:
102+
- lint-python
103+
steps:
104+
- uses: actions/checkout@v4
105+
- name: Set up Python 3.x
106+
uses: actions/setup-python@v5
107+
with:
108+
python-version: "3.x"
109+
cache: "pip"
110+
- name: Install Hatch
99111
run: |
100-
hatch run functional:test
112+
pip3 --quiet install --upgrade hatch uv
113+
hatch --version
114+
uv --version
115+
- name: Build release files
116+
run: hatch build --clean
117+
- uses: actions/upload-artifact@v4
118+
with:
119+
name: artifacts
120+
path: dist/*
121+
if-no-files-found: error
122+
retention-days: 7
101123

102124
coverage-python:
103125
name: Check Python Coverage
@@ -132,35 +154,6 @@ jobs:
132154
name: coverage-report
133155
path: htmlcov
134156

135-
build-python:
136-
name: Build Python
137-
runs-on: ubuntu-latest
138-
permissions:
139-
contents: read
140-
needs:
141-
- lint-python
142-
steps:
143-
- uses: actions/checkout@v4
144-
- name: Set up Python 3.x
145-
uses: actions/setup-python@v5
146-
with:
147-
python-version: "3.x"
148-
cache: "pip"
149-
- name: Install Hatch
150-
run: |
151-
pip3 --quiet install --upgrade hatch uv
152-
hatch --version
153-
uv --version
154-
- name: Build release files
155-
run: |
156-
hatch build --clean
157-
- uses: actions/upload-artifact@v4
158-
with:
159-
name: artifacts
160-
path: dist/*
161-
if-no-files-found: error
162-
retention-days: 7
163-
164157
# This workflow relies on the user manually creating a "stub release" on GitHub with the correct version number in the tag.
165158
publish-github:
166159
name: Publish GitHub Release

pyproject.toml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,6 @@ django = ["5.1"]
103103
python = ["3.10", "3.11", "3.12", "3.13"]
104104
django = ["5.2"]
105105

106-
107-
108106
[tool.hatch.envs.hatch-test.overrides]
109107
matrix.django.dependencies = [
110108
{ if = ["4.2"], value = "django>=4.2,<4.3" },
@@ -113,7 +111,7 @@ matrix.django.dependencies = [
113111
{ if = ["5.2"], value = "django>=5.2,<5.3" },
114112
]
115113

116-
# >>> Hatch Documentation Scripts <<<
114+
# >>> Documentation Scripts <<<
117115

118116
[tool.hatch.envs.docs]
119117
template = "docs"
@@ -127,7 +125,7 @@ dependencies = [
127125
serve = ["cd docs && mkdocs serve"]
128126
build = ["cd docs && mkdocs build --strict"]
129127

130-
# >>> Hatch pre-commit <<<
128+
# >>> Pre-commit Environment <<<
131129

132130
[tool.hatch.envs.precommit]
133131
template = "pre-commit"
@@ -138,7 +136,7 @@ dependencies = ["pre-commit>=3,<4"]
138136
check = ["pre-commit run --all-files"]
139137
update = ["pre-commit autoupdate"]
140138

141-
# >>> Hatch Lint Environment <<<
139+
# >>> Lint Environment <<<
142140

143141
[tool.hatch.envs.lint]
144142
extra-dependencies = [
@@ -151,7 +149,10 @@ check = ["ruff check dbbackup", "pylint dbbackup --rcfile=.pylintrc"]
151149
format = ["ruff format dbbackup"]
152150
format-check = ["ruff format --check dbbackup"]
153151

154-
# >>> Hatch Functional Testing <<<
152+
# >>> CLI workflow tests <<<
153+
# TODO: Rewrite this in pytest using the following file as a guide:
154+
# https://github.com/Archmonger/django-dbbackup/blob/dee332b9c505f59fd43b2733f095e81162767f9d/functional.sh
155+
# Make sure we cover a variety of database backends.
155156

156157
[tool.hatch.envs.functional]
157158
extra-dependencies = [

0 commit comments

Comments
 (0)