Skip to content

Commit

Permalink
Use a constraints file in this repo. (#10579)
Browse files Browse the repository at this point in the history
We'll be encouraging users to do so, so we should dogfood.

[ci skip-rust]
[ci skip-build-wheels]
  • Loading branch information
benjyw committed Aug 10, 2020
1 parent 449f4b3 commit 57a4745
Show file tree
Hide file tree
Showing 10 changed files with 55 additions and 17 deletions.
33 changes: 33 additions & 0 deletions 3rdparty/python/constraints.txt
@@ -0,0 +1,33 @@
# Generated by build-support/bin/generate_lockfile.sh on Mon Aug 10 13:36:18 EDT 2020
ansicolors==1.1.8
beautifulsoup4==4.6.3
certifi==2020.6.20
cffi==1.14.1
chardet==3.0.4
cryptography==3.0
dataclasses==0.6
fasteners==0.15
idna==2.10
monotonic==1.5
mypy==0.782
mypy-extensions==0.4.3
packaging==20.4
pathspec==0.8.0
pex==2.1.14
pip==19.0.3
psutil==5.7.0
pycparser==2.20
pyOpenSSL==19.1.0
pyparsing==2.4.7
pystache==0.5.4
python-Levenshtein==0.12.0
PyYAML==5.3.1
requests==2.24.0
setproctitle==1.1.10
setuptools==49.2.0
six==1.15.0
toml==0.10.1
typed-ast==1.4.1
typing-extensions==3.7.4.2
urllib3==1.25.10
www-authenticate==0.9.2
11 changes: 11 additions & 0 deletions build-support/bin/generate_lockfile.sh
@@ -0,0 +1,11 @@
#!/usr/bin/env bash

set -euo pipefail

constraints_file=3rdparty/python/constraints.txt

VENV=$(mktemp -d -t pants_lockfile_venv.XXXXX)
python3 -m venv "${VENV}"
"${VENV}/bin/pip" install -r <(./pants --tag=-lockfile_ignore dependencies --type=3rdparty ::)
echo "# Generated by build-support/bin/generate_lockfile.sh on $(date)" > "${constraints_file}"
"${VENV}/bin/pip" freeze --all >> "${constraints_file}"
5 changes: 2 additions & 3 deletions pants.toml
Expand Up @@ -52,9 +52,8 @@ root_patterns = [
]

[python-setup]
# TODO: Set up an actual lockfile. For now we just "lock" our requirements.txt to itself,
# so we can use --python-setup-resolve-all-constraints (which requires a lockfile).
requirement_constraints = "3rdparty/python/requirements.txt"
requirement_constraints = "3rdparty/python/constraints.txt"
resolve_all_constraints = true

[black]
config = "pyproject.toml"
Expand Down
8 changes: 0 additions & 8 deletions pants.travis-ci.toml
@@ -1,9 +1,3 @@
[DEFAULT]
# If we use typical default process parallelism tied to core count, we see too many cores under
# travis and either get oomkilled from launching too many processes with too much total memory
# overhead or else just generally thrash the container and slow things down.
travis_parallelism = 4

[GLOBAL]
# Override color support detection - we want colors and Travis supports them.
colors = true
Expand All @@ -14,8 +8,6 @@ dynamic_ui = false
# now in order to smooth off rough edges locally.
pantsd = false

process_execution_local_parallelism = "%(travis_parallelism)s"

[python-setup]
# TODO: See https://github.com/pantsbuild/pants/issues/9964
resolver_jobs = 2
Expand Down
2 changes: 1 addition & 1 deletion src/python/pants/backend/python/typecheck/mypy/BUILD
Expand Up @@ -6,5 +6,5 @@ python_library()
python_integration_tests(
name='integration',
uses_pants_run=False,
timeout=180,
timeout=300,
)
2 changes: 1 addition & 1 deletion src/python/pants/base/BUILD
Expand Up @@ -40,5 +40,5 @@ python_integration_tests(
'testprojects/src/python:unicode_directory',
],
uses_pants_run=True,
timeout=120,
timeout=180,
)
2 changes: 1 addition & 1 deletion src/python/pants/init/BUILD
Expand Up @@ -30,5 +30,5 @@ python_integration_tests(
name="integration",
uses_pants_run=True,
# TODO(#10504): Lower this to ~120 once fixed.
timeout=450,
timeout=600,
)
Expand Up @@ -13,5 +13,6 @@ python_distribution(
namespace_packages=[
'test_pants_plugin',
],
)
),
tags=['lockfile_ignore'],
)
3 changes: 2 additions & 1 deletion testprojects/src/python/bad_requirements/BUILD
Expand Up @@ -5,11 +5,12 @@ python_requirement_library(
name='badreq',
requirements=[
python_requirement('badreq==99.99.99')
]
],
)

python_binary(
name='use_badreq',
dependencies=[':badreq'],
entry_point='bad_requirements.use_badreq',
tags=['lockfile_ignore'],
)
3 changes: 2 additions & 1 deletion tests/python/pants_test/integration/BUILD
Expand Up @@ -52,13 +52,14 @@ python_integration_tests(
'testprojects/tests/python/pants:build_parsing_directory',
],
uses_pants_run=True,
timeout = 180,
timeout = 240,
)

python_integration_tests(
name = 'prelude_integration',
sources = ['test_prelude_integration.py'],
uses_pants_run=True,
timeout = 180,
)

python_integration_tests(
Expand Down

0 comments on commit 57a4745

Please sign in to comment.