diff --git a/Makefile b/Makefile index 7e49455c..2433783f 100644 --- a/Makefile +++ b/Makefile @@ -10,7 +10,7 @@ BIN := .tmp/bin export PATH := $(BIN):$(PATH) export GOBIN := $(abspath $(BIN)) export PYTHONPATH ?= gen -CONFORMANCE_ARGS ?= --strict_message --expected_failures=tests/conformance/nonconforming.yaml --timeout 10s +CONFORMANCE_ARGS ?= --strict_message --expected_failures=test/conformance/nonconforming.yaml --timeout 10s ADD_LICENSE_HEADER := $(BIN)/license-header \ --license-type apache \ --copyright-holder "Buf Technologies, Inc." \ @@ -20,7 +20,7 @@ PROTOVALIDATE_VERSION ?= v0.14.0 # Version of the cel-spec that this implementation is conformant with # This should be kept in sync with the version in format_test.py CEL_SPEC_VERSION ?= v0.24.0 -TESTDATA_FILE := tests/testdata/string_ext_$(CEL_SPEC_VERSION).textproto +TESTDATA_FILE := test/testdata/string_ext_$(CEL_SPEC_VERSION).textproto .PHONY: help help: ## Describe useful make targets @@ -46,22 +46,22 @@ generate: $(BIN)/buf $(BIN)/license-header ## Regenerate code and license header .PHONY: format format: install $(BIN)/license-header ## Format code $(ADD_LICENSE_HEADER) - uv run -- ruff format protovalidate tests - uv run -- ruff check --fix protovalidate tests + uv run -- ruff format protovalidate test + uv run -- ruff check --fix protovalidate test .PHONY: test test: generate install gettestdata ## Run unit tests - uv run -- pytest + uv run -- python -m unittest .PHONY: conformance conformance: $(BIN)/protovalidate-conformance generate install ## Run conformance tests - protovalidate-conformance $(CONFORMANCE_ARGS) uv -- run python3 -m tests.conformance.runner + protovalidate-conformance $(CONFORMANCE_ARGS) uv -- run python3 -m test.conformance.runner .PHONY: lint lint: install ## Lint code - uv run -- ruff format --check --diff protovalidate tests + uv run -- ruff format --check --diff protovalidate test uv run -- mypy protovalidate - uv run -- ruff check protovalidate tests + uv run -- ruff check protovalidate test uv sync --locked .PHONY: install diff --git a/pyproject.toml b/pyproject.toml index a61d2b3f..4bab7aa5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -32,7 +32,6 @@ Issues = "https://github.com/bufbuild/protovalidate-python/issues" [dependency-groups] dev = [ - "pytest", "mypy", "ruff", "types-protobuf==6.30.2.20250503", diff --git a/tests/__init__.py b/test/__init__.py similarity index 100% rename from tests/__init__.py rename to test/__init__.py diff --git a/tests/conformance/__init__.py b/test/conformance/__init__.py similarity index 100% rename from tests/conformance/__init__.py rename to test/conformance/__init__.py diff --git a/tests/conformance/nonconforming.yaml b/test/conformance/nonconforming.yaml similarity index 100% rename from tests/conformance/nonconforming.yaml rename to test/conformance/nonconforming.yaml diff --git a/tests/conformance/runner.py b/test/conformance/runner.py similarity index 100% rename from tests/conformance/runner.py rename to test/conformance/runner.py diff --git a/tests/config_test.py b/test/test_config.py similarity index 100% rename from tests/config_test.py rename to test/test_config.py diff --git a/tests/format_test.py b/test/test_format.py similarity index 96% rename from tests/format_test.py rename to test/test_format.py index e8609656..f356a3a0 100644 --- a/tests/format_test.py +++ b/test/test_format.py @@ -86,9 +86,9 @@ class TestFormat(unittest.TestCase): @classmethod def setUpClass(cls): # The test data from the cel-spec conformance tests - cel_test_data = load_test_data(f"tests/testdata/string_ext_{CEL_SPEC_VERSION}.textproto") + cel_test_data = load_test_data(f"test/testdata/string_ext_{CEL_SPEC_VERSION}.textproto") # Our supplemental tests of functionality not in the cel conformance file, but defined in the spec. - supplemental_test_data = load_test_data("tests/testdata/string_ext_supplemental.textproto") + supplemental_test_data = load_test_data("test/testdata/string_ext_supplemental.textproto") # Combine the test data from both files into one sections = cel_test_data.section diff --git a/tests/matches_test.py b/test/test_matches.py similarity index 100% rename from tests/matches_test.py rename to test/test_matches.py diff --git a/tests/validate_test.py b/test/test_validate.py similarity index 100% rename from tests/validate_test.py rename to test/test_validate.py diff --git a/tests/testdata/string_ext_supplemental.textproto b/test/testdata/string_ext_supplemental.textproto similarity index 100% rename from tests/testdata/string_ext_supplemental.textproto rename to test/testdata/string_ext_supplemental.textproto diff --git a/tests/testdata/string_ext_v0.24.0.textproto b/test/testdata/string_ext_v0.24.0.textproto similarity index 100% rename from tests/testdata/string_ext_v0.24.0.textproto rename to test/testdata/string_ext_v0.24.0.textproto diff --git a/uv.lock b/uv.lock index 7c9ee568..e7d57ce5 100644 --- a/uv.lock +++ b/uv.lock @@ -19,33 +19,6 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/18/28/08871462a0347b3e707658a8308be6f979167488a2196f93b402c2ea7170/cel_python-0.2.0-py3-none-any.whl", hash = "sha256:478ff73def7b39d51e6982f95d937a57c2b088c491c578fe5cecdbd79f476f60", size = 71337, upload-time = "2025-02-14T11:42:19.996Z" }, ] -[[package]] -name = "colorama" -version = "0.4.6" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/d8/53/6f443c9a4a8358a93a6792e2acffb9d9d5cb0a5cfd8802644b7b1c9a02e4/colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44", size = 27697, upload-time = "2022-10-25T02:36:22.414Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/d1/d6/3965ed04c63042e047cb6a3e6ed1a63a35087b6a609aa3a15ed8ac56c221/colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6", size = 25335, upload-time = "2022-10-25T02:36:20.889Z" }, -] - -[[package]] -name = "exceptiongroup" -version = "1.2.2" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/09/35/2495c4ac46b980e4ca1f6ad6db102322ef3ad2410b79fdde159a4b0f3b92/exceptiongroup-1.2.2.tar.gz", hash = "sha256:47c2edf7c6738fafb49fd34290706d1a1a2f4d1c6df275526b62cbb4aa5393cc", size = 28883, upload-time = "2024-07-12T22:26:00.161Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/02/cc/b7e31358aac6ed1ef2bb790a9746ac2c69bcb3c8588b41616914eb106eaf/exceptiongroup-1.2.2-py3-none-any.whl", hash = "sha256:3111b9d131c238bec2f8f516e123e14ba243563fb135d3fe885990585aa7795b", size = 16453, upload-time = "2024-07-12T22:25:58.476Z" }, -] - -[[package]] -name = "iniconfig" -version = "2.0.0" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/d7/4b/cbd8e699e64a6f16ca3a8220661b5f83792b3017d0f79807cb8708d33913/iniconfig-2.0.0.tar.gz", hash = "sha256:2d91e135bf72d31a410b17c16da610a82cb55f6b0477d1a902134b24a455b8b3", size = 4646, upload-time = "2023-01-07T11:08:11.254Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/ef/a6/62565a6e1cf69e10f5727360368e451d4b7f58beeac6173dc9db836a5b46/iniconfig-2.0.0-py3-none-any.whl", hash = "sha256:b6a85871a79d2e3b22d2d1b94ac2824226a63c6b741c88f7ae975f18b6778374", size = 5892, upload-time = "2023-01-07T11:08:09.864Z" }, -] - [[package]] name = "jmespath" version = "1.0.1" @@ -117,24 +90,6 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/2a/e2/5d3f6ada4297caebe1a2add3b126fe800c96f56dbe5d1988a2cbe0b267aa/mypy_extensions-1.0.0-py3-none-any.whl", hash = "sha256:4392f6c0eb8a5668a69e23d168ffa70f0be9ccfd32b5cc2d26a34ae5b844552d", size = 4695, upload-time = "2023-02-04T12:11:25.002Z" }, ] -[[package]] -name = "packaging" -version = "24.2" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/d0/63/68dbb6eb2de9cb10ee4c9c14a0148804425e13c4fb20d61cce69f53106da/packaging-24.2.tar.gz", hash = "sha256:c228a6dc5e932d346bc5739379109d49e8853dd8223571c7c5b55260edc0b97f", size = 163950, upload-time = "2024-11-08T09:47:47.202Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/88/ef/eb23f262cca3c0c4eb7ab1933c3b1f03d021f2c48f54763065b6f0e321be/packaging-24.2-py3-none-any.whl", hash = "sha256:09abb1bccd265c01f4a3aa3f7a7db064b36514d2cba19a2f694fe6150451a759", size = 65451, upload-time = "2024-11-08T09:47:44.722Z" }, -] - -[[package]] -name = "pluggy" -version = "1.5.0" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/96/2d/02d4312c973c6050a18b314a5ad0b3210edb65a906f868e31c111dede4a6/pluggy-1.5.0.tar.gz", hash = "sha256:2cffa88e94fdc978c4c574f15f9e59b7f4201d439195c3715ca9e2486f1d0cf1", size = 67955, upload-time = "2024-04-20T21:34:42.531Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/88/5f/e351af9a41f866ac3f1fac4ca0613908d9a41741cfcf2228f4ad853b697d/pluggy-1.5.0-py3-none-any.whl", hash = "sha256:44e1ad92c8ca002de6377e165f3e0f1be63266ab4d554740532335b9d75ea669", size = 20556, upload-time = "2024-04-20T21:34:40.434Z" }, -] - [[package]] name = "protobuf" version = "6.31.1" @@ -162,7 +117,6 @@ dependencies = [ [package.dev-dependencies] dev = [ { name = "mypy" }, - { name = "pytest" }, { name = "ruff" }, { name = "types-protobuf" }, ] @@ -176,28 +130,10 @@ requires-dist = [ [package.metadata.requires-dev] dev = [ { name = "mypy" }, - { name = "pytest" }, { name = "ruff" }, { name = "types-protobuf", specifier = "==6.30.2.20250503" }, ] -[[package]] -name = "pytest" -version = "8.3.4" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "colorama", marker = "sys_platform == 'win32'" }, - { name = "exceptiongroup", marker = "python_full_version < '3.11'" }, - { name = "iniconfig" }, - { name = "packaging" }, - { name = "pluggy" }, - { name = "tomli", marker = "python_full_version < '3.11'" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/05/35/30e0d83068951d90a01852cb1cef56e5d8a09d20c7f511634cc2f7e0372a/pytest-8.3.4.tar.gz", hash = "sha256:965370d062bce11e73868e0335abac31b4d3de0e82f4007408d242b4f8610761", size = 1445919, upload-time = "2024-12-01T12:54:25.98Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/11/92/76a1c94d3afee238333bc0a42b82935dd8f9cf8ce9e336ff87ee14d9e1cf/pytest-8.3.4-py3-none-any.whl", hash = "sha256:50e16d954148559c9a74109af1eaf0c945ba2d8f30f0a3d3335edde19788b6f6", size = 343083, upload-time = "2024-12-01T12:54:19.735Z" }, -] - [[package]] name = "python-dateutil" version = "2.9.0.post0"