Skip to content

Commit f115934

Browse files
committed
record entry_points for wheels
tag with stevedore_namespace so that once we enable the pants-plugin for stevedore, pants can install things appropriately for tests to access the setuptools metadata.
1 parent bdf3cd4 commit f115934

File tree

4 files changed

+27
-0
lines changed

4 files changed

+27
-0
lines changed

pants-plugins/macros.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@
1313
# limitations under the License.
1414

1515

16+
# this is only here temporarily until we update to pants 2.16+
17+
def stevedore_namespace(ns):
18+
return ns
19+
20+
1621
def st2_publish_repos():
1722
"""Return the list of repos twine should publish to.
1823
@@ -79,6 +84,8 @@ def st2_component_python_distribution(**kwargs):
7984
description = (
8085
f"{st2_component} StackStorm event-driven automation platform component"
8186
)
87+
# setup(scripts=[...]) is for pre-made scripts, which we have.
88+
# TODO: use entry_points.console_scripts instead of hand-generating these.
8289
scripts = kwargs.pop("scripts", [])
8390

8491
st2_license(dest=st2_component)

st2auth/BUILD

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
st2_component_python_distribution(
22
component_name="st2auth",
33
scripts=["bin/st2auth"],
4+
entry_points={
5+
stevedore_namespace("st2auth.sso.backends"): {
6+
"noop": "st2auth.sso.noop:NoOpSingleSignOnBackend",
7+
},
8+
},
49
)

st2client/BUILD

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
11
st2_component_python_distribution(
22
component_name="st2client",
3+
entry_points={
4+
"console_scripts": {
5+
"st2": "st2client.shell:main",
6+
},
7+
},
38
)

st2common/BUILD

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,14 @@ st2_component_python_distribution(
2626
# dev scripts we might want to include
2727
# "bin/st2-generate-schemas",
2828
],
29+
entry_points={
30+
stevedore_namespace("st2common.metrics.driver"): {
31+
"statsd": "st2common.metrics.drivers.statsd_driver:StatsdDriver",
32+
"noop": "st2common.metrics.drivers.noop_driver:NoopDriver",
33+
"echo": "st2common.metrics.drivers.echo_driver:EchoDriver",
34+
},
35+
stevedore_namespace("st2common.rbac.backend"): {
36+
"noop": "st2common.rbac.backends.noop:NoOpRBACBackend",
37+
},
38+
},
2939
)

0 commit comments

Comments
 (0)