Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- master

jobs:
build-and-check:
build-and-test:
runs-on: ubuntu-22.04
strategy:
matrix:
Expand All @@ -21,8 +21,8 @@ jobs:
run: make ci.bootstrap
- name: Update version in pyproject.toml
run: make ci.update-version-in-pyproject
- name: Check
run: make check
- name: Test
run: make test
- name: Upload dist directory
uses: actions/upload-artifact@v4
with:
Expand All @@ -31,7 +31,7 @@ jobs:

publish:
runs-on: ubuntu-22.04
needs: build-and-check
needs: build-and-test
steps:
- uses: actions/checkout@v4
- name: Setup python
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- master

jobs:
build-and-check:
build-and-test:
runs-on: ubuntu-22.04
strategy:
matrix:
Expand All @@ -19,5 +19,5 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Bootstrap
run: make ci.bootstrap
- name: Check
run: make check
- name: Test
run: make test
27 changes: 9 additions & 18 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ bootstrap: bootstrap.install
bootstrap.install:
poetry install

.PHONY: check
check: lint test

.PHONY: ci.bootstrap
ci.bootstrap:
pip install poetry
Expand Down Expand Up @@ -62,26 +59,15 @@ format:
poetry run black $(SOURCE_DIRS)
poetry run isort $(SOURCE_DIRS)

.PHONY: lint
lint: lint.format # lint.types
.PHONY: test
test: test.format test.integration test.unit

.PHONY: lint.format
lint.format:
.PHONY: test.format
test.format:
poetry run flake8 $(SOURCE_DIRS)
poetry run isort --check-only --diff --ignore-whitespace --quiet $(SOURCE_DIRS)
poetry run black --check --diff $(SOURCE_DIRS)

#.PHONY: lint.types
#lint.types:
# poetry run mypy $(SOURCE_DIRS)

.PHONY: test
test: test.unit test.integration

.PHONY: test.unit
test.unit:
poetry run pytest --verbose

.PHONY: test.integration
test.integration: clean build
cp dist/utt-*-py3-none-any.whl $(INTEGRATION_DIR)
Expand All @@ -90,3 +76,8 @@ test.integration: clean build
cat $(TEMPLATE_DOCKERFILE) >> $(GENERATED_DOCKERFILE)
docker build --tag $(TEST_DOCKER_IMAGE) --file $(GENERATED_DOCKERFILE) $(INTEGRATION_DIR)
docker run --rm $(TEST_DOCKER_IMAGE) $(INTEGRATION_CMD)

.PHONY: test.unit
test.unit:
poetry run pytest --verbose

19 changes: 2 additions & 17 deletions docs/DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@
- [System dependencies](#system-dependencies)
- [Python dependencies](#python-dependencies)
- [Formatting code](#formatting-code)
- [Code quality](#code-quality)
- [Executing `utt` from source](#executing-utt-from-source)
- [Tests](#tests)
- [Unit tests](#unit-tests)
- [Integration Tests](#integration-tests)
- [Integration Tests](#integration-tests)



Expand Down Expand Up @@ -39,18 +38,6 @@ format the code with this command:
`$ make format`


## Code quality

We run a few checks to enforce a minimum code quality. You can run
them with this command:

`$ make lint`

It checks that the code is properly formatted (it shouldn't be an
issue if you ran `make format`) and a few other checks such as unused
imports, unused variables, etc.


## Executing `utt` from source

To run utt from local source:
Expand All @@ -62,9 +49,7 @@ To run utt from local source:

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

There are two kinds of tests: unit and integration tests.

You can run both with this command:
You can run all tests (including format checks, unit tests, and integration tests) with this command:

`$ make test`

Expand Down
51 changes: 2 additions & 49 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,5 @@ black = "^23.12.1"
ddt = "^1.7.1"
flake8 = "^7.0.0"
isort = "^5.13.2"
mypy = "^1.8.0"
pytest = "^7.4.4"
requests = "^2.31.0"