From ba8dd19caa5dc34e777ffb9ce74c4f776fc3d2d9 Mon Sep 17 00:00:00 2001 From: Anderson Bravalheri Date: Tue, 7 May 2024 14:35:41 +0100 Subject: [PATCH 1/2] Add example capturing expectation for tool.setuptools.dynamic.optional-dependencies --- tests/examples/setuptools/10-pyproject.toml | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 tests/examples/setuptools/10-pyproject.toml diff --git a/tests/examples/setuptools/10-pyproject.toml b/tests/examples/setuptools/10-pyproject.toml new file mode 100644 index 0000000..3c9c393 --- /dev/null +++ b/tests/examples/setuptools/10-pyproject.toml @@ -0,0 +1,7 @@ +[project] +name = "myproj" +version = "42" +dynamic = ["optional-dependencies"] + +[tool.setuptools.dynamic.optional-dependencies] +name-with-hyfens = {file = "extra.txt"} From b1d99d8c06fef2b047a2145247891703bd7a64b2 Mon Sep 17 00:00:00 2001 From: Anderson Bravalheri Date: Tue, 7 May 2024 14:30:36 +0100 Subject: [PATCH 2/2] Align tool.setuptools.dynamic.optional-dependencies with project.optional-dependencies --- src/validate_pyproject/plugins/setuptools.schema.json | 2 +- .../setuptools/dependencies/invalid-extra-name.errors.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/validate_pyproject/plugins/setuptools.schema.json b/src/validate_pyproject/plugins/setuptools.schema.json index 2b029b6..adc203d 100644 --- a/src/validate_pyproject/plugins/setuptools.schema.json +++ b/src/validate_pyproject/plugins/setuptools.schema.json @@ -219,7 +219,7 @@ "dependencies": {"$ref": "#/definitions/file-directive-for-dependencies"}, "optional-dependencies": { "type": "object", - "propertyNames": {"type": "string", "format": "python-identifier"}, + "propertyNames": {"type": "string", "format": "pep508-identifier"}, "additionalProperties": false, "patternProperties": { ".+": {"$ref": "#/definitions/file-directive-for-dependencies"} diff --git a/tests/invalid-examples/setuptools/dependencies/invalid-extra-name.errors.txt b/tests/invalid-examples/setuptools/dependencies/invalid-extra-name.errors.txt index 8f03afc..8abee19 100644 --- a/tests/invalid-examples/setuptools/dependencies/invalid-extra-name.errors.txt +++ b/tests/invalid-examples/setuptools/dependencies/invalid-extra-name.errors.txt @@ -1,3 +1,3 @@ `tool.setuptools.dynamic.optional-dependencies` keys must be named by: - {type: string, format: 'python-identifier'} + {type: string, format: 'pep508-identifier'}