Skip to content

Commit 09ca3b0

Browse files
committed
get workflows to run
1 parent e025f05 commit 09ca3b0

File tree

5 files changed

+20
-19
lines changed

5 files changed

+20
-19
lines changed

Diff for: .github/workflows/.hatch-run.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ jobs:
4646
with:
4747
python-version: ${{ matrix.python-version }}
4848
- name: Install Python Dependencies
49-
run: pip install -r requirements/nox-deps.txt
50-
- name: Run Sessions
49+
run: pip install hatch
50+
- name: Run Scripts
5151
env:
5252
NODE_AUTH_TOKEN: ${{ secrets.node-auth-token }}
5353
PYPI_USERNAME: ${{ secrets.pypi-username }}

Diff for: .github/workflows/publish.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ on:
99

1010
jobs:
1111
publish:
12-
uses: ./.github/workflows/.nox-session.yml
12+
uses: ./.github/workflows/.hatch-run.yml
1313
with:
1414
job-name: "publish"
15-
nox-args: "-s publish"
15+
hatch-run: "publish"
1616
secrets:
1717
node-auth-token: ${{ secrets.NODE_AUTH_TOKEN }}
1818
pypi-username: ${{ secrets.PYPI_USERNAME }}

Diff for: .github/workflows/test.yml

+7-9
Original file line numberDiff line numberDiff line change
@@ -15,23 +15,21 @@ jobs:
1515
uses: ./.github/workflows/.hatch-run.yml
1616
with:
1717
job-name: "python-{0}"
18-
hatch-run: "-t check-python"
19-
nox-session-args: "--pytest --maxfail=3 --reruns 3"
18+
hatch-run: "test-py --maxfail=3 --reruns=3 lint-py"
2019
python-environments:
21-
uses: ./.github/workflows/.nox-session.yml
20+
uses: ./.github/workflows/.hatch-run.yml
2221
with:
2322
job-name: "python-{0} {1}"
24-
nox-args: "-s check-python-tests"
25-
nox-session-args: "--no-cov --pytest --maxfail=3 --reruns 3"
23+
hatch-run: "test-py --maxfail=3 --reruns=3 --no-cov"
2624
runs-on-array: '["ubuntu-latest", "macos-latest", "windows-latest"]'
2725
python-version-array: '["3.9", "3.10", "3.11"]'
2826
docs:
29-
uses: ./.github/workflows/.nox-session.yml
27+
uses: ./.github/workflows/.hatch-run.yml
3028
with:
3129
job-name: "python-{0}"
32-
nox-args: "-s check-docs"
30+
hatch-run: "test-docs"
3331
javascript:
34-
uses: ./.github/workflows/.nox-session.yml
32+
uses: ./.github/workflows/.hatch-run.yml
3533
with:
3634
job-name: "{1}"
37-
nox-args: "-t check-javascript"
35+
hatch-run: "test-js lint-js"

Diff for: pyproject.toml

+1-4
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,12 @@ post-install-commands = ["invoke env"]
1414
[tool.hatch.envs.default.scripts]
1515
publish = "invoke publish {args}"
1616

17-
checks = ["lint", "test"]
18-
lint = ["lint-py {args}", "lint-js {args}"]
19-
test = ["test-py", "test-js"]
20-
2117
lint-py = "invoke lint-py {args}"
2218
lint-js = "invoke lint-js {args}"
2319

2420
test-py = "invoke test-py {args}"
2521
test-js = "invoke test-js {args}"
22+
test-docs = "invoke test-docs {args}"
2623

2724
# --- Black ----------------------------------------------------------------------------
2825

Diff for: tasks.py

+8-2
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,10 @@ def lint_js(context: Context, fix: bool = False):
8383

8484

8585
@task
86-
def test_py(context: Context, no_cov: bool = False):
86+
def test_py(context: Context, no_cov: bool = False, **flags: str):
8787
"""Run test suites"""
88-
in_py(context, f"hatch run {'test' if no_cov else 'cov'}")
88+
flags = " ".join(f"--{k}={v}" for k, v in flags.items())
89+
in_py(context, f"hatch run {'test' if no_cov else 'cov'} {flags}")
8990

9091

9192
@task
@@ -94,6 +95,11 @@ def test_js(context: Context):
9495
in_js(context, "npm run check:tests")
9596

9697

98+
@task
99+
def test_docs(context: Context):
100+
raise Exit("Not implemented")
101+
102+
97103
@task
98104
def publish(context: Context, dry_run: str = ""):
99105
"""Publish packages that have been tagged for release in the current commit

0 commit comments

Comments
 (0)