Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Removed

- `rsconnect-python` no longer considers the `RETICULATE_PYTHON` environment variable.
In environments where `RETICULATE_PYTHON` is set outside a project context (e.g. by a Posit Workbench administrator),
attempting to deploy content or write manifests in projects using virtual environments required explicitly setting `--python /path/to/virtualenv/python`.
Removing `RETICULATE_PYTHON` detection should simplify the use of the CLI in this case.

## [1.13.0] - 2022-12-02

### Added
Expand Down
12 changes: 4 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,7 @@ specified package list.

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

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

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

Expand Down Expand Up @@ -349,8 +347,7 @@ the specified package list.

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

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

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

Expand Down
4 changes: 0 additions & 4 deletions rsconnect/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ def which_python(python, env=os.environ):

In priority order:
* --python specified on the command line
* RETICULATE_PYTHON defined in the environment
* the python binary running this script
"""
warn("This method has been moved and will be deprecated.", DeprecationWarning, stacklevel=2)
Expand All @@ -122,9 +121,6 @@ def which_python(python, env=os.environ):
raise RSConnectException('The file, "%s", does not exist or is not executable.' % python)
return python

if "RETICULATE_PYTHON" in env:
return os.path.expanduser(env["RETICULATE_PYTHON"])

return sys.executable


Expand Down
4 changes: 0 additions & 4 deletions rsconnect/bundle.py
Original file line number Diff line number Diff line change
Expand Up @@ -1080,17 +1080,13 @@ def which_python(python, env=os.environ):

In priority order:
* --python specified on the command line
* RETICULATE_PYTHON defined in the environment
* the python binary running this script
"""
if python:
if not (exists(python) and os.access(python, os.X_OK)):
raise RSConnectException('The file, "%s", does not exist or is not executable.' % python)
return python

if "RETICULATE_PYTHON" in env:
return os.path.expanduser(env["RETICULATE_PYTHON"])

return sys.executable


Expand Down
1 change: 0 additions & 1 deletion tests/test_bundle.py
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,6 @@ def test_which_python(self):

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

def test_default_title(self):
self.assertEqual(_default_title("testing.txt"), "testing")
Expand Down