Skip to content

Commit 484223b

Browse files
committed
Merge formatting checks with tests
1 parent 90165cb commit 484223b

6 files changed

Lines changed: 20 additions & 92 deletions

File tree

.github/workflows/publish.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
- master
77

88
jobs:
9-
build-and-check:
9+
build-and-test:
1010
runs-on: ubuntu-22.04
1111
strategy:
1212
matrix:
@@ -21,8 +21,8 @@ jobs:
2121
run: make ci.bootstrap
2222
- name: Update version in pyproject.toml
2323
run: make ci.update-version-in-pyproject
24-
- name: Check
25-
run: make check
24+
- name: Test
25+
run: make test
2626
- name: Upload dist directory
2727
uses: actions/upload-artifact@v4
2828
with:
@@ -31,7 +31,7 @@ jobs:
3131

3232
publish:
3333
runs-on: ubuntu-22.04
34-
needs: build-and-check
34+
needs: build-and-test
3535
steps:
3636
- uses: actions/checkout@v4
3737
- name: Setup python

.github/workflows/pull_request.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
- master
77

88
jobs:
9-
build-and-check:
9+
build-and-test:
1010
runs-on: ubuntu-22.04
1111
strategy:
1212
matrix:
@@ -19,5 +19,5 @@ jobs:
1919
python-version: ${{ matrix.python-version }}
2020
- name: Bootstrap
2121
run: make ci.bootstrap
22-
- name: Check
23-
run: make check
22+
- name: Test
23+
run: make test

Makefile

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,6 @@ bootstrap: bootstrap.install
2323
bootstrap.install:
2424
poetry install
2525

26-
.PHONY: check
27-
check: lint test
28-
2926
.PHONY: ci.bootstrap
3027
ci.bootstrap:
3128
pip install poetry
@@ -62,26 +59,15 @@ format:
6259
poetry run black $(SOURCE_DIRS)
6360
poetry run isort $(SOURCE_DIRS)
6461

65-
.PHONY: lint
66-
lint: lint.format # lint.types
62+
.PHONY: test
63+
test: test.format test.integration test.unit
6764

68-
.PHONY: lint.format
69-
lint.format:
65+
.PHONY: test.format
66+
test.format:
7067
poetry run flake8 $(SOURCE_DIRS)
7168
poetry run isort --check-only --diff --ignore-whitespace --quiet $(SOURCE_DIRS)
7269
poetry run black --check --diff $(SOURCE_DIRS)
7370

74-
#.PHONY: lint.types
75-
#lint.types:
76-
# poetry run mypy $(SOURCE_DIRS)
77-
78-
.PHONY: test
79-
test: test.unit test.integration
80-
81-
.PHONY: test.unit
82-
test.unit:
83-
poetry run pytest --verbose
84-
8571
.PHONY: test.integration
8672
test.integration: clean build
8773
cp dist/utt-*-py3-none-any.whl $(INTEGRATION_DIR)
@@ -90,3 +76,8 @@ test.integration: clean build
9076
cat $(TEMPLATE_DOCKERFILE) >> $(GENERATED_DOCKERFILE)
9177
docker build --tag $(TEST_DOCKER_IMAGE) --file $(GENERATED_DOCKERFILE) $(INTEGRATION_DIR)
9278
docker run --rm $(TEST_DOCKER_IMAGE) $(INTEGRATION_CMD)
79+
80+
.PHONY: test.unit
81+
test.unit:
82+
poetry run pytest --verbose
83+

docs/DEVELOPMENT.md

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,10 @@
55
- [System dependencies](#system-dependencies)
66
- [Python dependencies](#python-dependencies)
77
- [Formatting code](#formatting-code)
8-
- [Code quality](#code-quality)
98
- [Executing `utt` from source](#executing-utt-from-source)
109
- [Tests](#tests)
1110
- [Unit tests](#unit-tests)
12-
- [Integration Tests](#integration-tests)
11+
- [Integration Tests](#integration-tests)
1312

1413

1514

@@ -39,18 +38,6 @@ format the code with this command:
3938
`$ make format`
4039

4140

42-
## Code quality
43-
44-
We run a few checks to enforce a minimum code quality. You can run
45-
them with this command:
46-
47-
`$ make lint`
48-
49-
It checks that the code is properly formatted (it shouldn't be an
50-
issue if you ran `make format`) and a few other checks such as unused
51-
imports, unused variables, etc.
52-
53-
5441
## Executing `utt` from source
5542

5643
To run utt from local source:
@@ -62,9 +49,7 @@ To run utt from local source:
6249

6350
This section is very important as most code changes need tests.
6451

65-
There are two kinds of tests: unit and integration tests.
66-
67-
You can run both with this command:
52+
You can run all tests (including format checks, unit tests, and integration tests) with this command:
6853

6954
`$ make test`
7055

poetry.lock

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

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,5 @@ black = "^23.12.1"
3131
ddt = "^1.7.1"
3232
flake8 = "^7.0.0"
3333
isort = "^5.13.2"
34-
mypy = "^1.8.0"
3534
pytest = "^7.4.4"
3635
requests = "^2.31.0"

0 commit comments

Comments
 (0)