quiet-evening-25363
04/22/2022, 8:27 PMquiet-evening-25363
04/22/2022, 8:28 PM[python]
interpreter_constraints = ["CPython==3.9.*"]
enable_resolves = true
default_resolve = "default"
[python.resolves]
default = "3rdparty/python/default.lock"
beam = "3rdparty/python/beam.lock"
3rdparty/python/BUILD:
python_requirement(
name="psycopg2",
requirements=["psycopg2==2.9.3"],
resolve="default",
)
python_requirement(
name="psycopg2-binary",
requirements=["psycopg2-binary==2.9.3"],
resolve="beam",
)
src/where/I'm/using/the/beam/lockfile/BUILD
python_sources(
dependencies=[
"3rdparty/python#google-cloud-storage",
],
resolve="beam",
)
pex_binary(
name="search_index_main",
entry_point="main.py",
dependencies=[
"3rdparty/python#google-cloud-storage",
],
resolve="beam",
)
hundreds-father-404
04/22/2022, 9:36 PMquiet-evening-25363
04/22/2022, 9:49 PMhundreds-father-404
04/22/2022, 10:11 PM# normal one you had
python_requirements()
python_requirements(
name="beam",
resolve="beam"
)
In 2.11, you can still do that, or you can use the new parametrize mechanism https://www.pantsbuild.org/v2.11/docs/targets#parametrizing-targets
python_requirements(resolve=parametrize("beam", "default-resolve"))
hundreds-father-404
04/22/2022, 10:14 PMsrc/where/I'm/using/the/beam/lockfile:search_index_main
, e.g. python_sources
targets. If that code should work with both of your resolves, then you either need to use parametrize
or manually create 2 targetshundreds-father-404
04/22/2022, 10:16 PM2.11Latest release is 2.11.0rc3. We are hoping to stabilize next week If you are upgrading, you will see a deprecation message about the lock file generator. I recommend sticking w/ poetry in the short term while you play w/ multiple lockfiles to minimize changes
quiet-evening-25363
04/22/2022, 10:22 PMhundreds-father-404
04/22/2022, 10:25 PM