pyenv-native 0.7.2__tar.gz → 0.8.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pyenv_native-0.7.2 → pyenv_native-0.8.0}/.gitignore +5 -2
- pyenv_native-0.8.0/PKG-INFO +43 -0
- pyenv_native-0.8.0/README.md +17 -0
- {pyenv_native-0.7.2 → pyenv_native-0.8.0}/pyproject.toml +9 -17
- pyenv_native-0.8.0/src/pyenv_native_bootstrap/__init__.py +27 -0
- pyenv_native-0.8.0/src/pyenv_native_bootstrap/__main__.py +7 -0
- pyenv_native-0.7.2/PKG-INFO +0 -132
- pyenv_native-0.7.2/README.md +0 -99
- pyenv_native-0.7.2/src/pyenv_native_bootstrap/__init__.py +0 -6
- pyenv_native-0.7.2/src/pyenv_native_bootstrap/__main__.py +0 -8
- pyenv_native-0.7.2/src/pyenv_native_bootstrap/bundle.py +0 -168
- pyenv_native-0.7.2/src/pyenv_native_bootstrap/cli.py +0 -215
- pyenv_native-0.7.2/src/pyenv_native_bootstrap/github.py +0 -105
- pyenv_native-0.7.2/src/pyenv_native_bootstrap/installer.py +0 -335
- pyenv_native-0.7.2/src/pyenv_native_bootstrap/platforms.py +0 -70
- pyenv_native-0.7.2/tests/__init__.py +0 -11
- pyenv_native-0.7.2/tests/test_bundle.py +0 -105
- pyenv_native-0.7.2/tests/test_github.py +0 -95
- pyenv_native-0.7.2/tests/test_installer.py +0 -261
- {pyenv_native-0.7.2 → pyenv_native-0.8.0}/LICENSE +0 -0
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
/target/
|
|
2
2
|
/dist/
|
|
3
3
|
/python-package/dist/
|
|
4
|
+
/python-package-legacy/dist/
|
|
4
5
|
/packaging/homebrew/Formula/
|
|
5
6
|
/python-package/src/**/*.pyc
|
|
6
7
|
/python-package/tests/**/*.pyc
|
|
8
|
+
/python-package-legacy/src/**/*.pyc
|
|
9
|
+
/python-package-legacy/tests/**/*.pyc
|
|
7
10
|
**/__pycache__/
|
|
8
11
|
/.tmp*/
|
|
9
12
|
/test-install/
|
|
@@ -30,8 +33,8 @@ MEMORY.md
|
|
|
30
33
|
# Cargo.lock
|
|
31
34
|
|
|
32
35
|
# Tauri & GUI
|
|
33
|
-
crates/
|
|
34
|
-
crates/
|
|
36
|
+
crates/enchi-gui/src-tauri/target/
|
|
37
|
+
crates/enchi-gui/target/
|
|
35
38
|
|
|
36
39
|
# Python Virtual Environments
|
|
37
40
|
/venv/
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: pyenv-native
|
|
3
|
+
Version: 0.8.0
|
|
4
|
+
Summary: Final pyenv-native release: a thin wrapper that installs Enchi, the project's new name.
|
|
5
|
+
Project-URL: Homepage, https://github.com/imyourboyroy
|
|
6
|
+
Project-URL: Repository, https://github.com/imyourboyroy/pyenv-native
|
|
7
|
+
Project-URL: Issues, https://github.com/imyourboyroy/pyenv-native/issues
|
|
8
|
+
Author-email: Roy Dawson IV <Roy.Dawson.IV@gmail.com>
|
|
9
|
+
License: MIT
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Keywords: enchi,pipx,pyenv,python
|
|
12
|
+
Classifier: Development Status :: 7 - Inactive
|
|
13
|
+
Classifier: Environment :: Console
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
16
|
+
Classifier: Operating System :: MacOS
|
|
17
|
+
Classifier: Operating System :: Microsoft :: Windows
|
|
18
|
+
Classifier: Operating System :: POSIX
|
|
19
|
+
Classifier: Programming Language :: Python :: 3
|
|
20
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
21
|
+
Classifier: Topic :: Software Development
|
|
22
|
+
Classifier: Topic :: System :: Installation/Setup
|
|
23
|
+
Requires-Python: >=3.8
|
|
24
|
+
Requires-Dist: enchi==0.8.0
|
|
25
|
+
Description-Content-Type: text/markdown
|
|
26
|
+
|
|
27
|
+
# pyenv-native (now Enchi)
|
|
28
|
+
|
|
29
|
+
**pyenv-native has been renamed to Enchi.** This is the final `pyenv-native` release on PyPI. It
|
|
30
|
+
only depends on [`enchi`](https://pypi.org/project/enchi/) (pinned to the same version) and keeps
|
|
31
|
+
the `pyenv-native` console script working: it prints a one-line notice on stderr and forwards to
|
|
32
|
+
`enchi-bootstrap`.
|
|
33
|
+
|
|
34
|
+
```sh
|
|
35
|
+
pipx install enchi # the new package; adds the `enchi-bootstrap` command
|
|
36
|
+
enchi-bootstrap install --github-repo imyourboyroy/pyenv-native
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Existing installs keep working: `pyenv` stays available as an alias for `enchi`, your `~/.pyenv`
|
|
40
|
+
root is left where it is, and `PYENV_ROOT` is still honoured. See `docs/MIGRATING.md` in the
|
|
41
|
+
repository for the details.
|
|
42
|
+
|
|
43
|
+
- <https://github.com/imyourboyroy/pyenv-native>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# pyenv-native (now Enchi)
|
|
2
|
+
|
|
3
|
+
**pyenv-native has been renamed to Enchi.** This is the final `pyenv-native` release on PyPI. It
|
|
4
|
+
only depends on [`enchi`](https://pypi.org/project/enchi/) (pinned to the same version) and keeps
|
|
5
|
+
the `pyenv-native` console script working: it prints a one-line notice on stderr and forwards to
|
|
6
|
+
`enchi-bootstrap`.
|
|
7
|
+
|
|
8
|
+
```sh
|
|
9
|
+
pipx install enchi # the new package; adds the `enchi-bootstrap` command
|
|
10
|
+
enchi-bootstrap install --github-repo imyourboyroy/pyenv-native
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Existing installs keep working: `pyenv` stays available as an alias for `enchi`, your `~/.pyenv`
|
|
14
|
+
root is left where it is, and `PYENV_ROOT` is still honoured. See `docs/MIGRATING.md` in the
|
|
15
|
+
repository for the details.
|
|
16
|
+
|
|
17
|
+
- <https://github.com/imyourboyroy/pyenv-native>
|
|
@@ -4,17 +4,17 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "pyenv-native"
|
|
7
|
-
version = "0.
|
|
8
|
-
description = "
|
|
7
|
+
version = "0.8.0"
|
|
8
|
+
description = "Final pyenv-native release: a thin wrapper that installs Enchi, the project's new name."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.8"
|
|
11
11
|
license = { text = "MIT" }
|
|
12
12
|
authors = [
|
|
13
13
|
{ name = "Roy Dawson IV", email = "Roy.Dawson.IV@gmail.com" },
|
|
14
14
|
]
|
|
15
|
-
keywords = ["
|
|
15
|
+
keywords = ["enchi", "pyenv", "python", "pipx"]
|
|
16
16
|
classifiers = [
|
|
17
|
-
"Development Status ::
|
|
17
|
+
"Development Status :: 7 - Inactive",
|
|
18
18
|
"Environment :: Console",
|
|
19
19
|
"Intended Audience :: Developers",
|
|
20
20
|
"License :: OSI Approved :: MIT License",
|
|
@@ -23,17 +23,13 @@ classifiers = [
|
|
|
23
23
|
"Operating System :: MacOS",
|
|
24
24
|
"Programming Language :: Python :: 3",
|
|
25
25
|
"Programming Language :: Python :: 3 :: Only",
|
|
26
|
-
"Programming Language :: Python :: 3.8",
|
|
27
|
-
"Programming Language :: Python :: 3.9",
|
|
28
|
-
"Programming Language :: Python :: 3.10",
|
|
29
|
-
"Programming Language :: Python :: 3.11",
|
|
30
|
-
"Programming Language :: Python :: 3.12",
|
|
31
|
-
"Programming Language :: Python :: 3.13",
|
|
32
|
-
"Programming Language :: Python :: 3.14",
|
|
33
|
-
"Programming Language :: Python :: 3.15",
|
|
34
26
|
"Topic :: Software Development",
|
|
35
27
|
"Topic :: System :: Installation/Setup",
|
|
36
28
|
]
|
|
29
|
+
# `cargo xtask set-version` keeps this pin equal to the project version.
|
|
30
|
+
dependencies = [
|
|
31
|
+
"enchi==0.8.0",
|
|
32
|
+
]
|
|
37
33
|
|
|
38
34
|
[project.urls]
|
|
39
35
|
Homepage = "https://github.com/imyourboyroy"
|
|
@@ -41,7 +37,7 @@ Repository = "https://github.com/imyourboyroy/pyenv-native"
|
|
|
41
37
|
Issues = "https://github.com/imyourboyroy/pyenv-native/issues"
|
|
42
38
|
|
|
43
39
|
[project.scripts]
|
|
44
|
-
pyenv-native = "pyenv_native_bootstrap
|
|
40
|
+
pyenv-native = "pyenv_native_bootstrap:main"
|
|
45
41
|
|
|
46
42
|
[tool.hatch.build.targets.wheel]
|
|
47
43
|
packages = ["src/pyenv_native_bootstrap"]
|
|
@@ -49,11 +45,7 @@ packages = ["src/pyenv_native_bootstrap"]
|
|
|
49
45
|
[tool.hatch.build.targets.sdist]
|
|
50
46
|
include = [
|
|
51
47
|
"src/pyenv_native_bootstrap",
|
|
52
|
-
"tests",
|
|
53
48
|
"LICENSE",
|
|
54
49
|
"README.md",
|
|
55
50
|
"pyproject.toml",
|
|
56
51
|
]
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"""The final `pyenv-native` release: forwards to Enchi's `enchi-bootstrap`.
|
|
2
|
+
|
|
3
|
+
The project was renamed to Enchi. This distribution only depends on `enchi` (pinned to the same
|
|
4
|
+
version) and keeps the `pyenv-native` console script and the `pyenv_native_bootstrap` module name
|
|
5
|
+
working, so existing `pipx install pyenv-native` setups upgrade into Enchi.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from __future__ import annotations
|
|
9
|
+
|
|
10
|
+
import sys
|
|
11
|
+
|
|
12
|
+
NOTICE = (
|
|
13
|
+
"pyenv-native is now Enchi: this command forwards to `enchi-bootstrap` "
|
|
14
|
+
"(install the `enchi` package directly to drop this notice)."
|
|
15
|
+
)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
def main() -> int:
|
|
19
|
+
"""Print the rename notice on stderr, then run Enchi's bootstrap CLI with the same arguments."""
|
|
20
|
+
|
|
21
|
+
print(NOTICE, file=sys.stderr)
|
|
22
|
+
from enchi_bootstrap.cli import main as enchi_main
|
|
23
|
+
|
|
24
|
+
return enchi_main()
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
__all__ = ["NOTICE", "main"]
|
pyenv_native-0.7.2/PKG-INFO
DELETED
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.5
|
|
2
|
-
Name: pyenv-native
|
|
3
|
-
Version: 0.7.2
|
|
4
|
-
Summary: Python install package for the native-first pyenv-native runtime bundles.
|
|
5
|
-
Project-URL: Homepage, https://github.com/imyourboyroy
|
|
6
|
-
Project-URL: Repository, https://github.com/imyourboyroy/pyenv-native
|
|
7
|
-
Project-URL: Issues, https://github.com/imyourboyroy/pyenv-native/issues
|
|
8
|
-
Author-email: Roy Dawson IV <Roy.Dawson.IV@gmail.com>
|
|
9
|
-
License: MIT
|
|
10
|
-
License-File: LICENSE
|
|
11
|
-
Keywords: bootstrap,pipx,pyenv,python,windows
|
|
12
|
-
Classifier: Development Status :: 3 - Alpha
|
|
13
|
-
Classifier: Environment :: Console
|
|
14
|
-
Classifier: Intended Audience :: Developers
|
|
15
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
16
|
-
Classifier: Operating System :: MacOS
|
|
17
|
-
Classifier: Operating System :: Microsoft :: Windows
|
|
18
|
-
Classifier: Operating System :: POSIX
|
|
19
|
-
Classifier: Programming Language :: Python :: 3
|
|
20
|
-
Classifier: Programming Language :: Python :: 3 :: Only
|
|
21
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
22
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
23
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
24
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
25
|
-
Classifier: Programming Language :: Python :: 3.12
|
|
26
|
-
Classifier: Programming Language :: Python :: 3.13
|
|
27
|
-
Classifier: Programming Language :: Python :: 3.14
|
|
28
|
-
Classifier: Programming Language :: Python :: 3.15
|
|
29
|
-
Classifier: Topic :: Software Development
|
|
30
|
-
Classifier: Topic :: System :: Installation/Setup
|
|
31
|
-
Requires-Python: >=3.8
|
|
32
|
-
Description-Content-Type: text/markdown
|
|
33
|
-
|
|
34
|
-
# pyenv-native
|
|
35
|
-
|
|
36
|
-

|
|
37
|
-

|
|
38
|
-

|
|
39
|
-
|
|
40
|
-
`pyenv-native` on PyPI is the Python convenience package for installing the native `pyenv-native` release bundles.
|
|
41
|
-
|
|
42
|
-
Those bundles install both:
|
|
43
|
-
- `pyenv`
|
|
44
|
-
- `pyenv-mcp`
|
|
45
|
-
|
|
46
|
-
It exists for users who:
|
|
47
|
-
- already have Python installed,
|
|
48
|
-
- want a `pip` or `pipx` entrypoint,
|
|
49
|
-
- still want the real runtime to remain native.
|
|
50
|
-
|
|
51
|
-
## Important principle
|
|
52
|
-
|
|
53
|
-
> This package installs `pyenv-native`.
|
|
54
|
-
> It does **not** replace `pyenv-native` with a Python implementation.
|
|
55
|
-
|
|
56
|
-
## Release selection behavior
|
|
57
|
-
|
|
58
|
-
By default, the package targets the **latest published GitHub release**.
|
|
59
|
-
|
|
60
|
-
## What it does
|
|
61
|
-
|
|
62
|
-
- downloads native release bundles,
|
|
63
|
-
- verifies checksums,
|
|
64
|
-
- reads bundle metadata,
|
|
65
|
-
- extracts the bundle,
|
|
66
|
-
- runs the bundled installer,
|
|
67
|
-
- installs the companion `pyenv-mcp` server when the bundle provides it,
|
|
68
|
-
- supports GitHub Release-based installs,
|
|
69
|
-
- works with Windows ZIP bundles and Linux/macOS `.tar.gz` bundles.
|
|
70
|
-
|
|
71
|
-
## Quick start
|
|
72
|
-
|
|
73
|
-
### `pipx` latest release
|
|
74
|
-
|
|
75
|
-
```powershell
|
|
76
|
-
pipx install pyenv-native
|
|
77
|
-
pyenv-native install --github-repo imyourboyroy/pyenv-native --install-root ~\.pyenv
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
### `pip` latest release
|
|
81
|
-
|
|
82
|
-
```powershell
|
|
83
|
-
python -m pip install pyenv-native
|
|
84
|
-
pyenv-native install --github-repo imyourboyroy/pyenv-native --install-root ~\.pyenv
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
### POSIX latest release
|
|
88
|
-
|
|
89
|
-
```sh
|
|
90
|
-
python -m pip install pyenv-native
|
|
91
|
-
pyenv-native install --github-repo imyourboyroy/pyenv-native --install-root ~/.pyenv
|
|
92
|
-
```
|
|
93
|
-
|
|
94
|
-
## Commands
|
|
95
|
-
|
|
96
|
-
```text
|
|
97
|
-
pyenv-native verify <bundle-archive> [--checksum-path <bundle.sha256>]
|
|
98
|
-
pyenv-native download [--bundle-url <url> | --release-base-url <url> | --github-repo <owner/repo>] [--tag <tag>]
|
|
99
|
-
pyenv-native install [--bundle-path <bundle-archive> | --release-base-url <url> | --github-repo <owner/repo>] [--tag <tag>] [--install-root <dir>]
|
|
100
|
-
```
|
|
101
|
-
|
|
102
|
-
## Examples
|
|
103
|
-
|
|
104
|
-
Verify a local bundle:
|
|
105
|
-
|
|
106
|
-
```powershell
|
|
107
|
-
pyenv-native verify .\dist\pyenv-native-windows-x64.zip --checksum-path .\dist\pyenv-native-windows-x64.zip.sha256
|
|
108
|
-
```
|
|
109
|
-
|
|
110
|
-
Install from a local bundle:
|
|
111
|
-
|
|
112
|
-
```powershell
|
|
113
|
-
pyenv-native install --bundle-path .\dist\pyenv-native-windows-x64.zip --checksum-path .\dist\pyenv-native-windows-x64.zip.sha256 --install-root ~\.pyenv
|
|
114
|
-
```
|
|
115
|
-
|
|
116
|
-
Install from the latest GitHub release:
|
|
117
|
-
|
|
118
|
-
```powershell
|
|
119
|
-
pyenv-native install --github-repo imyourboyroy/pyenv-native --install-root ~\.pyenv
|
|
120
|
-
```
|
|
121
|
-
|
|
122
|
-
Install a POSIX bundle:
|
|
123
|
-
|
|
124
|
-
```sh
|
|
125
|
-
pyenv-native install --bundle-path ./dist/pyenv-native-linux-x64.tar.gz --checksum-path ./dist/pyenv-native-linux-x64.tar.gz.sha256 --install-root ~/.pyenv --shell bash
|
|
126
|
-
```
|
|
127
|
-
|
|
128
|
-
## Relationship to the main project
|
|
129
|
-
|
|
130
|
-
For the full project overview, install scripts, release-bundle flow, and command reference, see the main repository README:
|
|
131
|
-
|
|
132
|
-
- <https://github.com/imyourboyroy/pyenv-native>
|
pyenv_native-0.7.2/README.md
DELETED
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
# pyenv-native
|
|
2
|
-
|
|
3
|
-

|
|
4
|
-

|
|
5
|
-

|
|
6
|
-
|
|
7
|
-
`pyenv-native` on PyPI is the Python convenience package for installing the native `pyenv-native` release bundles.
|
|
8
|
-
|
|
9
|
-
Those bundles install both:
|
|
10
|
-
- `pyenv`
|
|
11
|
-
- `pyenv-mcp`
|
|
12
|
-
|
|
13
|
-
It exists for users who:
|
|
14
|
-
- already have Python installed,
|
|
15
|
-
- want a `pip` or `pipx` entrypoint,
|
|
16
|
-
- still want the real runtime to remain native.
|
|
17
|
-
|
|
18
|
-
## Important principle
|
|
19
|
-
|
|
20
|
-
> This package installs `pyenv-native`.
|
|
21
|
-
> It does **not** replace `pyenv-native` with a Python implementation.
|
|
22
|
-
|
|
23
|
-
## Release selection behavior
|
|
24
|
-
|
|
25
|
-
By default, the package targets the **latest published GitHub release**.
|
|
26
|
-
|
|
27
|
-
## What it does
|
|
28
|
-
|
|
29
|
-
- downloads native release bundles,
|
|
30
|
-
- verifies checksums,
|
|
31
|
-
- reads bundle metadata,
|
|
32
|
-
- extracts the bundle,
|
|
33
|
-
- runs the bundled installer,
|
|
34
|
-
- installs the companion `pyenv-mcp` server when the bundle provides it,
|
|
35
|
-
- supports GitHub Release-based installs,
|
|
36
|
-
- works with Windows ZIP bundles and Linux/macOS `.tar.gz` bundles.
|
|
37
|
-
|
|
38
|
-
## Quick start
|
|
39
|
-
|
|
40
|
-
### `pipx` latest release
|
|
41
|
-
|
|
42
|
-
```powershell
|
|
43
|
-
pipx install pyenv-native
|
|
44
|
-
pyenv-native install --github-repo imyourboyroy/pyenv-native --install-root ~\.pyenv
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
### `pip` latest release
|
|
48
|
-
|
|
49
|
-
```powershell
|
|
50
|
-
python -m pip install pyenv-native
|
|
51
|
-
pyenv-native install --github-repo imyourboyroy/pyenv-native --install-root ~\.pyenv
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
### POSIX latest release
|
|
55
|
-
|
|
56
|
-
```sh
|
|
57
|
-
python -m pip install pyenv-native
|
|
58
|
-
pyenv-native install --github-repo imyourboyroy/pyenv-native --install-root ~/.pyenv
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
## Commands
|
|
62
|
-
|
|
63
|
-
```text
|
|
64
|
-
pyenv-native verify <bundle-archive> [--checksum-path <bundle.sha256>]
|
|
65
|
-
pyenv-native download [--bundle-url <url> | --release-base-url <url> | --github-repo <owner/repo>] [--tag <tag>]
|
|
66
|
-
pyenv-native install [--bundle-path <bundle-archive> | --release-base-url <url> | --github-repo <owner/repo>] [--tag <tag>] [--install-root <dir>]
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
## Examples
|
|
70
|
-
|
|
71
|
-
Verify a local bundle:
|
|
72
|
-
|
|
73
|
-
```powershell
|
|
74
|
-
pyenv-native verify .\dist\pyenv-native-windows-x64.zip --checksum-path .\dist\pyenv-native-windows-x64.zip.sha256
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
Install from a local bundle:
|
|
78
|
-
|
|
79
|
-
```powershell
|
|
80
|
-
pyenv-native install --bundle-path .\dist\pyenv-native-windows-x64.zip --checksum-path .\dist\pyenv-native-windows-x64.zip.sha256 --install-root ~\.pyenv
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
Install from the latest GitHub release:
|
|
84
|
-
|
|
85
|
-
```powershell
|
|
86
|
-
pyenv-native install --github-repo imyourboyroy/pyenv-native --install-root ~\.pyenv
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
Install a POSIX bundle:
|
|
90
|
-
|
|
91
|
-
```sh
|
|
92
|
-
pyenv-native install --bundle-path ./dist/pyenv-native-linux-x64.tar.gz --checksum-path ./dist/pyenv-native-linux-x64.tar.gz.sha256 --install-root ~/.pyenv --shell bash
|
|
93
|
-
```
|
|
94
|
-
|
|
95
|
-
## Relationship to the main project
|
|
96
|
-
|
|
97
|
-
For the full project overview, install scripts, release-bundle flow, and command reference, see the main repository README:
|
|
98
|
-
|
|
99
|
-
- <https://github.com/imyourboyroy/pyenv-native>
|
|
@@ -1,168 +0,0 @@
|
|
|
1
|
-
# ./python-package/src/pyenv_native_bootstrap/bundle.py
|
|
2
|
-
"""Bundle metadata, checksum, and download helpers for pyenv-native release assets."""
|
|
3
|
-
|
|
4
|
-
from __future__ import annotations
|
|
5
|
-
|
|
6
|
-
import hashlib
|
|
7
|
-
import json
|
|
8
|
-
import tarfile
|
|
9
|
-
import urllib.request
|
|
10
|
-
from dataclasses import dataclass
|
|
11
|
-
from pathlib import Path
|
|
12
|
-
from typing import Optional
|
|
13
|
-
from zipfile import ZipFile
|
|
14
|
-
|
|
15
|
-
from . import __version__
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
@dataclass(frozen=True)
|
|
19
|
-
class BundleManifest:
|
|
20
|
-
"""Describes a built release bundle.
|
|
21
|
-
|
|
22
|
-
Current bundles install through the bundled binary (`<executable> self-install`) and carry no
|
|
23
|
-
scripts. Bundles published before that change name `install_script`/`uninstall_script`
|
|
24
|
-
instead; both are optional so either generation can be installed.
|
|
25
|
-
"""
|
|
26
|
-
|
|
27
|
-
bundle_name: str
|
|
28
|
-
bundle_version: str
|
|
29
|
-
platform: str
|
|
30
|
-
architecture: str
|
|
31
|
-
executable: str
|
|
32
|
-
install_script: Optional[str] = None
|
|
33
|
-
uninstall_script: Optional[str] = None
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
def sha256_file(path: Path) -> str:
|
|
37
|
-
"""Return the SHA-256 digest for a file."""
|
|
38
|
-
|
|
39
|
-
digest = hashlib.sha256()
|
|
40
|
-
with path.open("rb") as handle:
|
|
41
|
-
for chunk in iter(lambda: handle.read(1024 * 1024), b""):
|
|
42
|
-
digest.update(chunk)
|
|
43
|
-
return digest.hexdigest()
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
def parse_checksum_text(text: str, expected_file_name: Optional[str] = None) -> str:
|
|
47
|
-
"""Extract a SHA-256 value from a checksum file or raw string."""
|
|
48
|
-
|
|
49
|
-
lines = [line.strip() for line in text.splitlines() if line.strip()]
|
|
50
|
-
if not lines:
|
|
51
|
-
raise ValueError("checksum text did not contain any usable lines")
|
|
52
|
-
|
|
53
|
-
for line in lines:
|
|
54
|
-
parts = line.split()
|
|
55
|
-
if len(parts) == 1 and len(parts[0]) == 64:
|
|
56
|
-
return parts[0].lower()
|
|
57
|
-
if len(parts) >= 2 and len(parts[0]) == 64:
|
|
58
|
-
candidate_name = parts[-1].lstrip("*")
|
|
59
|
-
if expected_file_name is None or candidate_name == expected_file_name:
|
|
60
|
-
return parts[0].lower()
|
|
61
|
-
|
|
62
|
-
raise ValueError("checksum text did not contain a valid SHA-256 entry")
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
def is_tar_bundle(bundle_path: Path) -> bool:
|
|
66
|
-
"""Return true when a bundle path uses a tar-based archive format."""
|
|
67
|
-
|
|
68
|
-
suffixes = [suffix.lower() for suffix in bundle_path.suffixes]
|
|
69
|
-
return suffixes[-2:] == [".tar", ".gz"] or bundle_path.suffix.lower() == ".tgz"
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
def read_manifest_from_bundle(bundle_path: Path) -> BundleManifest:
|
|
73
|
-
"""Read and parse the bundle manifest embedded inside a release archive."""
|
|
74
|
-
|
|
75
|
-
if is_tar_bundle(bundle_path):
|
|
76
|
-
with tarfile.open(bundle_path, "r:*") as archive:
|
|
77
|
-
member = next(
|
|
78
|
-
(
|
|
79
|
-
candidate
|
|
80
|
-
for candidate in archive.getmembers()
|
|
81
|
-
if Path(candidate.name).name == "bundle-manifest.json"
|
|
82
|
-
),
|
|
83
|
-
None,
|
|
84
|
-
)
|
|
85
|
-
if member is None:
|
|
86
|
-
raise FileNotFoundError("bundle-manifest.json was not found in the bundle archive")
|
|
87
|
-
handle = archive.extractfile(member)
|
|
88
|
-
if handle is None:
|
|
89
|
-
raise FileNotFoundError("bundle-manifest.json could not be extracted")
|
|
90
|
-
payload = json.loads(handle.read().decode("utf-8-sig"))
|
|
91
|
-
else:
|
|
92
|
-
with ZipFile(bundle_path, "r") as archive:
|
|
93
|
-
with archive.open("bundle-manifest.json", "r") as handle:
|
|
94
|
-
payload = json.loads(handle.read().decode("utf-8-sig"))
|
|
95
|
-
|
|
96
|
-
return BundleManifest(
|
|
97
|
-
bundle_name=payload["bundle_name"],
|
|
98
|
-
bundle_version=payload["bundle_version"],
|
|
99
|
-
platform=payload["platform"],
|
|
100
|
-
architecture=payload["architecture"],
|
|
101
|
-
executable=payload["executable"],
|
|
102
|
-
install_script=payload.get("install_script"),
|
|
103
|
-
uninstall_script=payload.get("uninstall_script"),
|
|
104
|
-
)
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
def read_manifest_from_zip(bundle_path: Path) -> BundleManifest:
|
|
108
|
-
"""Backward-compatible wrapper for zip-based bundle manifest reads."""
|
|
109
|
-
|
|
110
|
-
return read_manifest_from_bundle(bundle_path)
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
def download_file(url: str, destination: Path) -> Path:
|
|
114
|
-
"""Download a file to a destination path, replacing any prior file."""
|
|
115
|
-
|
|
116
|
-
destination.parent.mkdir(parents=True, exist_ok=True)
|
|
117
|
-
request = urllib.request.Request(
|
|
118
|
-
url,
|
|
119
|
-
headers={"User-Agent": f"pyenv-native/{__version__}"},
|
|
120
|
-
)
|
|
121
|
-
with urllib.request.urlopen(request) as response, destination.open("wb") as handle: # noqa: S310
|
|
122
|
-
handle.write(response.read())
|
|
123
|
-
return destination
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
def load_checksum_text(
|
|
127
|
-
checksum: Optional[str],
|
|
128
|
-
checksum_path: Optional[Path],
|
|
129
|
-
checksum_url: Optional[str],
|
|
130
|
-
cache_path: Path,
|
|
131
|
-
) -> Optional[str]:
|
|
132
|
-
"""Load checksum content from an inline value, local file, or remote URL."""
|
|
133
|
-
|
|
134
|
-
if checksum:
|
|
135
|
-
return checksum.strip()
|
|
136
|
-
if checksum_path:
|
|
137
|
-
return checksum_path.read_text(encoding="utf-8")
|
|
138
|
-
if checksum_url:
|
|
139
|
-
checksum_target = cache_path.with_suffix(cache_path.suffix + ".sha256")
|
|
140
|
-
download_file(checksum_url, checksum_target)
|
|
141
|
-
return checksum_target.read_text(encoding="utf-8")
|
|
142
|
-
return None
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
def verify_bundle_checksum(
|
|
146
|
-
bundle_path: Path,
|
|
147
|
-
checksum: Optional[str] = None,
|
|
148
|
-
checksum_path: Optional[Path] = None,
|
|
149
|
-
checksum_url: Optional[str] = None,
|
|
150
|
-
) -> str:
|
|
151
|
-
"""Verify the bundle against a supplied checksum source and return the digest."""
|
|
152
|
-
|
|
153
|
-
checksum_text = load_checksum_text(
|
|
154
|
-
checksum=checksum,
|
|
155
|
-
checksum_path=checksum_path,
|
|
156
|
-
checksum_url=checksum_url,
|
|
157
|
-
cache_path=bundle_path,
|
|
158
|
-
)
|
|
159
|
-
actual = sha256_file(bundle_path)
|
|
160
|
-
if checksum_text is None:
|
|
161
|
-
return actual
|
|
162
|
-
|
|
163
|
-
expected = parse_checksum_text(checksum_text, bundle_path.name)
|
|
164
|
-
if actual.lower() != expected.lower():
|
|
165
|
-
raise ValueError(
|
|
166
|
-
f"checksum mismatch for {bundle_path}: expected {expected}, got {actual}"
|
|
167
|
-
)
|
|
168
|
-
return actual
|