Skip to content

Conversation

@hrimov
Copy link
Contributor

@hrimov hrimov commented Feb 23, 2025

The changes relax the executable name checks while still verifying that venv correctly handles pip installation and upgrades

@hrimov hrimov requested review from FFY00 and vsajip as code owners February 23, 2025 19:18
@ghost
Copy link

ghost commented Feb 23, 2025

All commit authors signed the Contributor License Agreement.
CLA signed

@bedevere-app bedevere-app bot added the tests Tests in the Lib/test dir label Feb 23, 2025
@bedevere-app
Copy link

bedevere-app bot commented Feb 23, 2025

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

@FFY00 FFY00 added the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Feb 27, 2025
@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by @FFY00 for commit 4123be1 🤖

Results will be shown at:

https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F130487%2Fmerge

If you want to schedule another build, you need to add the 🔨 test-with-buildbots label again.

@bedevere-bot bedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Feb 27, 2025
@vsajip
Copy link
Member

vsajip commented Feb 28, 2025

Failing buildbot tests appear unconnected to this change.

@vsajip
Copy link
Member

vsajip commented Feb 28, 2025

@FFY00 shall we wait for your review?

Copy link
Member

@FFY00 FFY00 left a comment

Choose a reason for hiding this comment

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

@vsajip thanks for the ping!

@hrimov, the PR looks good, thank you for spending the time working on it! I just have one thing to point out about the correctness of the code, and a nitpick, which you can fix if you have time.

The buildbot failures indeed seem unrelated — the refleak configs are known to fail from time to time — so, it appears this PR doesn't introduce issues on exoteric platforms like Android and iOS, or in different test environments, as far as our testing infrastructure is concerned, at least, which is what I would look out for in a change like this.

Approving the PR, but look into the small correctness issue before merging 👍

@hrimov thank you again!

builder = venv.EnvBuilder()
bin_path = 'bin'
python_exe = os.path.split(sys.executable)[1]
expected_exe = os.path.basename(sys.executable)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
expected_exe = os.path.basename(sys.executable)
expected_exe = os.path.basename(sys._base_executable)

# Now check the venv created from the non-installed python has
# correct zip path in pythonpath.
cmd = [self.envpy(), '-S', '-c', 'import sys; print(sys.path)']
cmd = [os.path.join(self.env_dir, self.bindir, python_exe), '-S', '-c', 'import sys; print(sys.path)']
Copy link
Member

Choose a reason for hiding this comment

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

nitpick: I would construct the full path in variable, which makes it easier to parse the code.

@hrimov
Copy link
Contributor Author

hrimov commented Mar 3, 2025

The buildbot failures indeed seem unrelated — the refleak configs are known to fail from time to time — so, it appears this PR doesn't introduce issues on exoteric platforms like Android and iOS, or in different test environments, as far as our testing infrastructure is concerned, at least, which is what I would look out for in a change like this.

Approving the PR, but look into the small correctness issue before merging 👍

Updated, thanks!

@vsajip vsajip merged commit d780f0a into python:main Mar 4, 2025
38 checks passed
@hrimov hrimov deleted the fix/test-venv-fail branch March 27, 2025 11:10
seehwan pushed a commit to seehwan/cpython that referenced this pull request Apr 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip news tests Tests in the Lib/test dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants