diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 1312d7b..7908695 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -6,7 +6,7 @@ on: - master jobs: - build-and-check: + build-and-test: runs-on: ubuntu-22.04 strategy: matrix: @@ -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: @@ -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 diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 59e66ae..63139b4 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -6,7 +6,7 @@ on: - master jobs: - build-and-check: + build-and-test: runs-on: ubuntu-22.04 strategy: matrix: @@ -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 diff --git a/Makefile b/Makefile index 7d08cc0..579d9a9 100644 --- a/Makefile +++ b/Makefile @@ -23,9 +23,6 @@ bootstrap: bootstrap.install bootstrap.install: poetry install -.PHONY: check -check: lint test - .PHONY: ci.bootstrap ci.bootstrap: pip install poetry @@ -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) @@ -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 + diff --git a/docs/DEVELOPMENT.md b/docs/DEVELOPMENT.md index b6e001e..165a46c 100644 --- a/docs/DEVELOPMENT.md +++ b/docs/DEVELOPMENT.md @@ -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) @@ -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: @@ -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` diff --git a/poetry.lock b/poetry.lock index 097258f..0a9511f 100644 --- a/poetry.lock +++ b/poetry.lock @@ -310,54 +310,6 @@ files = [ {file = "mccabe-0.7.0.tar.gz", hash = "sha256:348e0240c33b60bbdf4e523192ef919f28cb2c3d7d5c7794f74009290f236325"}, ] -[[package]] -name = "mypy" -version = "1.8.0" -description = "Optional static typing for Python" -optional = false -python-versions = ">=3.8" -groups = ["dev"] -files = [ - {file = "mypy-1.8.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:485a8942f671120f76afffff70f259e1cd0f0cfe08f81c05d8816d958d4577d3"}, - {file = "mypy-1.8.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:df9824ac11deaf007443e7ed2a4a26bebff98d2bc43c6da21b2b64185da011c4"}, - {file = "mypy-1.8.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2afecd6354bbfb6e0160f4e4ad9ba6e4e003b767dd80d85516e71f2e955ab50d"}, - {file = "mypy-1.8.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:8963b83d53ee733a6e4196954502b33567ad07dfd74851f32be18eb932fb1cb9"}, - {file = "mypy-1.8.0-cp310-cp310-win_amd64.whl", hash = "sha256:e46f44b54ebddbeedbd3d5b289a893219065ef805d95094d16a0af6630f5d410"}, - {file = "mypy-1.8.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:855fe27b80375e5c5878492f0729540db47b186509c98dae341254c8f45f42ae"}, - {file = "mypy-1.8.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:4c886c6cce2d070bd7df4ec4a05a13ee20c0aa60cb587e8d1265b6c03cf91da3"}, - {file = "mypy-1.8.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d19c413b3c07cbecf1f991e2221746b0d2a9410b59cb3f4fb9557f0365a1a817"}, - {file = "mypy-1.8.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:9261ed810972061388918c83c3f5cd46079d875026ba97380f3e3978a72f503d"}, - {file = "mypy-1.8.0-cp311-cp311-win_amd64.whl", hash = "sha256:51720c776d148bad2372ca21ca29256ed483aa9a4cdefefcef49006dff2a6835"}, - {file = "mypy-1.8.0-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:52825b01f5c4c1c4eb0db253ec09c7aa17e1a7304d247c48b6f3599ef40db8bd"}, - {file = "mypy-1.8.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:f5ac9a4eeb1ec0f1ccdc6f326bcdb464de5f80eb07fb38b5ddd7b0de6bc61e55"}, - {file = "mypy-1.8.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:afe3fe972c645b4632c563d3f3eff1cdca2fa058f730df2b93a35e3b0c538218"}, - {file = "mypy-1.8.0-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:42c6680d256ab35637ef88891c6bd02514ccb7e1122133ac96055ff458f93fc3"}, - {file = "mypy-1.8.0-cp312-cp312-win_amd64.whl", hash = "sha256:720a5ca70e136b675af3af63db533c1c8c9181314d207568bbe79051f122669e"}, - {file = "mypy-1.8.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:028cf9f2cae89e202d7b6593cd98db6759379f17a319b5faf4f9978d7084cdc6"}, - {file = "mypy-1.8.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:4e6d97288757e1ddba10dd9549ac27982e3e74a49d8d0179fc14d4365c7add66"}, - {file = "mypy-1.8.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7f1478736fcebb90f97e40aff11a5f253af890c845ee0c850fe80aa060a267c6"}, - {file = "mypy-1.8.0-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:42419861b43e6962a649068a61f4a4839205a3ef525b858377a960b9e2de6e0d"}, - {file = "mypy-1.8.0-cp38-cp38-win_amd64.whl", hash = "sha256:2b5b6c721bd4aabaadead3a5e6fa85c11c6c795e0c81a7215776ef8afc66de02"}, - {file = "mypy-1.8.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:5c1538c38584029352878a0466f03a8ee7547d7bd9f641f57a0f3017a7c905b8"}, - {file = "mypy-1.8.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:4ef4be7baf08a203170f29e89d79064463b7fc7a0908b9d0d5114e8009c3a259"}, - {file = "mypy-1.8.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7178def594014aa6c35a8ff411cf37d682f428b3b5617ca79029d8ae72f5402b"}, - {file = "mypy-1.8.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:ab3c84fa13c04aeeeabb2a7f67a25ef5d77ac9d6486ff33ded762ef353aa5592"}, - {file = "mypy-1.8.0-cp39-cp39-win_amd64.whl", hash = "sha256:99b00bc72855812a60d253420d8a2eae839b0afa4938f09f4d2aa9bb4654263a"}, - {file = "mypy-1.8.0-py3-none-any.whl", hash = "sha256:538fd81bb5e430cc1381a443971c0475582ff9f434c16cd46d2c66763ce85d9d"}, - {file = "mypy-1.8.0.tar.gz", hash = "sha256:6ff8b244d7085a0b425b56d327b480c3b29cafbd2eff27316a004f9a7391ae07"}, -] - -[package.dependencies] -mypy-extensions = ">=1.0.0" -tomli = {version = ">=1.1.0", markers = "python_version < \"3.11\""} -typing-extensions = ">=4.1.0" - -[package.extras] -dmypy = ["psutil (>=4.0)"] -install-types = ["pip"] -mypyc = ["setuptools (>=50)"] -reports = ["lxml"] - [[package]] name = "mypy-extensions" version = "1.0.0" @@ -515,6 +467,7 @@ description = "Backported and Experimental Type Hints for Python 3.8+" optional = false python-versions = ">=3.8" groups = ["dev"] +markers = "python_version == \"3.10\"" files = [ {file = "typing_extensions-4.9.0-py3-none-any.whl", hash = "sha256:af72aea155e91adfc61c3ae9e0e342dbc0cba726d6cba4b6c72c1f34e47291cd"}, {file = "typing_extensions-4.9.0.tar.gz", hash = "sha256:23478f88c37f27d76ac8aee6c905017a143b0b1b886c3c9f66bc2fd94f9f5783"}, @@ -540,4 +493,4 @@ zstd = ["zstandard (>=0.18.0)"] [metadata] lock-version = "2.1" python-versions = "^3.10" -content-hash = "4914ae38187d6097647a4c2ce7b63ce3ba1f1f9f8bf9f687a33f6680e114a4a5" +content-hash = "3deafc93e96ef3263326dfdccb7244fdfa089e48667c1a9f60f6780aec551483" diff --git a/pyproject.toml b/pyproject.toml index 94f7b57..dca37ed 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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"