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

Merge with distutils@58fe058e4 #4606

Merged
merged 47 commits into from
Aug 27, 2024
Merged

Merge with distutils@58fe058e4 #4606

merged 47 commits into from
Aug 27, 2024

Conversation

jaraco
Copy link
Member

@jaraco jaraco commented Aug 27, 2024

  • Apply ruff/tryceratops rule TRY300
  • Apply ruff/tryceratops rule TRY301
  • Enforce ruff/tryceratops rules (TRY)
  • Enforce ruff/flake8-2020 rule (YTT301)
  • handle failures to find a user home directory
  • Remove outdated import error check for warnings
  • Satisfy ruff import format
  • Remove unused wininst-*.exe files
  • Apply ruff/Perflint rule PERF102
  • Apply ruff/Perflint rule PERF402
  • Apply ruff/Perflint rule PERF403
  • Enforce ruff/Perflint rules (PERF)
  • Add # local to ignore conflicts with upstrea
  • Use arm64 MSVC on arm64 Windows
  • Update distutils/dist.py
  • format
  • conditionally construct PLAT_TO_VCVARS
  • function-ify
  • nit
  • python supports comparison chains
  • apply feedback
  • Simply suppress the exception.
  • Sort imports
  • restore the lost comment
  • Define the variable in one place.
  • Extract logic around the mappings into a function to compute the spec.
  • Tweak docstring
  • Remove legacy msvc compiler modules.
  • Remove associated tests
  • Apply downstream VS 2017 support.
  • Apply error message from downstream.

Summary of changes

Closes

Pull Request Checklist

DimitriPapadopoulos and others added 30 commits August 3, 2024 21:14
TRY300 Consider moving this statement to an `else` block
TRY301 Abstract `raise` to an inner function
YTT301 `sys.version[0]` referenced (python10), use `sys.version_info`

The Python documentation discourages the use of `sys.version`:
	Do not extract version information out of it, rather,
	use `version_info` and [...]
In certain environments (notably, the [bazel sandbox](https://bazel.build/docs/sandboxing) on windows), it is possible for `pathlib.Path('~').expanduser()` to fail to find the user home directory and [raise a `RuntimeError`](https://docs.python.org/3/library/pathlib.html#pathlib.Path.expanduser). This causes `distutils` (and ultimately, `setuptools`) to fail.

With this patch, we catch and handle the exception by logging a warning and continuing without a user's config file.

motivated by bazelbuild/rules_python#1067
They where used by bdist_wininst, which was removed long ago in
pypa/distutils#170
PERF102 When using only the values of a dict use the `values()` method
PERF402 Use `list` or `list.copy` to create a copy of a list
PERF403 Use a dictionary comprehension instead of a for-loop
Remove outdated `ImportError` check for `warnings`
Co-authored-by: Anderson Bravalheri <andersonbravalheri+github@gmail.com>
…find-user-home

handle failures to find a user home directory
@jaraco
Copy link
Member Author

jaraco commented Aug 27, 2024

Here's the more useful summary:

 🐚 git log HEAD^1..HEAD^2 --first-parent --oneline
58fe058e4 Merge pull request pypa/distutils#289 from pypa/debt/vs2017
b8c70bbba Merge pull request pypa/distutils#285 from saschanaz/arm64
23e3bfa72 Merge pull request pypa/distutils#287 from pypa/debt/remove-legacy-msvc
0107b075f Merge pull request pypa/distutils#264 from DimitriPapadopoulos/YTT
d42a6aa54 Merge pull request pypa/distutils#266 from DimitriPapadopoulos/TRY
6c224d3c6 Merge pull request pypa/distutils#278 from cj81499/handle-failure-to-find-user-home
2e8c2a25c Merge https://github.com/jaraco/skeleton
7f0e0c92c Merge pull request pypa/distutils#279 from abravalheri/warnings-exist
dcb0a648c Merge pull request pypa/distutils#282 from lazka/remove-wininst-exe
d7766971e Merge pull request pypa/distutils#265 from DimitriPapadopoulos/PERF
164f27685 Merge https://github.com/jaraco/skeleton

@jaraco jaraco marked this pull request as ready for review August 27, 2024 17:56
@jaraco jaraco merged commit 11a6b59 into main Aug 27, 2024
40 checks passed
@jaraco jaraco deleted the distutils-58fe058e4 branch August 27, 2024 18:26
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.

6 participants