Skip to content

Commit

Permalink
Improve validation of attr directives for setuptools (#101)
Browse files Browse the repository at this point in the history
  • Loading branch information
abravalheri committed May 18, 2023
1 parent b7bcae2 commit b8db58b
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/validate_pyproject/plugins/setuptools.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@
"type": "object",
"additionalProperties": false,
"properties": {
"attr": {"type": "string"}
"attr": {"format": "python-qualified-identifier"}
},
"required": ["attr"]
},
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
`tool.setuptools.dynamic.version` must be valid exactly by one definition
'attr': {format: 'python-qualified-identifier'}
17 changes: 17 additions & 0 deletions tests/invalid-examples/setuptools/attr/missing-attr-name.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Issue pypa/setuptools#3928
# https://github.com/RonnyPfannschmidt/reproduce-setuptools-dynamic-attr
[build-system]
build-backend = "_own_version_helper"
backend-path = ["."]
requires = ["setuptools" ]

[project]
name = "ronnypfannschmidt.setuptools-build-attr-error-reproduce"
description = "reproducer for a setuptools issue"
requires-python = ">=3.7"
dynamic = [
"version",
]

[tool.setuptools.dynamic]
version = { attr = "_own_version_helper."}

0 comments on commit b8db58b

Please sign in to comment.