Skip to content

Commit 645ec33

Browse files
authored
Merge pull request #326 from edavidaja/patch-1
2 parents d4d328f + 4d3c97f commit 645ec33

File tree

5 files changed

+13
-17
lines changed

5 files changed

+13
-17
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,15 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## [Unreleased]
8+
9+
### Removed
10+
11+
- `rsconnect-python` no longer considers the `RETICULATE_PYTHON` environment variable.
12+
In environments where `RETICULATE_PYTHON` is set outside a project context (e.g. by a Posit Workbench administrator),
13+
attempting to deploy content or write manifests in projects using virtual environments required explicitly setting `--python /path/to/virtualenv/python`.
14+
Removing `RETICULATE_PYTHON` detection should simplify the use of the CLI in this case.
15+
716
## [1.13.0] - 2022-12-02
817

918
### Added

README.md

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -220,8 +220,7 @@ specified package list.
220220

221221
If there is no `requirements.txt` file or the `--force-generate` option is specified,
222222
the package dependencies will be determined from the current Python environment, or
223-
from an alternative Python executable specified via the `--python` option or via the
224-
`RETICULATE_PYTHON` environment variable:
223+
from an alternative Python executable specified via the `--python` option:
225224

226225
```bash
227226
rsconnect deploy notebook --python /path/to/python my-notebook.ipynb
@@ -255,8 +254,7 @@ in a later deployment. Use the `write-manifest` command to do this.
255254
The `write-manifest` command will also create a `requirements.txt` file, if it does
256255
not already exist or the `--force-generate` option is specified. It will contain the
257256
package dependencies from the current Python environment, or from an alternative
258-
Python executable specified in the `--python` option or via the `RETICULATE_PYTHON`
259-
environment variable.
257+
Python executable specified in the `--python` option.
260258

261259
Here is an example of the `write-manifest` command:
262260

@@ -349,8 +347,7 @@ the specified package list.
349347

350348
If there is no `requirements.txt` file or the `--force-generate` option is specified,
351349
the package dependencies will be determined from the current Python environment, or
352-
from an alternative Python executable specified via the `--python` option or via the
353-
`RETICULATE_PYTHON` environment variable:
350+
from an alternative Python executable specified via the `--python` option:
354351

355352
```bash
356353
rsconnect deploy api --python /path/to/python my-api/
@@ -371,8 +368,7 @@ manifest in a later deployment. Use the `write-manifest` command to do this.
371368
The `write-manifest` command will also create a `requirements.txt` file, if it does
372369
not already exist or the `--force-generate` option is specified. It will contain
373370
the package dependencies from the current Python environment, or from an alternative
374-
Python executable specified in the `--python` option or via the `RETICULATE_PYTHON`
375-
environment variable.
371+
Python executable specified in the `--python` option.
376372

377373
Here is an example of the `write-manifest` command:
378374

rsconnect/actions.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,6 @@ def which_python(python, env=os.environ):
113113
114114
In priority order:
115115
* --python specified on the command line
116-
* RETICULATE_PYTHON defined in the environment
117116
* the python binary running this script
118117
"""
119118
warn("This method has been moved and will be deprecated.", DeprecationWarning, stacklevel=2)
@@ -122,9 +121,6 @@ def which_python(python, env=os.environ):
122121
raise RSConnectException('The file, "%s", does not exist or is not executable.' % python)
123122
return python
124123

125-
if "RETICULATE_PYTHON" in env:
126-
return os.path.expanduser(env["RETICULATE_PYTHON"])
127-
128124
return sys.executable
129125

130126

rsconnect/bundle.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1080,17 +1080,13 @@ def which_python(python, env=os.environ):
10801080
10811081
In priority order:
10821082
* --python specified on the command line
1083-
* RETICULATE_PYTHON defined in the environment
10841083
* the python binary running this script
10851084
"""
10861085
if python:
10871086
if not (exists(python) and os.access(python, os.X_OK)):
10881087
raise RSConnectException('The file, "%s", does not exist or is not executable.' % python)
10891088
return python
10901089

1091-
if "RETICULATE_PYTHON" in env:
1092-
return os.path.expanduser(env["RETICULATE_PYTHON"])
1093-
10941090
return sys.executable
10951091

10961092

tests/test_bundle.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -652,7 +652,6 @@ def test_which_python(self):
652652

653653
self.assertEqual(which_python(sys.executable), sys.executable)
654654
self.assertEqual(which_python(None), sys.executable)
655-
self.assertEqual(which_python(None, {"RETICULATE_PYTHON": "fake-python"}), "fake-python")
656655

657656
def test_default_title(self):
658657
self.assertEqual(_default_title("testing.txt"), "testing")

0 commit comments

Comments
 (0)