Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: fix code examples for setting-up-ide and interpreter-compatibility docs (Cherry-pick of #19624) #19638

Merged
merged 1 commit into from Aug 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -55,6 +55,7 @@ python_sources(
"py2.py": {"interpreter_constraints": ["==2.7.*"]},
# You can use a tuple for multiple files:
("common.py", "f.py"): {"interpreter_constraints": ["==2.7.*"]},
}
)
```

Expand Down
4 changes: 2 additions & 2 deletions docs/markdown/Using Pants/setting-up-an-ide.md
Expand Up @@ -24,8 +24,8 @@ In VSCode, the Python extension will look for a file named `.env` in the current
For Python, to generate the `.env` file containing all the source roots, you can use something like this:

```shell
$ ROOTS=$(pants roots --roots-sep=' ')
$ python3 -c "print('PYTHONPATH=\"./' + ':./'.join(\"${ROOTS}\".split()) + ':\$PYTHONPATH\"')" > .env
$ ROOTS=$(pants roots)
$ python3 -c "print('PYTHONPATH=\"./' + ':./'.join('''${ROOTS}'''.split('\n')) + ':\$PYTHONPATH\"')" > .env
```

See [Use of the PYTHONPATH variable](https://code.visualstudio.com/docs/python/environments#_use-of-the-pythonpath-variable) to learn more about using the `PYTHONPATH` variable in VSCode.
Expand Down