able-petabyte-69664
10/06/2024, 12:41 PMfast-nail-55400
10/06/2024, 3:25 PMfast-nail-55400
10/06/2024, 3:25 PM./pants export
to produce a virtual environment from your code and requirements and point the IDE at it.fast-nail-55400
10/06/2024, 3:26 PMfast-nail-55400
10/06/2024, 3:27 PM--export-py-generated-sources-in-resolve
option so the generated sources are also written to the venv. https://www.pantsbuild.org/stable/reference/goals/export#py_generated_sources_in_resolveable-petabyte-69664
10/06/2024, 7:13 PM~/.cache/pants
I don't have the folder pants_dev_deps
. Instead that
/home/acme/.cache/pants
❯ ls
lmdb_store named_caches
Am I doing something wrong?able-petabyte-69664
10/06/2024, 7:19 PMable-petabyte-69664
10/06/2024, 8:08 PM❯ pants export resolve
Unknown goal: resolve
Use pants help
to get help.
Use pants help goals
to list goals.able-petabyte-69664
10/06/2024, 8:09 PMable-petabyte-69664
10/06/2024, 8:15 PMfast-nail-55400
10/06/2024, 9:28 PMpython-default
)fast-nail-55400
10/06/2024, 9:29 PMpython-default
, you would run pants export --resolve=python-default
fast-nail-55400
10/06/2024, 9:29 PMpy_generated_sources_in_resolve
option you would put python-default
as the name of the resolve for which you wanted to include generated sourcesfast-nail-55400
10/06/2024, 9:31 PMfast-nail-55400
10/06/2024, 9:32 PMable-petabyte-69664
10/07/2024, 11:11 AMpants export --resolve=python-default
it generates:
pants export --resolve=python-default
13:00:32.80 [INFO] Completed: Build pex for resolve `python-default`
13:01:20.03 [INFO] Completed: Get interpreter version
13:01:20.85 [INFO] Completed: Building mypy_protobuf.pex from <resource://pants.backend.codegen.protobuf.python/mypy_protobuf.lock>
Wrote mutable virtualenv for python-default (using Python 3.12.5) to dist/export/python/virtualenvs/python-default/3.12.5
As you can see on the output above, the virtualenv has been created in the different folder instead in the .~/.cache/pants
Is this ok?fast-nail-55400
10/07/2024, 1:11 PMdist/
fast-nail-55400
10/07/2024, 1:11 PMpants package
as well for example)fast-nail-55400
10/07/2024, 1:14 PMPYTHONPATH
in a .env
file in root of your repo to include that venv so VSCode can see the exported venv.able-petabyte-69664
10/07/2024, 6:09 PMfast-nail-55400
10/07/2024, 6:22 PMMaybe we should improve the document for beginners.I agree. Would you like to contribute the PR? 🙂 Should be straightforward to do since the docs are just markdown files in the repository at https://github.com/pantsbuild/pants/tree/main/docs/docs.
able-petabyte-69664
10/07/2024, 6:46 PMproud-policeman-38871
11/08/2024, 8:37 AM3rdparty/python
contents please?
I have BUILD
and requirements.txt
there, and an empty default.lock
. When I run pants export --resolve=python-default
the resulting venv under dist/export/python/virtualenvs/python-default/3.12.7
doesn't contain the libraries in my requirements.txt
fileproud-policeman-38871
11/08/2024, 9:26 AMpants generate-lockfiles
- after doing this, my venv contains the libraries