Skip to content

Commit

Permalink
Add tests for cmdclass
Browse files Browse the repository at this point in the history
  • Loading branch information
abravalheri committed Dec 3, 2021
1 parent f602afa commit d02c17e
Show file tree
Hide file tree
Showing 4 changed files with 52 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 @@ -169,7 +169,7 @@
],
"type": "object",
"patternProperties": {
"^.*$": {"type": "string", "format": "python_qualified_identifier"}
"^.*$": {"type": "string", "format": "python-qualified-identifier"}
}
},
"dynamic": {
Expand Down
3 changes: 3 additions & 0 deletions tests/examples/pretend-setuptools/06-pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ platforms = ["any"]
[tool.setuptools.packages.find]
where = ["src"]

[tool.setuptools.cmdclass]
sdist = "pkg.mod.CustomSdist"

[tool.setuptools.package-data]
"myproj.bash" = ["*.sh"]
"myproj.yaml" = ["*.yml"]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
cmdclass.sdist must be python-qualified-identifier
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
[project]
name = "project"
description = "description"
license = { text = "BSD-3-Clause" }
dynamic = ["version"]
requires-python = ">= 3.6"

[[project.author]]
name = "Name 1"
email = "[email protected]"

[[project.author]]
name = "Name 2"
email = "[email protected]"

[project.readme]
file = "README.rst"
content-type = "text/x-rst"

[build-system]
requires = ["setuptools", "wheel"]
build-backend = "setuptools.build_meta"

[tool.setuptools]
package-dir = {"" = "src"}
include-package-data = true
script-files = [
"bin/run.py"
]

[tool.setuptools.cmdclass]
sdist = "pkg.my-invalid:mod.Custom~Sdist"

[tool.setuptools.packages.find]
where = ["src"]

[tool.setuptools.dynamic]
version = {file = "__version__.txt"}

[tool.pytest.ini_options]
testpaths = ["tests"]

[tool.coverage.paths]
source = [
"src",
"*/site-packages",
]

0 comments on commit d02c17e

Please sign in to comment.