quiet-army-59227
06/17/2024, 9:07 PMpants.* when you write custom plugins? I read the docs for setting up in an IDE but that is only for first party and third party plugins. It doesn't resolve this issuewide-midnight-78598
06/17/2024, 9:20 PM# In pants.toml
backend_packages = [
"pants.backend.plugin_development",
...
[python]
enable_resolves = true
interpreter_constraints = ["==3.9.*"]
tailor_pex_binary_targets = false
[python.resolves]
pants-plugins = "build-support/lockfiles/pants-plugins.lock"
python-default = "build-support/lockfiles/python-default.lock"
[python.resolves_to_interpreter_constraints]
pants-plugins = [">=3.9,<3.10"]
# In project/pants-plugins/BUILD
pants_requirements(name="pants", resolve="pants-plugins")
pants generate-lockfiles --resolve=pants-plugins # This is important if you've upgraded your pants version
pants export --resolve=pants-plugins
Wrote mutable virtualenv for pants-plugins (using Python 3.9.19) to dist/export/python/virtualenvs/pants-plugins/3.9.19
⬆️ Point VS code's interpreter at thatwide-midnight-78598
06/17/2024, 9:22 PM,vscode/settings.json
{
"python.analysis.packageIndexDepths": [
{
"name": "pants",
"depth": 5,
"includeAllSymbols": true
}
]
}
Not sure if this is still required, but it helped out a while backwide-midnight-78598
06/17/2024, 9:43 PMquiet-army-59227
06/18/2024, 7:11 PMquiet-army-59227
06/18/2024, 7:12 PMdist/export/python/virtualenvsquiet-army-59227
06/18/2024, 7:13 PMpython-default and pants-plugins. So I ran: pants export --py-resolve-format=symlinked_immutable_virtualenv --resolve=python-defaultquiet-army-59227
06/18/2024, 7:14 PMquiet-army-59227
06/18/2024, 7:14 PMquiet-army-59227
06/18/2024, 7:23 PMquiet-army-59227
06/18/2024, 7:24 PM.vscode/settings.json and it works for third-party dependencies, but it still doesn't work for pants.* imports when I make custom pants plugins
{
"python.analysis.extraPaths": [
"/home/akoul5/dev/python/pants_test_goal/dist/export/python/virtualenvs/python-default/3.10.12/lib64/python3.10/site-packages",
"/home/akoul5/dev/python/pants_test_goal/dist/export/python/virtualenvs/pants-plugins/3.10.12/lib64/python3.10/site-packages",
]
}wide-midnight-78598
06/18/2024, 7:26 PMquiet-army-59227
06/18/2024, 7:30 PMquiet-army-59227
06/18/2024, 7:30 PMwide-midnight-78598
06/18/2024, 7:37 PMquiet-army-59227
06/18/2024, 7:38 PMpants export when i export both my resolveswide-midnight-78598
06/18/2024, 7:39 PMquiet-army-59227
06/18/2024, 7:41 PMpants.* imports. First and third-party imports are workingquiet-army-59227
06/18/2024, 7:42 PM/.../pants_test_goal/dist/export/python/virtualenvs/python-default/3.10.12/lib64/python3.10/site-packagesquiet-army-59227
06/18/2024, 7:43 PMquiet-army-59227
06/18/2024, 7:44 PMwide-midnight-78598
06/18/2024, 7:47 PMquiet-army-59227
06/18/2024, 7:54 PMpants_requirements(name="pants", resolve="pants-plugins")wide-midnight-78598
06/18/2024, 7:55 PMbackend_packages?quiet-army-59227
06/18/2024, 7:55 PMwide-midnight-78598
06/18/2024, 7:58 PM[python.resolves_to_interpreter_constraints]
pants-plugins = [">=3.9,<3.10"]wide-midnight-78598
06/18/2024, 7:59 PMsource dist/export/.../bin/activate
pip freeze
pants isn't there?quiet-army-59227
06/18/2024, 8:00 PMwide-midnight-78598
06/18/2024, 8:02 PMwide-midnight-78598
06/18/2024, 8:02 PMquiet-army-59227
06/18/2024, 8:05 PMquiet-army-59227
06/18/2024, 8:06 PMsource dist/export/python/virtualenvs/pants-plugins/3.10.12/bin/activat I ran this and I can activate itquiet-army-59227
06/18/2024, 8:07 PMwide-midnight-78598
06/18/2024, 8:10 PMpip freeze - are the pants libs there, as expected?wide-midnight-78598
06/18/2024, 8:10 PMpantsbuild.pants==2.21.0
pantsbuild.pants.testutil==2.21.0quiet-army-59227
06/18/2024, 8:16 PMquiet-army-59227
06/18/2024, 8:16 PMquiet-army-59227
06/18/2024, 8:16 PMwide-midnight-78598
06/18/2024, 8:20 PMwide-midnight-78598
06/18/2024, 8:21 PMpants generate-lockfiles ::
pants export ::
?quiet-army-59227
06/18/2024, 8:21 PMquiet-army-59227
06/18/2024, 8:23 PMquiet-army-59227
06/18/2024, 8:23 PMquiet-army-59227
06/18/2024, 8:23 PMwide-midnight-78598
06/18/2024, 8:24 PMquiet-army-59227
06/18/2024, 8:25 PMquiet-army-59227
06/18/2024, 8:25 PMquiet-army-59227
06/18/2024, 8:27 PMquiet-army-59227
06/18/2024, 9:00 PMquiet-army-59227
06/18/2024, 9:00 PMwide-midnight-78598
06/18/2024, 9:02 PMquiet-army-59227
06/18/2024, 9:02 PM