relenv 0.22.0__py3-none-any.whl → 0.22.2__py3-none-any.whl

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.
Files changed (46) hide show
  1. relenv/__init__.py +1 -1
  2. relenv/__main__.py +1 -1
  3. relenv/build/__init__.py +21 -25
  4. relenv/build/common/__init__.py +1 -1
  5. relenv/build/common/_sysconfigdata_template.py +1 -1
  6. relenv/build/common/builder.py +1 -1
  7. relenv/build/common/builders.py +1 -1
  8. relenv/build/common/download.py +1 -1
  9. relenv/build/common/install.py +6 -2
  10. relenv/build/common/ui.py +1 -1
  11. relenv/build/darwin.py +1 -1
  12. relenv/build/linux.py +1 -1
  13. relenv/build/windows.py +1 -1
  14. relenv/buildenv.py +1 -1
  15. relenv/check.py +1 -1
  16. relenv/common.py +5 -4
  17. relenv/create.py +19 -27
  18. relenv/fetch.py +7 -5
  19. relenv/manifest.py +1 -1
  20. relenv/python-versions.json +347 -326
  21. relenv/pyversions.py +49 -1
  22. relenv/relocate.py +34 -2
  23. relenv/runtime.py +6 -1
  24. relenv/toolchain.py +1 -1
  25. {relenv-0.22.0.dist-info → relenv-0.22.2.dist-info}/METADATA +1 -1
  26. relenv-0.22.2.dist-info/RECORD +48 -0
  27. tests/__init__.py +1 -1
  28. tests/_pytest_typing.py +1 -1
  29. tests/conftest.py +1 -1
  30. tests/test_build.py +1 -1
  31. tests/test_common.py +64 -2
  32. tests/test_create.py +1 -1
  33. tests/test_downloads.py +1 -1
  34. tests/test_fips_photon.py +1 -1
  35. tests/test_module_imports.py +1 -1
  36. tests/test_pyversions_runtime.py +78 -1
  37. tests/test_relocate.py +86 -1
  38. tests/test_relocate_module.py +1 -1
  39. tests/test_runtime.py +167 -1
  40. tests/test_verify_build.py +7 -5
  41. relenv-0.22.0.dist-info/RECORD +0 -48
  42. {relenv-0.22.0.dist-info → relenv-0.22.2.dist-info}/WHEEL +0 -0
  43. {relenv-0.22.0.dist-info → relenv-0.22.2.dist-info}/entry_points.txt +0 -0
  44. {relenv-0.22.0.dist-info → relenv-0.22.2.dist-info}/licenses/LICENSE.md +0 -0
  45. {relenv-0.22.0.dist-info → relenv-0.22.2.dist-info}/licenses/NOTICE +0 -0
  46. {relenv-0.22.0.dist-info → relenv-0.22.2.dist-info}/top_level.txt +0 -0
relenv/__init__.py CHANGED
@@ -1,4 +1,4 @@
1
- # Copyright 2022-2025 Broadcom.
1
+ # Copyright 2022-2026 Broadcom.
2
2
  # SPDX-License-Identifier: Apache-2.0
3
3
  from __future__ import annotations
4
4
 
relenv/__main__.py CHANGED
@@ -1,4 +1,4 @@
1
- # Copyright 2022-2025 Broadcom.
1
+ # Copyright 2022-2026 Broadcom.
2
2
  # SPDX-License-Identifier: Apache-2.0
3
3
  """
4
4
  The entrypoint into relenv.
relenv/build/__init__.py CHANGED
@@ -1,4 +1,4 @@
1
- # Copyright 2022-2025 Broadcom.
1
+ # Copyright 2022-2026 Broadcom.
2
2
  # SPDX-License-Identifier: Apache-2.0
3
3
  # mypy: ignore-errors
4
4
  """
@@ -15,8 +15,13 @@ from types import FrameType, ModuleType
15
15
 
16
16
  from . import darwin, linux, windows
17
17
  from .common import builds
18
- from ..common import DEFAULT_PYTHON, build_arch
19
- from ..pyversions import Version, python_versions
18
+ from ..common import build_arch
19
+ from ..pyversions import (
20
+ Version,
21
+ get_default_python_version,
22
+ python_versions,
23
+ resolve_python_version,
24
+ )
20
25
 
21
26
 
22
27
  def platform_module() -> ModuleType:
@@ -62,11 +67,12 @@ def setup_parser(
62
67
  "logs, src, build, and previous tarball."
63
68
  ),
64
69
  )
70
+ default_version = get_default_python_version()
65
71
  build_subparser.add_argument(
66
72
  "--python",
67
- default=DEFAULT_PYTHON,
73
+ default=default_version,
68
74
  type=str,
69
- help="The python version [default: %(default)s]",
75
+ help="The python version (e.g., 3.10, 3.13.7) [default: %(default)s]",
70
76
  )
71
77
  build_subparser.add_argument(
72
78
  "--no-cleanup",
@@ -146,27 +152,17 @@ def main(args: argparse.Namespace) -> None:
146
152
  print(f"Unsupported platform: {sys.platform}")
147
153
  sys.exit(1)
148
154
 
149
- requested = Version(args.python)
150
-
151
- if requested.micro:
155
+ try:
156
+ build_version_str = resolve_python_version(args.python)
157
+ except RuntimeError as e:
158
+ print(f"Error: {e}")
152
159
  pyversions = python_versions()
153
- if requested not in pyversions:
154
- print(f"Unknown version {requested}")
155
- strversions = "\n".join([str(_) for _ in pyversions])
156
- print(f"Known versions are:\n{strversions}")
157
- sys.exit(1)
158
- build_version = requested
159
- else:
160
- pyversions = python_versions(args.python)
161
- build_version = sorted(list(pyversions.keys()))[-1]
162
-
163
- # print(pyversions)
164
- # print(pyversions[0].major)
165
- # print(pyversions[0].minor)
166
- # print(pyversions[0].micro)
167
- # print(pyversions[0].pre)
168
- # print(pyversions[0].post)
169
- # print(pyversions)
160
+ strversions = "\n".join([str(_) for _ in pyversions])
161
+ print(f"Known versions are:\n{strversions}")
162
+ sys.exit(1)
163
+
164
+ build_version = Version(build_version_str)
165
+ pyversions = python_versions()
170
166
  print(f"Build Python {build_version}")
171
167
 
172
168
  # XXX
@@ -1,4 +1,4 @@
1
- # Copyright 2022-2025 Broadcom.
1
+ # Copyright 2022-2026 Broadcom.
2
2
  # SPDX-License-Identifier: Apache-2.0
3
3
  """
4
4
  Build process common methods.
@@ -1,4 +1,4 @@
1
- # Copyright 2022-2025 Broadcom.
1
+ # Copyright 2022-2026 Broadcom.
2
2
  # SPDX-License-Identifier: Apache-2.0
3
3
  # mypy: ignore-errors
4
4
  # flake8: noqa
@@ -1,4 +1,4 @@
1
- # Copyright 2022-2025 Broadcom.
1
+ # Copyright 2022-2026 Broadcom.
2
2
  # SPDX-License-Identifier: Apache-2.0
3
3
  """
4
4
  Builder and Builds classes for managing the build process.
@@ -1,4 +1,4 @@
1
- # Copyright 2022-2025 Broadcom.
1
+ # Copyright 2022-2026 Broadcom.
2
2
  # SPDX-License-Identifier: Apache-2.0
3
3
  """
4
4
  Build functions for specific dependencies.
@@ -1,4 +1,4 @@
1
- # Copyright 2022-2025 Broadcom.
1
+ # Copyright 2022-2026 Broadcom.
2
2
  # SPDX-License-Identifier: Apache-2.0
3
3
  """
4
4
  Download utility class for fetching build dependencies.
@@ -1,4 +1,4 @@
1
- # Copyright 2022-2025 Broadcom.
1
+ # Copyright 2022-2026 Broadcom.
2
2
  # SPDX-License-Identifier: Apache-2.0
3
3
  """
4
4
  Installation and finalization functions for the build process.
@@ -427,7 +427,11 @@ def finalize(
427
427
  :type logfp: file
428
428
  """
429
429
  # Run relok8 to make sure the rpaths are relocatable.
430
- relenv.relocate.main(dirs.prefix, log_file_name=str(dirs.logs / "relocate.py.log"))
430
+ # Modules that don't link to relenv libs will have their RPATH removed
431
+ relenv.relocate.main(
432
+ dirs.prefix,
433
+ log_file_name=str(dirs.logs / "relocate.py.log"),
434
+ )
431
435
  # Install relenv-sysconfigdata module
432
436
  libdir = pathlib.Path(dirs.prefix) / "lib"
433
437
 
relenv/build/common/ui.py CHANGED
@@ -1,4 +1,4 @@
1
- # Copyright 2022-2025 Broadcom.
1
+ # Copyright 2022-2026 Broadcom.
2
2
  # SPDX-License-Identifier: Apache-2.0
3
3
  """
4
4
  UI and build statistics utilities.
relenv/build/darwin.py CHANGED
@@ -1,4 +1,4 @@
1
- # Copyright 2025 Broadcom.
1
+ # Copyright 2025-2026 Broadcom.
2
2
  # SPDX-License-Identifier: Apache-2
3
3
  # mypy: ignore-errors
4
4
  """
relenv/build/linux.py CHANGED
@@ -1,4 +1,4 @@
1
- # Copyright 2025 Broadcom.
1
+ # Copyright 2025-2026 Broadcom.
2
2
  # SPDX-License-Identifier: Apache-2
3
3
  # mypy: ignore-errors
4
4
  """
relenv/build/windows.py CHANGED
@@ -1,4 +1,4 @@
1
- # Copyright 2022-2025 Broadcom.
1
+ # Copyright 2022-2026 Broadcom.
2
2
  # SPDX-License-Identifier: Apache-2
3
3
  # mypy: ignore-errors
4
4
  """
relenv/buildenv.py CHANGED
@@ -1,4 +1,4 @@
1
- # Copyright 2022-2025 Broadcom.
1
+ # Copyright 2022-2026 Broadcom.
2
2
  # SPDX-License-Identifier: Apache-2.0
3
3
  """
4
4
  Helper for building libraries to install into a relenv environment.
relenv/check.py CHANGED
@@ -1,4 +1,4 @@
1
- # Copyright 2022-2025 Broadcom.
1
+ # Copyright 2022-2026 Broadcom.
2
2
  # SPDX-License-Identifier: Apache-2.0
3
3
  """
4
4
  Check the integrety of a relenv environment.
relenv/common.py CHANGED
@@ -1,4 +1,4 @@
1
- # Copyright 2022-2025 Broadcom.
1
+ # Copyright 2022-2026 Broadcom.
2
2
  # SPDX-License-Identifier: Apache-2.0
3
3
  """
4
4
  Common classes and values used around relenv.
@@ -34,14 +34,12 @@ from typing import (
34
34
  )
35
35
 
36
36
  # relenv package version
37
- __version__ = "0.22.0"
37
+ __version__ = "0.22.2"
38
38
 
39
39
  log = logging.getLogger(__name__)
40
40
 
41
41
  MODULE_DIR = pathlib.Path(__file__).resolve().parent
42
42
 
43
- DEFAULT_PYTHON = "3.10.18"
44
-
45
43
  LINUX = "linux"
46
44
  WIN32 = "win32"
47
45
  DARWIN = "darwin"
@@ -68,6 +66,9 @@ def _toolchain_cache_root() -> Optional[pathlib.Path]:
68
66
  if override.strip().lower() == "none":
69
67
  return None
70
68
  return pathlib.Path(override).expanduser()
69
+ # If RELENV_DATA is set, return None to use DATA_DIR/toolchain
70
+ if "RELENV_DATA" in os.environ:
71
+ return None
71
72
  cache_home = os.environ.get("XDG_CACHE_HOME")
72
73
  if cache_home:
73
74
  base = pathlib.Path(cache_home)
relenv/create.py CHANGED
@@ -1,4 +1,4 @@
1
- # Copyright 2022-2025 Broadcom.
1
+ # Copyright 2022-2026 Broadcom.
2
2
  # SPDX-License-Identifier: Apache-2.0
3
3
  """
4
4
  The ``relenv create`` command.
@@ -23,7 +23,11 @@ from .common import (
23
23
  format_shebang,
24
24
  relative_interpreter,
25
25
  )
26
- from .pyversions import Version, python_versions
26
+ from .pyversions import (
27
+ get_default_python_version,
28
+ python_versions,
29
+ resolve_python_version,
30
+ )
27
31
 
28
32
 
29
33
  @contextlib.contextmanager
@@ -73,11 +77,12 @@ def setup_parser(
73
77
  type=str,
74
78
  help="The host architecture [default: %(default)s]",
75
79
  )
80
+ default_version = get_default_python_version()
76
81
  subparser.add_argument(
77
82
  "--python",
78
- default="3.10.17",
83
+ default=default_version,
79
84
  type=str,
80
- help="The python version [default: %(default)s]",
85
+ help="The python version (e.g., 3.10, 3.13.7) [default: %(default)s]",
81
86
  )
82
87
 
83
88
 
@@ -106,8 +111,9 @@ def create(
106
111
  else:
107
112
  writeto = pathlib.Path(name).resolve()
108
113
 
114
+ # Version should be provided by main(), but handle None just in case
109
115
  if version is None:
110
- version = "3.10.17"
116
+ version = get_default_python_version()
111
117
 
112
118
  if pathlib.Path(writeto).exists():
113
119
  raise CreateException("The requested path already exists.")
@@ -253,31 +259,17 @@ def main(args: argparse.Namespace) -> None:
253
259
  "Warning: Cross compilation support is experimental and is not fully tested or working!"
254
260
  )
255
261
 
256
- # Resolve version (support minor version like "3.12" or full version like "3.12.7")
257
- requested = Version(args.python)
258
-
259
- if requested.micro:
260
- # Full version specified (e.g., "3.12.7")
262
+ try:
263
+ create_version = resolve_python_version(args.python)
264
+ except RuntimeError as e:
265
+ print(f"Error: {e}")
261
266
  pyversions = python_versions()
262
- if requested not in pyversions:
263
- print(f"Unknown version {requested}")
264
- strversions = "\n".join([str(_) for _ in pyversions])
265
- print(f"Known versions are:\n{strversions}")
266
- sys.exit(1)
267
- create_version = requested
268
- else:
269
- # Minor version specified (e.g., "3.12"), resolve to latest
270
- pyversions = python_versions(args.python)
271
- if not pyversions:
272
- print(f"Unknown minor version {requested}")
273
- all_versions = python_versions()
274
- strversions = "\n".join([str(_) for _ in all_versions])
275
- print(f"Known versions are:\n{strversions}")
276
- sys.exit(1)
277
- create_version = sorted(list(pyversions.keys()))[-1]
267
+ strversions = "\n".join([str(_) for _ in pyversions])
268
+ print(f"Known versions are:\n{strversions}")
269
+ sys.exit(1)
278
270
 
279
271
  try:
280
- create(name, arch=args.arch, version=str(create_version))
272
+ create(name, arch=args.arch, version=create_version)
281
273
  except CreateException as exc:
282
274
  print(exc)
283
275
  sys.exit(1)
relenv/fetch.py CHANGED
@@ -1,4 +1,4 @@
1
- # Copyright 2022-2025 Broadcom.
1
+ # Copyright 2022-2026 Broadcom.
2
2
  # SPDX-License-Identifier: Apache-2.0
3
3
  # mypy: ignore-errors
4
4
  """
@@ -16,7 +16,6 @@ from .build import platform_module
16
16
  from .common import (
17
17
  CHECK_HOSTS,
18
18
  DATA_DIR,
19
- DEFAULT_PYTHON,
20
19
  __version__,
21
20
  build_arch,
22
21
  check_url,
@@ -24,6 +23,7 @@ from .common import (
24
23
  get_triplet,
25
24
  work_dir,
26
25
  )
26
+ from .pyversions import get_default_python_version, resolve_python_version
27
27
 
28
28
 
29
29
  def setup_parser(
@@ -45,11 +45,12 @@ def setup_parser(
45
45
  type=str,
46
46
  help="Architecture to download. [default: %(default)s]",
47
47
  )
48
+ default_version = get_default_python_version()
48
49
  subparser.add_argument(
49
50
  "--python",
50
- default=DEFAULT_PYTHON,
51
+ default=default_version,
51
52
  type=str,
52
- help="The python version [default: %(default)s]",
53
+ help="The python version (e.g., 3.10, 3.13.7) [default: %(default)s]",
53
54
  )
54
55
 
55
56
 
@@ -87,7 +88,8 @@ def main(args: argparse.Namespace) -> None:
87
88
  """
88
89
  version = os.environ.get("RELENV_FETCH_VERSION", __version__)
89
90
  triplet = get_triplet(machine=args.arch)
90
- python = args.python
91
+ # args.python will be the default version or user-specified version
92
+ python = resolve_python_version(args.python)
91
93
  check_hosts = CHECK_HOSTS
92
94
  if os.environ.get("RELENV_FETCH_HOST", ""):
93
95
  check_hosts = [os.environ["RELENV_FETCH_HOST"]]
relenv/manifest.py CHANGED
@@ -1,4 +1,4 @@
1
- # Copyright 2022-2025 Broadcom.
1
+ # Copyright 2022-2026 Broadcom.
2
2
  # SPDX-License-Identifier: Apache-2.0
3
3
  #
4
4
  """