Skip to content

Commit

Permalink
Use pyproject.toml in the plugin examples (teemtee#2812)
Browse files Browse the repository at this point in the history
Signed-off-by: Cristian Le <[email protected]>
  • Loading branch information
LecrisUT authored and The-Mule committed Oct 14, 2024
1 parent 33a33a1 commit b860e6e
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 19 deletions.
21 changes: 21 additions & 0 deletions examples/plugins/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[build-system]
# Using hatchling as build backend because EPEL9 setuptools (53.0.0) does not build with PEP517 properly
requires = ["hatchling"]
build-backend = "hatchling.build"

[project]
name = "demo-plugins"
version = "0.0.1"
dependencies = [
"tmt",
]

[tool.hatch.build.targets.wheel]
packages = [
"discover.py",
"provision.py",
]

[project.entry-points."tmt.plugin"]
ProvisionExample = "provision:ProvisionExample"
DiscoverExample = "discover:DiscoverExample"
13 changes: 0 additions & 13 deletions examples/plugins/setup.py

This file was deleted.

6 changes: 0 additions & 6 deletions tests/plugins/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,6 @@ rlJournalStart
rlPhaseEnd

rlPhaseStartTest "Using TMT_PLUGINS"
# setup.py is not a plugin and cannot be loaded
rlRun "mv ./plugins/setup.py ./plugins/setup.XXX"

# Plugins are not available before
rlRun -s "$tmt run discover -h example --help" "2"
rlAssertGrep "Unsupported discover method" "$rlRun_LOG"
Expand All @@ -53,9 +50,6 @@ rlJournalStart
rlRun "export TMT_PLUGINS=./plugins"
rlRun "$tmt run discover -h example --help"
rlRun "$tmt run provision -h example --help"

rlRun "unset TMT_PLUGINS"
rlRun "mv ./plugins/setup.XXX ./plugins/setup.py"
rlPhaseEnd

rlPhaseStartCleanup
Expand Down

0 comments on commit b860e6e

Please sign in to comment.