Skip to content

Commit 7fe538a

Browse files
authored
Merge pull request #5909: Pants: add python_distribution BUILD metadata for st2* components
2 parents cd8bb4c + 083fd00 commit 7fe538a

File tree

12 files changed

+91
-1
lines changed

12 files changed

+91
-1
lines changed

CHANGELOG.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Added
1616
to pants' use of PEX lockfiles. This is not a user-facing addition.
1717
#5778 #5789 #5817 #5795 #5830 #5833 #5834 #5841 #5840 #5838 #5842 #5837 #5849 #5850
1818
#5846 #5853 #5848 #5847 #5858 #5857 #5860 #5868 #5871 #5864 #5874 #5884 #5893 #5891
19-
#5890 #5898 #5901 #5906 #5899 #5907
19+
#5890 #5898 #5901 #5906 #5899 #5907 #5909
2020
Contributed by @cognifloyd
2121

2222
* Added a joint index to solve the problem of slow mongo queries for scheduled executions. #5805

pants-plugins/macros.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ def st2_component_python_distribution(**kwargs):
8484
description = (
8585
f"{st2_component} StackStorm event-driven automation platform component"
8686
)
87+
# setup(scripts=[...]) is for pre-made scripts, which we have.
88+
# TODO: use entry_points.console_scripts instead of hand-generating these.
8789
scripts = kwargs.pop("scripts", [])
8890

8991
st2_license(dest=st2_component)

st2actions/BUILD

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
st2_component_python_distribution(
2+
component_name="st2actions",
3+
scripts=[
4+
"bin/st2actionrunner",
5+
"bin/st2notifier",
6+
"bin/st2workflowengine",
7+
"bin/st2scheduler",
8+
"bin/runners.sh:shell", # used by service files installed by st2-packaging
9+
],
10+
)

st2api/BUILD

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
st2_component_python_distribution(
2+
component_name="st2api",
3+
scripts=["bin/st2api"],
4+
)

st2auth/BUILD

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

st2client/BUILD

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

st2common/BUILD

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
st2_component_python_distribution(
2+
component_name="st2common",
3+
scripts=[
4+
# some scripts in bin are only for development and should not be included.
5+
"bin/st2-bootstrap-rmq",
6+
"bin/st2-cleanup-db",
7+
"bin/st2-register-content",
8+
"bin/st2-purge-executions",
9+
"bin/st2-purge-workflows",
10+
"bin/st2-purge-task-executions",
11+
"bin/st2-purge-tokens",
12+
"bin/st2-purge-trigger-instances",
13+
"bin/st2-purge-traces",
14+
"bin/st2-purge-rule-enforcements",
15+
"bin/st2-generate-symmetric-crypto-key",
16+
"bin/st2-track-result",
17+
"bin/st2-validate-pack",
18+
"bin/st2-validate-pack-config",
19+
"bin/st2-pack-install",
20+
"bin/st2-pack-download",
21+
"bin/st2-pack-setup-virtualenv",
22+
"bin/migrations/v3.5/st2-migrate-db-dict-field-values",
23+
"bin/st2-run-pack-tests:shell",
24+
"bin/st2ctl:shell",
25+
"bin/st2-self-check:shell",
26+
# dev scripts we might want to include
27+
# "bin/st2-generate-schemas",
28+
],
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+
},
39+
)

st2common/bin/st2-purge-task-executions

100644100755
File mode changed.

st2common/bin/st2-purge-workflows

100644100755
File mode changed.

st2reactor/BUILD

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
st2_component_python_distribution(
2+
component_name="st2reactor",
3+
scripts=[
4+
"bin/st2-rule-tester",
5+
"bin/st2-trigger-refire",
6+
"bin/st2rulesengine",
7+
"bin/st2sensorcontainer",
8+
"bin/st2garbagecollector",
9+
"bin/st2timersengine",
10+
],
11+
)

0 commit comments

Comments
 (0)