Skip to content

Enhance reading from .python-version #787

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

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

krystof-k
Copy link

Enhance reading from .python-version file, matching the Pyenv behavior:

Closes #734 and supersedes #647.

Check list:

  • Mark if documentation changes are required.
  • Mark if tests were added or updated to cover the changes.

@krystof-k krystof-k requested a review from a team as a code owner January 3, 2024 23:43
@maruthiaws0808
Copy link

steps:

  • uses: actions/checkout@v4
  • uses: actions/setup-python@v4
    with:
    python-version: 'graalpy-22.3'
  • run: python my_script.py

@priya-kinthali
Copy link
Contributor

Hello @krystof-k👋,
Thank you for submitting this PR to enhance reading from the .python-version file! 😊
Could you please update your branch with the latest changes from the main branch and run the npm ci, npm run format and npm run build commands to resolve the failing checks related to Basic Validation and dist?
Thank you!

@krystof-k krystof-k reopened this Apr 9, 2025
@krystof-k
Copy link
Author

Hi @priya-kinthali, I did, please approve the workflows.

@krystof-k
Copy link
Author

@priya-kinthali I fixed the lint, please rerun. I have no idea what the check-dist is.

@krystof-k
Copy link
Author

@priya-kinthali sorry, I pushed into a wrong branch. Now it should pass.

@priya-kinthali
Copy link
Contributor

Hello @krystof-k👋,
Thank you for the quick updates!
Please ensure to run npm run build to generate compiled files in the dist/setup and dist/cache-save directories. This should resolve the check-dist failure, as the compiled files are required for the checks to pass.
Also run the npm run test command to run the tests and ensure everything is working as expected.
Additionally, could you also please update the Python versions to the latest ones in the utils.test.ts file, removing the end-of-life versions?
Thank you for your cooperation and effort! 😊

@priya-kinthali
Copy link
Contributor

Hello @krystof-k 👋,
Just wanted to kindly follow up on my previous comment regarding the updates. Could you please address the suggested modifications at your earliest convenience? Thank you!

@krystof-k
Copy link
Author

Hey, @priya-kinthali, yeah, I will do it, I just haven't had the time yet.

@priya-kinthali
Copy link
Contributor

Hello @krystof-k👋,
Just a gentle reminder to kindly sync your branch with the latest changes from the main branch and address the suggested modifications. Thank you!

@lmvysakh
Copy link

lmvysakh commented May 5, 2025

Hello @krystof-k👋,
Just another reminder to kindly make the suggested changes and modifications as soon as possible. Thank you!

@krystof-k
Copy link
Author

Sorry, I was just too busy. I was actually planning to do it today, but @lmvysakh was faster with the #1105. I did it anyway, so merge whatever you like.

@priya-kinthali
Copy link
Contributor

Hello @krystof-k👋,
Thank you for addressing the suggested fixes and updating the PR! We noticed that in utils.test.ts, versions like 3.15 and 3.14.2 are being used, which haven't been officially released yet. Could you please update the test file to use existing, valid Python versions instead? This will help ensure the tests remain accurate and relevant. Thanks again for your contributions!

@krystof-k
Copy link
Author

@priya-kinthali done ;)

@lmvysakh
Copy link

Hello @krystof-k 👋🏻,

Thanks for updating the tests! However, Python 3.14 is currently a pre-release version and is not yet available as a stable release. To ensure the tests are accurate, could you please update the test cases to use the latest stable versions of Python (such as 3.13 or earlier)? We noticed that in utils.test.ts, the pypy version used( pypy3.14-7.3.19 ) is invalid. Could you please update the test file to use existing, valid pypy versions instead?

Also in the following code snippet:

const pythonVersionFileContent =
        '3.14/envs/virtualenv\r# 3.14\n3.13\r\n3.12\r\n 3.11 \r\n';
      fs.writeFileSync(pythonVersionFilePath, pythonVersionFileContent);

It looks like the same version appears twice in pythonVersionFileContent. Once as part of '3.14/envs/virtualenv' and once as a commented-out version ('# 3.14'). To avoid confusion and better demonstrate the comment behavior, could you please use different versions? Thank you!

@krystof-k
Copy link
Author

@priya-kinthali OK, I tried once more, I hope you will be satisfied this time, although I see no difference if using released or unreleased versions if the test only parses and compares text :)

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.

Action breaks when .python-version file specifies multiple versions
6 participants