Skip to content

Commit 30ace11

Browse files
Go back to using resolves, but hedge about lockfile generation (#94)
Reverts #93. As discussed in https://pantsbuild.slack.com/archives/C0D7TNJHL/p1646948835870139, we believe that multiple resolves even with manual generation is still an improvement over `[python].requirement_constraints`. The hope is that most users can use `generate-lockfiles` directly, but if not, our new docs continue to give some techniques for manual lockfile generation. Our 2.10 docs no longer discuss `requirement_constraints`, in favor of resolves.
1 parent 1ba1247 commit 30ace11

4 files changed

Lines changed: 35 additions & 27 deletions

File tree

build-support/generate_constraints.sh

Lines changed: 0 additions & 18 deletions
This file was deleted.

constraints.txt

Lines changed: 0 additions & 5 deletions
This file was deleted.

lockfile.txt

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# This lockfile was autogenerated by Pants. To regenerate, run:
2+
#
3+
# ./pants generate-lockfiles --resolve=python-default
4+
#
5+
# --- BEGIN PANTS LOCKFILE METADATA: DO NOT EDIT OR REMOVE ---
6+
# {
7+
# "version": 2,
8+
# "valid_for_interpreter_constraints": [
9+
# "CPython>=3.7"
10+
# ],
11+
# "generated_with_requirements": [
12+
# "ansicolors==1.1.8",
13+
# "setuptools<57,>=56.2.0",
14+
# "types-setuptools<58,>=56.2.0"
15+
# ]
16+
# }
17+
# --- END PANTS LOCKFILE METADATA ---
18+
19+
ansicolors==1.1.8 \
20+
--hash=sha256:00d2dde5a675579325902536738dd27e4fac1fd68f773fe36c21044eb559e187 \
21+
--hash=sha256:99f94f5e3348a0bcd43c82e5fc4414013ccc19d70bd939ad71e0133ce9c372e0
22+
setuptools==56.2.0; python_version >= "3.6" \
23+
--hash=sha256:bc30153eec47d82f20c6f5e1a13d4ee725c6deb7013a67557f89bfe5d25235c4 \
24+
--hash=sha256:7bb5652625e94e73b9358b7ed8c6431b732e80cf31f4e0972294c64f0e5b849e
25+
types-setuptools==57.4.9 \
26+
--hash=sha256:536ef74744f8e1e4be4fc719887f886e74e4cf3c792b4a06984320be4df450b5 \
27+
--hash=sha256:948dc6863373750e2cd0b223a84f1fb608414cde5e55cf38ea657b93aeb411d2

pants.toml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Licensed under the Apache License, Version 2.0 (see LICENSE).
33

44
[GLOBAL]
5-
pants_version = "2.10.0rc0"
5+
pants_version = "2.10.0rc3"
66
backend_packages.add = [
77
"pants.backend.python",
88
"pants.backend.python.lint.docformatter",
@@ -36,11 +36,15 @@ root_patterns = ["/"]
3636
# If you use Apple Silicon, set to a value like `>=3.9`.
3737
interpreter_constraints = [">=3.7"]
3838

39-
# Use a constraints file. See https://www.pantsbuild.org/docs/python-third-party-dependencies.
40-
requirement_constraints = "constraints.txt"
39+
# Enable the "resolves" mechanism, which turns on lockfiles for user code. See
40+
# https://www.pantsbuild.org/docs/python-third-party-dependencies. This also adds the
41+
# `generate-lockfiles` goal for Pants to generate the lockfile for you, although in some
42+
# situations you may need to manually generate it, as explained in the docs.
43+
enable_resolves = true
44+
resolves = { python-default = "lockfile.txt"}
4145

4246
[python-bootstrap]
43-
# We search for interpreters on both on the $PATH and in the `$(pyenv root)/versions` folder.
47+
# We search for interpreters both on the $PATH and in the `$(pyenv root)/versions` folder.
4448
# If you're using macOS, you may want to leave off the <PATH> entry to avoid using the
4549
# problematic system Pythons. See
4650
# https://www.pantsbuild.org/docs/python-interpreter-compatibility#changing-the-interpreter-search-path.

0 commit comments

Comments
 (0)