File tree Expand file tree Collapse file tree 3 files changed +12
-22
lines changed Expand file tree Collapse file tree 3 files changed +12
-22
lines changed Original file line number Diff line number Diff line change 14
14
15
15
env :
16
16
# Common versions
17
- PYTHON_VERSION : ' 3.11.5'
17
+ PYTHON_VERSION : ' 3.11'
18
+ HATCH_VERSION : ' 1.12.0'
18
19
DOCKER_BUILDX_VERSION : ' v0.11.2'
19
20
20
21
# These environment variables are important to the Crossplane CLI install.sh
@@ -47,10 +48,10 @@ jobs:
47
48
python-version : ${{ env.PYTHON_VERSION }}
48
49
49
50
- name : Setup Hatch
50
- run : pipx install hatch==1.7.0
51
+ run : pipx install hatch==${{ env.HATCH_VERSION }}
51
52
52
53
- name : Lint
53
- run : hatch run lint:check
54
+ run : hatch fmt
54
55
55
56
unit-test :
56
57
runs-on : ubuntu-22.04
@@ -64,10 +65,10 @@ jobs:
64
65
python-version : ${{ env.PYTHON_VERSION }}
65
66
66
67
- name : Setup Hatch
67
- run : pipx install hatch==1.7.0
68
+ run : pipx install hatch==${{ env.HATCH_VERSION }}
68
69
69
70
- name : Run Unit Tests
70
- run : hatch run test:unit
71
+ run : hatch test --all --randomize
71
72
72
73
# We want to build most packages for the amd64 and arm64 architectures. To
73
74
# speed this up we build single-platform packages in parallel. We then upload
Original file line number Diff line number Diff line change @@ -25,11 +25,11 @@ CLI][cli] to build functions.
25
25
# Run the code in development mode, for crossplane beta render
26
26
hatch run development
27
27
28
- # Lint the code - see pyproject.toml
29
- hatch run lint:check
28
+ # Lint and format the code - see pyproject.toml
29
+ hatch fmt
30
30
31
31
# Run unit tests - see tests/test_fn.py
32
- hatch run test:unit
32
+ hatch test
33
33
34
34
# Build the function's runtime image - see Dockerfile
35
35
$ docker build . --tag=runtime
Original file line number Diff line number Diff line change @@ -48,21 +48,10 @@ dependencies = ["ipython==8.28.0"]
48
48
[tool .hatch .envs .default .scripts ]
49
49
development = " python function/main.py --insecure --debug"
50
50
51
- [tool .hatch .envs .lint ]
52
- type = " virtual"
53
- detached = true
54
- path = " .venv-lint"
51
+ # This special environment is used by hatch fmt.
52
+ [tool .hatch .envs .hatch-static-analysis ]
55
53
dependencies = [" ruff==0.6.9" ]
56
-
57
- [tool .hatch .envs .lint .scripts ]
58
- check = " ruff check function tests && ruff format --diff function tests"
59
-
60
- [tool .hatch .envs .test ]
61
- type = " virtual"
62
- path = " .venv-test"
63
-
64
- [tool .hatch .envs .test .scripts ]
65
- unit = " python -m unittest tests/*.py"
54
+ config-path = " none" # Disable Hatch's default Ruff config.
66
55
67
56
[tool .ruff ]
68
57
target-version = " py311"
You can’t perform that action at this time.
0 commit comments