Skip to content

Commit e9df91d

Browse files
committed
inform pants about 3rd party dependencies and constraints
1 parent 2b4e359 commit e9df91d

File tree

6 files changed

+215
-4
lines changed

6 files changed

+215
-4
lines changed

BUILD

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,42 @@
11
python_requirements(
2-
name="root",
2+
name="reqs",
3+
source="requirements-pants.txt",
4+
module_mapping={
5+
"gitpython": ["git"],
6+
"python-editor": ["editor"],
7+
"python-json-logger": ["pythonjsonlogger"],
8+
"python-statsd": ["statsd"],
9+
"sseclient-py": ["sseclient"],
10+
"oslo.config": ["oslo_config"],
11+
"RandomWords": ["random_words"],
12+
},
13+
overrides={
14+
# flex uses pkg_resources w/o declaring the dep
15+
"flex": {
16+
"dependencies": [
17+
"//:reqs#setuptools",
18+
]
19+
},
20+
# do not use the prance[flex] extra as that pulls in an old version of flex
21+
"prance": {
22+
"dependencies": [
23+
"//:reqs#flex",
24+
]
25+
},
26+
# stevedore uses pkg_resources w/o declaring the dep
27+
"stevedore": {
28+
"dependencies": [
29+
"//:reqs#setuptools",
30+
]
31+
},
32+
# tooz needs one or more backends (tooz is used by the st2 coordination backend)
33+
"tooz": {
34+
"dependencies": [
35+
"//:reqs#redis",
36+
"//:reqs#zake",
37+
]
38+
},
39+
},
340
)
441

542
python_test_utils(

contrib/core/BUILD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ python_sources()
33
python_requirements(
44
name="reqs",
55
source="requirements-tests.txt",
6+
module_mapping={"mail-parser": ["mailparser"]},
67
)

contrib/runners/winrm_runner/BUILD

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
python_requirement(
2+
name="winrm",
3+
requirements=["pywinrm"],
4+
modules=["winrm"],
5+
)

lockfiles/st2-constraints.txt

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# Add/remove version constraints for transitive dependencies in this file
2+
# (transitive dependencies are dependencies of our direct dependencies).
3+
# Then run `./pants generate-lockfiles --resolve=st2` to regenerate the lockfile.
4+
#
5+
# Direct dependencies should be recorded in `requirements-pants.txt`, not here.
6+
7+
# ############################################ #
8+
# pinned transitive deps from requirements.txt #
9+
# ############################################ #
10+
#
11+
# required by jinja2:
12+
# fixed-requirements.txt:
13+
# Fix MarkupSafe to < 2.1.0 as 2.1.0 removes soft_unicode
14+
# >=0.23 was from jinja2
15+
MarkupSafe<2.1.0,>=0.23
16+
#
17+
# required by kombu:
18+
#amqp==5.0.6
19+
#
20+
# required by cryptography, paramiko, passlib:
21+
#bcrypt==3.2.0
22+
#
23+
# required by bcrypt, cryptography, pynacl, zstandard:
24+
#cffi<1.15.0
25+
#
26+
# required by orquesta, prance, requests:
27+
# fixed-requirements.txt:
28+
# requests 2.23 requires chardet < 3.1.0
29+
#chardet<3.1.0
30+
#
31+
# required by jsonpath-rw, networkx:
32+
# fixed-requireements.txt:
33+
# networkx requires decorator>=4.3,<5 which should resolve to version 4.4.2
34+
# but the wheel on pypi does not say it supports python3.8, so pip gets
35+
# confused. For now, pin decorator to work around pip's confusion.
36+
#decorator==4.4.2
37+
#
38+
# required by eventlet, pymongo:
39+
# fixed-requireements.txt:
40+
# NOTE: 2.0 version breaks pymongo work with hosts
41+
#dnspython>=1.16.0,<2.0.0
42+
#
43+
# required by eventlet:
44+
#greenlet==1.0.0
45+
#
46+
# required by argcomplete, click, debtcollector, kombu, pluggy, prettytable,
47+
# pytest, virtualenv:
48+
#importlib-metadata==3.10.1
49+
#
50+
# required by tooz:
51+
#oslo.utils<5.0,>=4.0.0
52+
#tenacity>=3.2.1,<7.0.0
53+
#
54+
# required by st2-auth-backend-flat-file:
55+
#passlib==1.7.4
56+
#
57+
# required by pymongo, urllib3:
58+
# fixed-requireements.txt:
59+
# pyOpenSSL 22.0.0 requires cryptography>=35.0
60+
#pyOpenSSL<=21.0.0
61+
#
62+
# required by oslo.utils, packaging:
63+
#pyparsing<3
64+
#
65+
# required by gitpython, importlib-metadata:
66+
# fixed-requireements.txt:
67+
# importlib-metadata requires typing-extensions but v4.2.0 requires py3.7+
68+
#typing-extensions<4.2

pants.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ pants_ignore.add = [
3535
"st2common/tests/fixtures/requirements-used-for-tests.txt",
3636
"/fixed-requirements.txt",
3737
"/test-requirements.txt",
38-
# keep requirements.txt for now. We might ignore it if we need an alternate interrim
39-
# file that is decoupled from our legacy requirements files generation.
40-
# "/requirements.txt",
38+
# ignore requirements.txt for now, preferring interrim files that are decoupled from
39+
# legacy requirements files generation: requirements-pants.txt & lockfiles/st2-constraints.txt
40+
"/requirements.txt",
4141
]
4242

4343
[source]

requirements-pants.txt

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
# Add/remove direct 3rd party dependencies here, with version constraints if necessary.
2+
# Then run `./pants generate-lockfiles --resolve=st2` to regenerate the lockfile.
3+
#
4+
# Please do not add transitive dependencies in this file (ie dependencies of our dependencies).
5+
# Use `lockfiles/st2-constraints.txt` to constrain the version of these transitive dependencies.
6+
#
7+
# Please keep this list alphabetical, with tooz backends in a separate list.
8+
9+
apscheduler
10+
argcomplete
11+
ciso8601
12+
cryptography
13+
# eventlet 0.31+ and gunicorn 20.1.0 are not compatible
14+
eventlet<0.31
15+
# flex parses the openapi 2 spec in our router
16+
flex
17+
# gitpython & gitdb are used for pack management
18+
gitdb
19+
gitpython
20+
gunicorn
21+
jinja2
22+
jsonpath-rw
23+
jsonschema
24+
kombu
25+
lockfile
26+
mock
27+
mongoengine
28+
# Note: networkx v2.6 dropped support for Python3.6
29+
# networkx version is constrained in orquesta.
30+
networkx
31+
orjson
32+
orquesta @ git+https://github.com/StackStorm/[email protected]
33+
# NOTE: Recent version substantially affect the performance and add big import time overhead
34+
# See https://github.com/StackStorm/st2/issues/4160#issuecomment-394386433 for details
35+
oslo.config>=1.12.1,<1.13
36+
paramiko
37+
# prance is used by st2-validate-api-spec to validate the openapi spec
38+
# prance needs flex, but do not use the extra as that gets an old version.
39+
prance
40+
prettytable
41+
# For st2client: prompt-toolkit v2+ does not have prompt_toolkit.token.Token
42+
prompt-toolkit<2
43+
psutil
44+
pymongo
45+
# pyrabbit used in an integration test
46+
pyrabbit
47+
pytest
48+
python-dateutil
49+
python-editor
50+
# pythonjsonlogger referenced in st2actions/conf/logging.conf
51+
python-json-logger
52+
python-statsd
53+
pytz
54+
PyYAML
55+
# RandomWords used in some tests
56+
RandomWords
57+
requests[security]
58+
retrying
59+
routes
60+
semver
61+
# setuptools provides pkg_resources
62+
setuptools
63+
simplejson
64+
six
65+
# NOTE: we use sseclient-py instead of sseclient because sseclient
66+
# has various issues which sometimes hang the connection for a long time, etc.
67+
sseclient-py
68+
# bandit doesn't work w/ stevedore 3+
69+
stevedore<3
70+
# For backward compatibility reasons, flat file backend is installed by default
71+
st2-auth-backend-flat-file @ git+https://github.com/StackStorm/st2-auth-backend-flat-file.git@master
72+
st2-auth-ldap @ git+https://github.com/StackStorm/st2-auth-ldap.git@master
73+
st2-rbac-backend @ git+https://github.com/StackStorm/st2-rbac-backend.git@master
74+
# tabulate used by tools/log_watcher.py
75+
tabulate
76+
tooz
77+
udatetime
78+
ujson
79+
unittest2
80+
virtualenv
81+
webob
82+
webtest
83+
# zstandard is used for micro benchmarks
84+
zstandard
85+
86+
# tooz backends
87+
redis
88+
zake
89+
90+
# was in fixed-requirements.txt, but not in requirements-pants.txt
91+
# keyczar is used by a python2-only test.
92+
#python-keyczar
93+
94+
###########
95+
96+
# not needed with switch to pytest
97+
#nose
98+
#nose-timer
99+
#nose-parallel
100+
#rednose

0 commit comments

Comments
 (0)