-
-
Notifications
You must be signed in to change notification settings - Fork 2
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
feat: add PDM_MULTIRUN_CURRENT environment variable #5
Conversation
d843ca5
to
f9e9516
Compare
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. |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
f9e9516
to
f69b283
Compare
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? |
CI issue should be fixed by #6 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, LGTM, thanks!
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.