Skip to content

Commit

Permalink
fix: correct the platform and arch for win32 and macos (#3036)
Browse files Browse the repository at this point in the history
  • Loading branch information
frostming authored Jul 19, 2024
1 parent f2c3580 commit 12cb78f
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

- Support reading requirement constraints from pip-style requirement files for "overriding" via `--override` option. ([#2896](https://github.com/pdm-project/pdm/issues/2896))
- Add a `--non-interactive` option for automation scenarios, also interactive prompts will not show up when not running in an interactive terminal. ([#2934](https://github.com/pdm-project/pdm/issues/2934))
- Refactored `pdm python install --list` to reuse the same implementation as other cli commands that work with Python interpreters from pbs_installer. ([#2977](https://github.com/pdm-project/pdm/issues/2977))
- Add `--license` and `--project-version` as CLI options to control and streamline them during `pdm init` - especially in automated scenarios with `--non-interactive` ([#2978](https://github.com/pdm-project/pdm/issues/2978))
- Run pdm sync in "post-rewrite" stage of pre-commit ([#2994](https://github.com/pdm-project/pdm/issues/2994))
- `Project.get_dependencies()` now returns a list of `Requirement` instead of a mapping.
Expand Down
1 change: 0 additions & 1 deletion news/2977.refactor.md

This file was deleted.

File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions news/3035.bugfix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Correct the current platform and architecture for win32 and macos systems.
8 changes: 4 additions & 4 deletions pdm.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ dependencies = [
"virtualenv>=20",
"pyproject-hooks",
"unearth>=0.16.0",
"dep-logic>=0.4.2",
"dep-logic>=0.4.3",
"findpython>=0.6.0,<1.0.0a0",
"tomlkit>=0.11.1,<1",
"shellingham>=1.3.2",
Expand Down
7 changes: 6 additions & 1 deletion src/pdm/models/in_process/env_spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ def get_arch() -> str:
if arch in ("i386", "i686"):
return "x86"
if arch == "amd64":
if platform.architecture()[0] == "32bit":
return "x86"
return "x86_64"
if arch == "arm64":
return "aarch64"
Expand Down Expand Up @@ -42,7 +44,10 @@ def get_platform() -> str:
mac_ver = platform.mac_ver()[0].split(".")
if arch == "aarch64":
arch = "arm64"
return f"macos_{mac_ver[0]}_{mac_ver[1]}_{arch}"
major, minor = int(mac_ver[0]), int(mac_ver[1])
if major >= 11:
minor = 0
return f"macos_{major}_{minor}_{arch}"
else:
raise EnvError("Unsupported platform")

Expand Down

0 comments on commit 12cb78f

Please sign in to comment.