Skip to content

Conversation

amol-
Copy link
Collaborator

@amol- amol- commented Apr 8, 2025

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.

  • The --override-python-version option isn't needed anymore when .python-version is supported and using it made the deploy unreproducible
  • The --python option is confusing in itself, as it refers to the python interpreter used to run rsconnect 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

  • Bug Fix
  • New Feature
  • Breaking 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

  • I have updated CHANGELOG.md to cover notable changes.
  • I have updated all related GitHub issues to reflect their current state.

Copy link

github-actions bot commented Apr 8, 2025

☂️ Python Coverage

current status: ✅

Overall Coverage

Lines Covered Coverage Threshold Status
4891 3673 75% 0% 🟢

New Files

No new covered files...

Modified Files

File Coverage Status
rsconnect/environment.py 86% 🟢
TOTAL 86% 🟢

updated for commit: 78bb2e5 by action🐍

@amol- amol- marked this pull request as ready for review April 8, 2025 13:44
Copy link
Contributor

@Lytol Lytol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wonderful! I noted a small copy edit to keep consistent with how we refer to Connect.

amol- and others added 2 commits April 10, 2025 10:32
Co-authored-by: Brian Smith <brian.e.smith@gmail.com>
@amol- amol- merged commit d544fc1 into main Apr 10, 2025
11 of 13 checks passed
@amol- amol- deleted the python-options-deprecations branch April 10, 2025 09:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants