Skip to content

Commit

Permalink
Merge pull request #5909: Pants: add python_distribution BUILD meta…
Browse files Browse the repository at this point in the history
…data for st2* components
  • Loading branch information
cognifloyd authored Mar 2, 2023
2 parents cd8bb4c + 083fd00 commit 7fe538a
Show file tree
Hide file tree
Showing 12 changed files with 91 additions and 1 deletion.
2 changes: 1 addition & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Added
to pants' use of PEX lockfiles. This is not a user-facing addition.
#5778 #5789 #5817 #5795 #5830 #5833 #5834 #5841 #5840 #5838 #5842 #5837 #5849 #5850
#5846 #5853 #5848 #5847 #5858 #5857 #5860 #5868 #5871 #5864 #5874 #5884 #5893 #5891
#5890 #5898 #5901 #5906 #5899 #5907
#5890 #5898 #5901 #5906 #5899 #5907 #5909
Contributed by @cognifloyd

* Added a joint index to solve the problem of slow mongo queries for scheduled executions. #5805
Expand Down
2 changes: 2 additions & 0 deletions pants-plugins/macros.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,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
10 changes: 10 additions & 0 deletions st2actions/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
st2_component_python_distribution(
component_name="st2actions",
scripts=[
"bin/st2actionrunner",
"bin/st2notifier",
"bin/st2workflowengine",
"bin/st2scheduler",
"bin/runners.sh:shell", # used by service files installed by st2-packaging
],
)
4 changes: 4 additions & 0 deletions st2api/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
st2_component_python_distribution(
component_name="st2api",
scripts=["bin/st2api"],
)
9 changes: 9 additions & 0 deletions st2auth/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
st2_component_python_distribution(
component_name="st2auth",
scripts=["bin/st2auth"],
entry_points={
stevedore_namespace("st2auth.sso.backends"): {
"noop": "st2auth.sso.noop:NoOpSingleSignOnBackend",
},
},
)
8 changes: 8 additions & 0 deletions st2client/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
st2_component_python_distribution(
component_name="st2client",
entry_points={
"console_scripts": {
"st2": "st2client.shell:main",
},
},
)
39 changes: 39 additions & 0 deletions st2common/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
st2_component_python_distribution(
component_name="st2common",
scripts=[
# some scripts in bin are only for development and should not be included.
"bin/st2-bootstrap-rmq",
"bin/st2-cleanup-db",
"bin/st2-register-content",
"bin/st2-purge-executions",
"bin/st2-purge-workflows",
"bin/st2-purge-task-executions",
"bin/st2-purge-tokens",
"bin/st2-purge-trigger-instances",
"bin/st2-purge-traces",
"bin/st2-purge-rule-enforcements",
"bin/st2-generate-symmetric-crypto-key",
"bin/st2-track-result",
"bin/st2-validate-pack",
"bin/st2-validate-pack-config",
"bin/st2-pack-install",
"bin/st2-pack-download",
"bin/st2-pack-setup-virtualenv",
"bin/migrations/v3.5/st2-migrate-db-dict-field-values",
"bin/st2-run-pack-tests:shell",
"bin/st2ctl:shell",
"bin/st2-self-check:shell",
# 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",
},
},
)
Empty file modified st2common/bin/st2-purge-task-executions
100644 → 100755
Empty file.
Empty file modified st2common/bin/st2-purge-workflows
100644 → 100755
Empty file.
11 changes: 11 additions & 0 deletions st2reactor/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
st2_component_python_distribution(
component_name="st2reactor",
scripts=[
"bin/st2-rule-tester",
"bin/st2-trigger-refire",
"bin/st2rulesengine",
"bin/st2sensorcontainer",
"bin/st2garbagecollector",
"bin/st2timersengine",
],
)
4 changes: 4 additions & 0 deletions st2stream/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
st2_component_python_distribution(
component_name="st2stream",
scripts=["bin/st2stream"],
)
3 changes: 3 additions & 0 deletions st2tests/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
st2_component_python_distribution(
component_name="st2tests",
)

0 comments on commit 7fe538a

Please sign in to comment.