relenv 0.19.1__tar.gz → 0.19.3__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.
Files changed (45) hide show
  1. {relenv-0.19.1/relenv.egg-info → relenv-0.19.3}/PKG-INFO +1 -1
  2. {relenv-0.19.1 → relenv-0.19.3}/relenv/build/common.py +3 -4
  3. {relenv-0.19.1 → relenv-0.19.3}/relenv/build/darwin.py +3 -3
  4. {relenv-0.19.1 → relenv-0.19.3}/relenv/build/linux.py +3 -3
  5. {relenv-0.19.1 → relenv-0.19.3}/relenv/common.py +73 -1
  6. {relenv-0.19.1 → relenv-0.19.3/relenv.egg-info}/PKG-INFO +1 -1
  7. {relenv-0.19.1 → relenv-0.19.3}/tests/test_verify_build.py +76 -0
  8. {relenv-0.19.1 → relenv-0.19.3}/LICENSE.md +0 -0
  9. {relenv-0.19.1 → relenv-0.19.3}/MANIFEST.in +0 -0
  10. {relenv-0.19.1 → relenv-0.19.3}/NOTICE +0 -0
  11. {relenv-0.19.1 → relenv-0.19.3}/README.md +0 -0
  12. {relenv-0.19.1 → relenv-0.19.3}/pyproject.toml +0 -0
  13. {relenv-0.19.1 → relenv-0.19.3}/relenv/__init__.py +0 -0
  14. {relenv-0.19.1 → relenv-0.19.3}/relenv/__main__.py +0 -0
  15. {relenv-0.19.1 → relenv-0.19.3}/relenv/_scripts/install_vc_build.ps1 +0 -0
  16. {relenv-0.19.1 → relenv-0.19.3}/relenv/_toolchain/aarch64/aarch64-linux-gnu-ct-ng.config +0 -0
  17. {relenv-0.19.1 → relenv-0.19.3}/relenv/_toolchain/aarch64/x86_64-linux-gnu-ct-ng.config +0 -0
  18. {relenv-0.19.1 → relenv-0.19.3}/relenv/_toolchain/x86_64/aarch64-linux-gnu-ct-ng.config +0 -0
  19. {relenv-0.19.1 → relenv-0.19.3}/relenv/_toolchain/x86_64/x86_64-linux-gnu-ct-ng.config +0 -0
  20. {relenv-0.19.1 → relenv-0.19.3}/relenv/build/__init__.py +0 -0
  21. {relenv-0.19.1 → relenv-0.19.3}/relenv/build/windows.py +0 -0
  22. {relenv-0.19.1 → relenv-0.19.3}/relenv/buildenv.py +0 -0
  23. {relenv-0.19.1 → relenv-0.19.3}/relenv/check.py +0 -0
  24. {relenv-0.19.1 → relenv-0.19.3}/relenv/create.py +0 -0
  25. {relenv-0.19.1 → relenv-0.19.3}/relenv/fetch.py +0 -0
  26. {relenv-0.19.1 → relenv-0.19.3}/relenv/relocate.py +0 -0
  27. {relenv-0.19.1 → relenv-0.19.3}/relenv/runtime.py +0 -0
  28. {relenv-0.19.1 → relenv-0.19.3}/relenv/toolchain.py +0 -0
  29. {relenv-0.19.1 → relenv-0.19.3}/relenv.egg-info/SOURCES.txt +0 -0
  30. {relenv-0.19.1 → relenv-0.19.3}/relenv.egg-info/dependency_links.txt +0 -0
  31. {relenv-0.19.1 → relenv-0.19.3}/relenv.egg-info/entry_points.txt +0 -0
  32. {relenv-0.19.1 → relenv-0.19.3}/relenv.egg-info/requires.txt +0 -0
  33. {relenv-0.19.1 → relenv-0.19.3}/relenv.egg-info/top_level.txt +0 -0
  34. {relenv-0.19.1 → relenv-0.19.3}/setup.cfg +0 -0
  35. {relenv-0.19.1 → relenv-0.19.3}/setup.py +0 -0
  36. {relenv-0.19.1 → relenv-0.19.3}/tests/__init__.py +0 -0
  37. {relenv-0.19.1 → relenv-0.19.3}/tests/conftest.py +0 -0
  38. {relenv-0.19.1 → relenv-0.19.3}/tests/test_build.py +0 -0
  39. {relenv-0.19.1 → relenv-0.19.3}/tests/test_common.py +0 -0
  40. {relenv-0.19.1 → relenv-0.19.3}/tests/test_create.py +0 -0
  41. {relenv-0.19.1 → relenv-0.19.3}/tests/test_downloads.py +0 -0
  42. {relenv-0.19.1 → relenv-0.19.3}/tests/test_fips_photon.py +0 -0
  43. {relenv-0.19.1 → relenv-0.19.3}/tests/test_relocate.py +0 -0
  44. {relenv-0.19.1 → relenv-0.19.3}/tests/test_runtime.py +0 -0
  45. {relenv-0.19.1 → relenv-0.19.3}/tests/test_toolchain.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: relenv
3
- Version: 0.19.1
3
+ Version: 0.19.3
4
4
  Project-URL: Source Code, https://github.com/saltstack/relative-environment-for-python
5
5
  Project-URL: Documentation, https://relenv.readthedocs.io/en/latest/
6
6
  Project-URL: Changelog, https://relenv.readthedocs.io/en/latest/changelog.html
@@ -336,13 +336,13 @@ def build_sqlite(env, dirs, logfp):
336
336
  # ]
337
337
  cmd = [
338
338
  "./configure",
339
- "--with-shared",
340
- "--without-static",
339
+ # "--with-shared",
340
+ # "--without-static",
341
341
  "--enable-threadsafe",
342
342
  "--disable-readline",
343
343
  "--disable-dependency-tracking",
344
344
  "--prefix={}".format(dirs.prefix),
345
- "--enable-add-ons=nptl,ports",
345
+ # "--enable-add-ons=nptl,ports",
346
346
  ]
347
347
  if env["RELENV_HOST"].find("linux") > -1:
348
348
  cmd += [
@@ -1555,7 +1555,6 @@ def finalize(env, dirs, logfp):
1555
1555
  "/include/*",
1556
1556
  "*.so",
1557
1557
  "/lib/*.so.*",
1558
- "*.a",
1559
1558
  "*.py",
1560
1559
  # Mac specific, factor this out
1561
1560
  "*.dylib",
@@ -97,10 +97,10 @@ build.add(
97
97
  name="SQLite",
98
98
  build_func=build_sqlite,
99
99
  download={
100
- "url": "https://sqlite.org/2024/sqlite-autoconf-{version}.tar.gz",
100
+ "url": "https://sqlite.org/2025/sqlite-autoconf-{version}.tar.gz",
101
101
  "fallback_url": "https://woz.io/relenv/dependencies/sqlite-autoconf-{version}.tar.gz",
102
- "version": "3460100",
103
- "checksum": "1fdbada080f3285ac864c314bfbfc581b13e804b",
102
+ "version": "3500100",
103
+ "checksum": "837f8f5c5ddbaf806f0555fd7d62f4c290c0e2c2",
104
104
  },
105
105
  )
106
106
 
@@ -499,9 +499,9 @@ build.add(
499
499
  name="SQLite",
500
500
  build_func=build_sqlite,
501
501
  download={
502
- "url": "https://sqlite.org/2024/sqlite-autoconf-{version}.tar.gz",
503
- "version": "3460100",
504
- "checksum": "1fdbada080f3285ac864c314bfbfc581b13e804b",
502
+ "url": "https://sqlite.org/2025/sqlite-autoconf-{version}.tar.gz",
503
+ "version": "3500100",
504
+ "checksum": "837f8f5c5ddbaf806f0555fd7d62f4c290c0e2c2",
505
505
  "checkfunc": sqlite_version,
506
506
  "checkurl": "https://sqlite.org/",
507
507
  },
@@ -18,7 +18,7 @@ import threading
18
18
  import time
19
19
 
20
20
  # relenv package version
21
- __version__ = "0.19.1"
21
+ __version__ = "0.19.3"
22
22
 
23
23
  MODULE_DIR = pathlib.Path(__file__).resolve().parent
24
24
 
@@ -543,6 +543,72 @@ def relative_interpreter(root_dir, scripts_dir, interpreter):
543
543
  return relscripts / relinterp
544
544
 
545
545
 
546
+ def makepath(*paths):
547
+ """
548
+ Make a normalized path name from paths.
549
+ """
550
+ dir = os.path.join(*paths)
551
+ try:
552
+ dir = os.path.abspath(dir)
553
+ except OSError:
554
+ pass
555
+ return dir, os.path.normcase(dir)
556
+
557
+
558
+ def addpackage(sitedir, name):
559
+ """
560
+ Add editable package to path.
561
+ """
562
+ import io
563
+ import stat
564
+
565
+ fullname = os.path.join(sitedir, name)
566
+ paths = []
567
+ try:
568
+ st = os.lstat(fullname)
569
+ except OSError:
570
+ return
571
+ if (getattr(st, "st_flags", 0) & stat.UF_HIDDEN) or (
572
+ getattr(st, "st_file_attributes", 0) & stat.FILE_ATTRIBUTE_HIDDEN
573
+ ):
574
+ # print(f"Skipping hidden .pth file: {fullname!r}")
575
+ return
576
+ # print(f"Processing .pth file: {fullname!r}")
577
+ try:
578
+ # locale encoding is not ideal especially on Windows. But we have used
579
+ # it for a long time. setuptools uses the locale encoding too.
580
+ f = io.TextIOWrapper(io.open_code(fullname), encoding="locale")
581
+ except OSError:
582
+ return
583
+ with f:
584
+ for n, line in enumerate(f):
585
+ if line.startswith("#"):
586
+ continue
587
+ if line.strip() == "":
588
+ continue
589
+ try:
590
+ if line.startswith(("import ", "import\t")):
591
+ exec(line)
592
+ continue
593
+ line = line.rstrip()
594
+ dir, dircase = makepath(sitedir, line)
595
+ if dircase not in paths and os.path.exists(dir):
596
+ paths.append(dir)
597
+ except Exception:
598
+ print(
599
+ "Error processing line {:d} of {}:\n".format(n + 1, fullname),
600
+ file=sys.stderr,
601
+ )
602
+ import traceback
603
+
604
+ for record in traceback.format_exception(*sys.exc_info()):
605
+ for line in record.splitlines():
606
+ print(" " + line, file=sys.stderr)
607
+ print("\nRemainder of file ignored", file=sys.stderr)
608
+ break
609
+ return paths
610
+
611
+
546
612
  def sanitize_sys_path(sys_path_entries):
547
613
  """
548
614
  Sanitize `sys.path` to only include paths relative to the onedir environment.
@@ -565,4 +631,10 @@ def sanitize_sys_path(sys_path_entries):
565
631
  if "PYTHONPATH" in os.environ:
566
632
  for __path in os.environ["PYTHONPATH"].split(os.pathsep):
567
633
  __sys_path.append(__path)
634
+ for known_path in __sys_path[:]:
635
+ for _ in pathlib.Path(known_path).glob("__editable__.*.pth"):
636
+ paths = addpackage(known_path, _)
637
+ for p in paths:
638
+ if p not in __sys_path:
639
+ __sys_path.append(p)
568
640
  return __sys_path
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: relenv
3
- Version: 0.19.1
3
+ Version: 0.19.3
4
4
  Project-URL: Source Code, https://github.com/saltstack/relative-environment-for-python
5
5
  Project-URL: Documentation, https://relenv.readthedocs.io/en/latest/
6
6
  Project-URL: Changelog, https://relenv.readthedocs.io/en/latest/changelog.html
@@ -25,6 +25,28 @@ pytestmark = [
25
25
  ]
26
26
 
27
27
 
28
+ EXTRAS_PY = """
29
+ import pathlib
30
+ import sys
31
+
32
+
33
+ def setup(pth_file_path):
34
+ # Discover the extras-<py-major>.<py-minor> directory
35
+ extras_parent_path = pathlib.Path(pth_file_path).resolve().parent.parent
36
+ if not sys.platform.startswith("win"):
37
+ extras_parent_path = extras_parent_path.parent
38
+
39
+ extras_path = str(extras_parent_path / "extras-{}.{}".format(*sys.version_info))
40
+
41
+ if extras_path in sys.path and sys.path[0] != extras_path:
42
+ # The extras directory must come first
43
+ sys.path.remove(extras_path)
44
+
45
+ if extras_path not in sys.path:
46
+ sys.path.insert(0, extras_path)
47
+ """
48
+
49
+
28
50
  @pytest.fixture(scope="module")
29
51
  def arch():
30
52
  return build_arch()
@@ -1454,3 +1476,57 @@ def test_install_pyinotify_w_latest_pip(pipexec, build, minor_version):
1454
1476
  )
1455
1477
  assert p.returncode == 0, "Failed install pyinotify"
1456
1478
  assert (extras / "pyinotify.py").exists()
1479
+
1480
+
1481
+ @pytest.mark.skip_unless_on_linux
1482
+ def test_install_editable_package(pipexec, pyexec, build, minor_version, tmp_path):
1483
+ os.chdir(tmp_path)
1484
+ env = os.environ.copy()
1485
+ env["RELENV_BUILDENV"] = "yes"
1486
+ p = subprocess.run(
1487
+ [
1488
+ "git",
1489
+ "clone",
1490
+ "https://github.com/salt-extensions/saltext-zabbix.git",
1491
+ "--depth",
1492
+ "1",
1493
+ ],
1494
+ env=env,
1495
+ )
1496
+ assert p.returncode == 0
1497
+ p = subprocess.run([str(pipexec), "install", "-e", "saltext-zabbix"], env=env)
1498
+ assert p.returncode == 0
1499
+ p = subprocess.run([str(pyexec), "-c", "import saltext.zabbix"], env=env)
1500
+ assert p.returncode == 0
1501
+
1502
+
1503
+ @pytest.mark.skip_unless_on_linux
1504
+ def test_install_editable_package_in_extras(
1505
+ pipexec, pyexec, build, minor_version, tmp_path
1506
+ ):
1507
+ sitepkgs = pathlib.Path(build) / "lib" / f"python{minor_version}" / "site-packages"
1508
+
1509
+ (sitepkgs / "_extras.pth").write_text("import _extras; _extras.setup(__file__)")
1510
+ (sitepkgs / "_extras.py").write_text(EXTRAS_PY)
1511
+ extras = pathlib.Path(build) / f"extras-{minor_version}"
1512
+ extras.mkdir()
1513
+ os.chdir(tmp_path)
1514
+ env = os.environ.copy()
1515
+ env["RELENV_BUILDENV"] = "yes"
1516
+ p = subprocess.run(
1517
+ [
1518
+ "git",
1519
+ "clone",
1520
+ "https://github.com/salt-extensions/saltext-zabbix.git",
1521
+ "--depth",
1522
+ "1",
1523
+ ],
1524
+ env=env,
1525
+ )
1526
+ assert p.returncode == 0
1527
+ p = subprocess.run(
1528
+ [str(pipexec), "install", f"--target={extras}", "-e", "saltext-zabbix"], env=env
1529
+ )
1530
+ assert p.returncode == 0
1531
+ p = subprocess.run([str(pyexec), "-c", "import saltext.zabbix"], env=env)
1532
+ assert p.returncode == 0
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes