cold-sugar-54376
09/08/2022, 8:51 PMenough-analyst-54434
09/08/2022, 8:56 PM--path-mapping
for just this case for a long time now, Pants just picked up support in https://github.com/pantsbuild/pants/pull/16625cold-sugar-54376
09/08/2022, 11:03 PMfuture-oxygen-10553
09/09/2022, 3:48 PM%(buildroot)
pre-2.14? For example,
[python-repos]
# Use an absolute path to a directory containing `.whl` and/or sdist files.
find_links = ["file://%(buildroot)/dist"]
enough-analyst-54434
09/09/2022, 5:04 PMcold-sugar-54376
10/31/2022, 8:25 PMfind_links = ["file://%(buildroot)s/prebuilt_wheels",]
path_mappings = ["WHEELS_DIR|%(buildroot)s/prebuilt_wheels"]
enough-analyst-54434
10/31/2022, 8:27 PMfile://
prefix in find_links
.cold-sugar-54376
10/31/2022, 8:28 PMenough-analyst-54434
10/31/2022, 8:36 PMcold-sugar-54376
10/31/2022, 8:48 PM"path_mappings": {
"WHEELS_DIR": null
},
enough-analyst-54434
10/31/2022, 8:59 PM./pants generate-lockfiles -ldebug
and look for the command line including the word universal
? That will tell us if Pants hand's off badly to Pex or if Pex fumbles.cold-sugar-54376
10/31/2022, 9:11 PM14:11:59.35 [DEBUG] spawned local process as Some(26736) for Process { argv: ["/Users/ashu/.pyenv/versions/3.10.3/bin/python", "./pex", "lock", "create", "--tmpdir", ".tmp", "--python-path", "/Users/ashu/.pyenv/versions/3.10.3/bin:/Users/ashu/.pyenv/versions/3.8.12/bin:/Users/ashu/.pyenv/versions/3.9.10/bin:/Users/ashu/.pyenv/versions/3.9.11/bin:/Users/ashu/.pyenv/versions/3.9.12/bin:/opt/python3", "--output=lock.json", "--no-emit-warnings", "--style=universal", "--resolver-version", "pip-2020-resolver", "--target-system", "linux", "--target-system", "mac", "--indent=2", "--no-pypi", "--index=<https://pypi.org/simple/>", "--find-links=file:///Users/ashu/Documents/backend/prebuilt_wheels", "--manylinux", "manylinux2014", "--path-mapping=WHEELS_DIR|/Users/ashu/Documents/backend/prebuilt_wheels", "--interpreter-constraint", "CPython==3.9.10", "pytest==7.0.1", "pytest-cov>=2.12,!=2.12.1,<3.1", "pytest-xdist>=2.5,<3", "fakeredis[lupa]", "freezegun", "pytest-asyncio", "pytest-django", "pytest-env", "pytest-freezegun", "pytest-mock"], env: {"CPPFLAGS": "-I/opt/homebrew/opt/openssl/include -I/opt/homebrew/opt/openblas/include", "GRPC_PYTHON_BUILD_SYSTEM_OPENSSL": "1", "LANG": "en_US.UTF-8", "LDFLAGS": "-L/opt/homebrew/opt/openssl/lib -L/opt/homebrew/opt/openblas/lib", "PATH": "/Users/ashu/.pyenv/shims:/Users/ashu/.yarn/bin:/Users/ashu/.config/yarn/global/node_modules/.bin:/Users/ashu/.nvm/versions/node/v14.17.6/bin:/Users/ashu/.go/bin:/opt/homebrew/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/go/bin", "PEX_IGNORE_RCFILES": "true", "PEX_PYTHON_PATH": "/Users/ashu/.pyenv/versions/3.10.3/bin:/Users/ashu/.pyenv/versions/3.8.12/bin:/Users/ashu/.pyenv/versions/3.9.10/bin:/Users/ashu/.pyenv/versions/3.9.11/bin:/Users/ashu/.pyenv/versions/3.9.12/bin:/opt/python3", "PEX_ROOT": ".cache/pex_root", "PEX_SCRIPT": "pex3"}, working_directory: None, input_digests: InputDigests { complete: DirectoryDigest { digest: Digest { hash: Fingerprint<17cfe36e90b7216296f0651d9c72ef150c00d24bb1b99c8fe07134012366ce0b>, size_bytes: 158 }, tree: "Some(..)" }, nailgun: DirectoryDigest { digest: Digest { hash: Fingerprint<e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855>, size_bytes: 0 }, tree: "Some(..)" }, input_files: DirectoryDigest { digest: Digest { hash: Fingerprint<17cfe36e90b7216296f0651d9c72ef150c00d24bb1b99c8fe07134012366ce0b>, size_bytes: 158 }, tree: "Some(..)" }, immutable_inputs: {}, use_nailgun: {} }, output_files: {RelativePath("lock.json")}, output_directories: {}, timeout: None, execution_slot_variable: None, concurrency_available: 0, description: "Generate lockfile for pytest", level: Info, append_only_caches: {CacheName("pex_root"): RelativePath(".cache/pex_root")}, jdk_home: None, platform_constraint: None, cache_scope: PerSession, remote_cache_speculation_delay: 0ns }
enough-analyst-54434
10/31/2022, 10:38 PM--path-mapping=WHEELS_DIR|/Users/ashu/Documents/backend/prebuilt_wheels
looks like Pants is doing the right thing when creating the lock. You say, though that the lock file json has a path_mappings with null valued entries?cold-sugar-54376
10/31/2022, 10:40 PMenough-analyst-54434
10/31/2022, 10:41 PMcold-sugar-54376
10/31/2022, 10:44 PMpip wheel
is non-deterministic, which is annoyingenough-analyst-54434
10/31/2022, 10:50 PMpip wheel
but worth a quick try."path_mappings": {
"WHEELS_DIR": "XYZ Corp standard wheels.",
"ML_WHEELS_DIR": "XYZ Corp GPU-specific wheels."
}