Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: fix code examples for
setting-up-ide
and `interpreter-compati…
…bility` docs (Cherry-pick of #19624) (#19638) ## Setting Up IDE Doc Issue Currently, in the `docs/markdown/Using Pants/setting-up-an-ide.md` page, the project instructs users to run ```shell $ ROOTS=$(pants roots --roots-sep=' ') $ python3 -c "print('PYTHONPATH=\"./' + ':./'.join(\"${ROOTS}\".split()) + ':\$PYTHONPATH\"')" > .env ``` However, for some reason, the command `pants roots --roots-sep=' '` is not working for the `' '` character. This PR makes a small fix to this issue changing the `' '` character to the default `'\n'` by removing the `--roots-sep=` argument and changing how the `ROOTS` environment variable is split. ```bash $ ROOTS=$(pants roots) $ python3 -c "print('PYTHONPATH=\"./' + ':./'.join('''${ROOTS}'''.split('\n')) + ':\$PYTHONPATH\"')" > .env ``` Alternatively, if we want to maintain the `roots-sep` argument, so users know it exists, we can change it from `' '` to a non whitespace character, such as `';'` and that also seems to work. ## Interpreter Compatibility Doc Issue Another small issue is in `docs/markdown/Python/python/python-interpreter-compatibility.md` in the example: ```python python_sources( name="lib", overrides={ "py2.py": {"interpreter_constraints": ["==2.7.*"]}, # You can use a tuple for multiple files: ("common.py", "f.py"): {"interpreter_constraints": ["==2.7.*"]}, ) ``` This example is missing an `}`. This PR also addresses this small issue. Co-authored-by: Mikael Souza <mikael.souza.cc@gmail.com>
- Loading branch information