Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add PDM_MULTIRUN_CURRENT environment variable #5

Merged
merged 2 commits into from
Sep 21, 2023

Conversation

DomWeldon
Copy link
Contributor

This PR adds a small change to make the name of the current interpreter or virtual environment available under the environment variable PDM_MULTIRUN_CURRENT. This is particularly useful for cases when the name of a virtual environment may not be equal to the specific python version.

DomWeldon pushed a commit to DomWeldon/partialdispatch that referenced this pull request Sep 19, 2023
DomWeldon pushed a commit to DomWeldon/partialdispatch that referenced this pull request Sep 19, 2023
@DomWeldon DomWeldon force-pushed the feature/current-version-as-env-var branch from d843ca5 to f9e9516 Compare September 19, 2023 09:22
README.md Outdated
@@ -98,7 +102,8 @@ import sys
MULTIRUN = os.getenv("PDM_MULTIRUN", "0") == "1"

if MULTIRUN:
py = f"{sys.version_info[0]}.{sys.version_info[1]}" # 3.8, 3.9, etc.
int_name = os.getenv('PDM_MULTIRUN_CURRENT', '')
py = f"{int_name}: {sys.version_info[0]}.{sys.version_info[1]}" # py38: 3.8, py39: 3.9, etc.
Copy link
Owner

Choose a reason for hiding this comment

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

Maybe show a venv name that is not just the Python version, to make it more explicit?

build: 3.8, tests: 3.11 etc.

Copy link
Owner

Choose a reason for hiding this comment

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

Suggested change
py = f"{int_name}: {sys.version_info[0]}.{sys.version_info[1]}" # py38: 3.8, py39: 3.9, etc.
py = f"{int_name}: {sys.version_info[0]}.{sys.version_info[1]}" # build: 3.8, tests: 3.9, etc.

@DomWeldon DomWeldon force-pushed the feature/current-version-as-env-var branch from f9e9516 to f69b283 Compare September 20, 2023 18:43
@DomWeldon
Copy link
Contributor Author

Altered accordingly, added a bit more to the docs on that feature and the example to make it clearer.

Side point - wasn't sure what the preferred line length is for markdown here, I assumed 80?

@DomWeldon
Copy link
Contributor Author

CI issue should be fixed by #6

README.md Outdated Show resolved Hide resolved
Copy link
Owner

@pawamoy pawamoy left a comment

Choose a reason for hiding this comment

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

OK, LGTM, thanks!

@pawamoy pawamoy merged commit a0c1b18 into pawamoy:main Sep 21, 2023
15 of 16 checks passed
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