Skip to content

Commit

Permalink
record entry_points for wheels
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
cognifloyd committed Feb 20, 2023
1 parent bdf3cd4 commit f115934
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pants-plugins/macros.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@
# limitations under the License.


# this is only here temporarily until we update to pants 2.16+
def stevedore_namespace(ns):
return ns


def st2_publish_repos():
"""Return the list of repos twine should publish to.
Expand Down Expand Up @@ -79,6 +84,8 @@ def st2_component_python_distribution(**kwargs):
description = (
f"{st2_component} StackStorm event-driven automation platform component"
)
# setup(scripts=[...]) is for pre-made scripts, which we have.
# TODO: use entry_points.console_scripts instead of hand-generating these.
scripts = kwargs.pop("scripts", [])

st2_license(dest=st2_component)
Expand Down
5 changes: 5 additions & 0 deletions st2auth/BUILD
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
st2_component_python_distribution(
component_name="st2auth",
scripts=["bin/st2auth"],
entry_points={
stevedore_namespace("st2auth.sso.backends"): {
"noop": "st2auth.sso.noop:NoOpSingleSignOnBackend",
},
},
)
5 changes: 5 additions & 0 deletions st2client/BUILD
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
st2_component_python_distribution(
component_name="st2client",
entry_points={
"console_scripts": {
"st2": "st2client.shell:main",
},
},
)
10 changes: 10 additions & 0 deletions st2common/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,14 @@ st2_component_python_distribution(
# dev scripts we might want to include
# "bin/st2-generate-schemas",
],
entry_points={
stevedore_namespace("st2common.metrics.driver"): {
"statsd": "st2common.metrics.drivers.statsd_driver:StatsdDriver",
"noop": "st2common.metrics.drivers.noop_driver:NoopDriver",
"echo": "st2common.metrics.drivers.echo_driver:EchoDriver",
},
stevedore_namespace("st2common.rbac.backend"): {
"noop": "st2common.rbac.backends.noop:NoOpRBACBackend",
},
},
)

0 comments on commit f115934

Please sign in to comment.