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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix building python3.10 virtualenvs on debian derivatives #2415

Merged
merged 1 commit into from Sep 12, 2022
Merged

fix building python3.10 virtualenvs on debian derivatives #2415

merged 1 commit into from Sep 12, 2022

Conversation

asottile
Copy link
Contributor

this fixes building a virtualenv when python3-distutils is not installed (or when not using the deadsnakes fork)

I tried unsuccessfully to get debian and ubuntu to patch this and I'm sick of getting reports in pre-commit about this 馃槶

resolves #2340
resolves #2350

Thanks for contributing, make sure you address all the checklists (for details on how see development documentation)!

  • ran the linter to address style issues (tox -e fix_lint)
  • wrote descriptive pull request text
  • ensured there are test(s) validating the fix)
  • added news fragment in docs/changelog folder
  • updated/extended the documentation (N/A)

this fixes building a virtualenv when python3-distutils is not installed (or when not using the deadsnakes fork)
@gaborbernat
Copy link
Contributor

The thing is if we fix this we remove all incentive for Debian to fix their broken patch and we'll be in forever patching out stuff to fix their stuff. I'm not too comfortable going down that road...

@asottile
Copy link
Contributor Author

it's not an issue in 3.11+ at least -- and they've ignored it thus far :S

@gaborbernat gaborbernat merged commit 445a68d into pypa:main Sep 12, 2022
@asottile asottile deleted the debian-py310-local-sadness branch September 12, 2022 15:12
@jepler
Copy link

jepler commented Sep 12, 2022

Hi, can you point me at any bugs related to this that were filled on bugs.debian.org?

elif sys.version_info[:2] == (3, 10) and "deb_system" in scheme_names:
self.sysconfig_scheme = "posix_prefix"
self.sysconfig_paths = {
i: sysconfig.get_path(i, expand=False, scheme=self.sysconfig_scheme) for i in sysconfig.get_path_names()
}
# we cannot use distutils at all if "venv" exists, distutils don't know it
Copy link
Contributor

Choose a reason for hiding this comment

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

This comment here kinda stopped making sense in the context of the elif branch.

@stefanor
Copy link
Contributor

it's not an issue in 3.11+ at least -- and they've ignored it thus far :S

That's not the direct reason. We ignored the patch because it introduced the venv scheme into Python 3.10. So, we went a slightly different route.

I didn't realise that upstream virtualenv was broken, here, because we had our python3-virtualenv depend on python3-distutils (indirectly), so we never saw the bugs. Sorry about that.

This patch seems reasonable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants