Warning about --python and --override-python-version deprecation #655
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Intent
The intent is moving the user toward best practices of using a
.python-version
file when a specific version of Python has to be used to deploy the project. That relies on a standard way to specific version requirements and allows the requirement to be packaged/committed with the project thus making deploys reproducible.--override-python-version
option isn't needed anymore when.python-version
is supported and using it made the deploy unreproducible--python
option is confusing in itself, as it refers to the python interpreter used to runrsconnect
and on latest connect versions (>=2025.03) it doesn't influence the interpreter used to run the content anymore. The fact that it previously did was practically a side effect. Deprecating it gives the user a suggestion for a reliable and predictable way to specify the python interpreter.As the
--python
option does no longer influence the interpreter in use itself, but it's only used to detect the environment requirements, I made #656 to change the name to something that better conveys its purpose in the future.Type of Change
Approach
Add a deprecation message without disabling the existing option.
This will start suggesting users to embrace the best practice and give them time to migrate.
In the future we will be able to drop the options as users migrated away from them.
Automated Tests
Two tests were added asserting the the deprecation messages are correctly emitted
Directions for Reviewers
Checklist