portable-python 1.9.7__tar.gz → 1.9.9__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 (38) hide show
  1. {portable_python-1.9.7/src/portable_python.egg-info → portable_python-1.9.9}/PKG-INFO +3 -4
  2. {portable_python-1.9.7 → portable_python-1.9.9}/pyproject.toml +1 -1
  3. {portable_python-1.9.7 → portable_python-1.9.9}/setup.py +2 -3
  4. {portable_python-1.9.7 → portable_python-1.9.9}/src/portable_python/__init__.py +80 -11
  5. {portable_python-1.9.7 → portable_python-1.9.9}/src/portable_python/cpython.py +10 -3
  6. {portable_python-1.9.7 → portable_python-1.9.9}/src/portable_python/external/__init__.py +1 -1
  7. {portable_python-1.9.7 → portable_python-1.9.9}/src/portable_python/external/xcpython.py +147 -88
  8. {portable_python-1.9.7 → portable_python-1.9.9}/src/portable_python/external/xtkinter.py +3 -3
  9. {portable_python-1.9.7 → portable_python-1.9.9/src/portable_python.egg-info}/PKG-INFO +3 -4
  10. {portable_python-1.9.7 → portable_python-1.9.9}/tests/test_setup.py +7 -0
  11. {portable_python-1.9.7 → portable_python-1.9.9}/DEVELOP.md +0 -0
  12. {portable_python-1.9.7 → portable_python-1.9.9}/LICENSE +0 -0
  13. {portable_python-1.9.7 → portable_python-1.9.9}/MANIFEST.in +0 -0
  14. {portable_python-1.9.7 → portable_python-1.9.9}/README.rst +0 -0
  15. {portable_python-1.9.7 → portable_python-1.9.9}/SECURITY.md +0 -0
  16. {portable_python-1.9.7 → portable_python-1.9.9}/requirements.txt +0 -0
  17. {portable_python-1.9.7 → portable_python-1.9.9}/setup.cfg +0 -0
  18. {portable_python-1.9.7 → portable_python-1.9.9}/src/portable_python/__main__.py +0 -0
  19. {portable_python-1.9.7 → portable_python-1.9.9}/src/portable_python/cli.py +0 -0
  20. {portable_python-1.9.7 → portable_python-1.9.9}/src/portable_python/config.py +0 -0
  21. {portable_python-1.9.7 → portable_python-1.9.9}/src/portable_python/external/_inspect.py +0 -0
  22. {portable_python-1.9.7 → portable_python-1.9.9}/src/portable_python/inspector.py +0 -0
  23. {portable_python-1.9.7 → portable_python-1.9.9}/src/portable_python/tracking.py +0 -0
  24. {portable_python-1.9.7 → portable_python-1.9.9}/src/portable_python/versions.py +0 -0
  25. {portable_python-1.9.7 → portable_python-1.9.9}/src/portable_python.egg-info/SOURCES.txt +0 -0
  26. {portable_python-1.9.7 → portable_python-1.9.9}/src/portable_python.egg-info/dependency_links.txt +0 -0
  27. {portable_python-1.9.7 → portable_python-1.9.9}/src/portable_python.egg-info/entry_points.txt +0 -0
  28. {portable_python-1.9.7 → portable_python-1.9.9}/src/portable_python.egg-info/requires.txt +0 -0
  29. {portable_python-1.9.7 → portable_python-1.9.9}/src/portable_python.egg-info/top_level.txt +0 -0
  30. {portable_python-1.9.7 → portable_python-1.9.9}/tests/test_build.py +0 -0
  31. {portable_python-1.9.7 → portable_python-1.9.9}/tests/test_cleanup.py +0 -0
  32. {portable_python-1.9.7 → portable_python-1.9.9}/tests/test_failed.py +0 -0
  33. {portable_python-1.9.7 → portable_python-1.9.9}/tests/test_inspector.py +0 -0
  34. {portable_python-1.9.7 → portable_python-1.9.9}/tests/test_invoker.py +0 -0
  35. {portable_python-1.9.7 → portable_python-1.9.9}/tests/test_list.py +0 -0
  36. {portable_python-1.9.7 → portable_python-1.9.9}/tests/test_prefix.py +0 -0
  37. {portable_python-1.9.7 → portable_python-1.9.9}/tests/test_recompress.py +0 -0
  38. {portable_python-1.9.7 → portable_python-1.9.9}/tests/test_report.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: portable-python
3
- Version: 1.9.7
3
+ Version: 1.9.9
4
4
  Summary: Portable python binaries
5
5
  Home-page: https://github.com/codrsquad/portable-python
6
6
  Author: Zoran Simic
@@ -18,19 +18,18 @@ Classifier: Operating System :: POSIX
18
18
  Classifier: Operating System :: Unix
19
19
  Classifier: Programming Language :: Python
20
20
  Classifier: Programming Language :: Python :: 3
21
- Classifier: Programming Language :: Python :: 3.6
22
- Classifier: Programming Language :: Python :: 3.7
23
21
  Classifier: Programming Language :: Python :: 3.8
24
22
  Classifier: Programming Language :: Python :: 3.9
25
23
  Classifier: Programming Language :: Python :: 3.10
26
24
  Classifier: Programming Language :: Python :: 3.11
27
25
  Classifier: Programming Language :: Python :: 3.12
26
+ Classifier: Programming Language :: Python :: 3.13
28
27
  Classifier: Programming Language :: Python :: Implementation :: CPython
29
28
  Classifier: Topic :: Software Development :: Build Tools
30
29
  Classifier: Topic :: System :: Installation/Setup
31
30
  Classifier: Topic :: System :: Software Distribution
32
31
  Classifier: Topic :: Utilities
33
- Requires-Python: >=3.6
32
+ Requires-Python: >=3.8
34
33
  Description-Content-Type: text/x-rst
35
34
  License-File: LICENSE
36
35
  Requires-Dist: click~=8.0
@@ -63,7 +63,7 @@ ignore = [
63
63
  order-by-type = false
64
64
 
65
65
  [tool.ruff.lint.mccabe]
66
- max-complexity = 14
66
+ max-complexity = 18
67
67
 
68
68
  [tool.ruff.lint.pydocstyle]
69
69
  convention = "numpy"
@@ -7,7 +7,7 @@ setup(
7
7
  author="Zoran Simic zoran@simicweb.com",
8
8
  keywords="python, portable, binary",
9
9
  url="https://github.com/codrsquad/portable-python",
10
- python_requires=">=3.6",
10
+ python_requires=">=3.8",
11
11
  entry_points={
12
12
  "console_scripts": [
13
13
  "portable-python = portable_python.__main__:main",
@@ -22,13 +22,12 @@ setup(
22
22
  "Operating System :: Unix",
23
23
  "Programming Language :: Python",
24
24
  "Programming Language :: Python :: 3",
25
- "Programming Language :: Python :: 3.6",
26
- "Programming Language :: Python :: 3.7",
27
25
  "Programming Language :: Python :: 3.8",
28
26
  "Programming Language :: Python :: 3.9",
29
27
  "Programming Language :: Python :: 3.10",
30
28
  "Programming Language :: Python :: 3.11",
31
29
  "Programming Language :: Python :: 3.12",
30
+ "Programming Language :: Python :: 3.13",
32
31
  "Programming Language :: Python :: Implementation :: CPython",
33
32
  "Topic :: Software Development :: Build Tools",
34
33
  "Topic :: System :: Installation/Setup",
@@ -15,6 +15,7 @@ import multiprocessing
15
15
  import os
16
16
  import pathlib
17
17
  import re
18
+ from string import Template
18
19
  from typing import ClassVar, List
19
20
 
20
21
  import runez
@@ -491,11 +492,47 @@ class ModuleBuilder:
491
492
  def cfg_version(self, default):
492
493
  return PPG.config.get_value("%s-version" % self.m_name) or default
493
494
 
495
+ def cfg_http_headers(self):
496
+ if config_http_headers := PPG.config.get_value("%s-http-headers" % self.m_name):
497
+ expanded_http_headers = {}
498
+ for header_dict in config_http_headers:
499
+ for key, value in header_dict.items():
500
+ expanded_http_headers[os.path.expandvars(key)] = os.path.expandvars(value)
501
+
502
+ return expanded_http_headers
503
+
504
+ def cfg_url(self, version):
505
+ if config_url := PPG.config.get_value("%s-url" % self.m_name):
506
+ url_template = Template(config_url)
507
+ url_subbed = url_template.substitute(version=version)
508
+ return os.path.expandvars(url_subbed)
509
+
510
+ def cfg_src_suffix(self):
511
+ return PPG.config.get_value("%s-src-suffix" % self.m_name)
512
+
513
+ def cfg_configure(self, deps_lib_dir, deps_lib64_dir):
514
+ if configure := PPG.config.get_value("%s-configure" % self.m_name):
515
+ configure_template = Template(configure)
516
+ return configure_template.substitute(lib_dir=deps_lib_dir, lib64_dir=deps_lib64_dir)
517
+
518
+ def cfg_patches(self):
519
+ return PPG.config.get_value("%s-patches" % self.m_name)
520
+
494
521
  @property
495
522
  def url(self):
496
523
  """Url of source tarball, if any"""
497
524
  return ""
498
525
 
526
+ @property
527
+ def headers(self):
528
+ """Headers for connecting to source url, if any"""
529
+ return self.cfg_http_headers()
530
+
531
+ @property
532
+ def src_suffix(self):
533
+ """Suffix of src archive for when URL doesn't end in the file extension"""
534
+ return self.cfg_src_suffix()
535
+
499
536
  @property
500
537
  def version(self):
501
538
  """Version to use"""
@@ -507,9 +544,20 @@ class ModuleBuilder:
507
544
  return self.setup.folders.deps
508
545
 
509
546
  @property
510
- def deps_lib(self):
547
+ def deps_lib_dir(self):
511
548
  return self.deps / "lib"
512
549
 
550
+ @property
551
+ def deps_lib64_dir(self):
552
+ return self.deps / "lib64"
553
+
554
+ @property
555
+ def deps_lib_dirs(self):
556
+ lib_dirs = [self.deps_lib_dir]
557
+ if self.deps_lib64_dir.exists():
558
+ lib_dirs.append(self.deps_lib64_dir)
559
+ return lib_dirs
560
+
513
561
  def xenv_CPATH(self):
514
562
  folder = self.deps / "include"
515
563
  if folder.exists():
@@ -522,7 +570,7 @@ class ModuleBuilder:
522
570
 
523
571
  def xenv_LDFLAGS(self):
524
572
  if self.modules.selected:
525
- yield f"-L{self.deps_lib}"
573
+ yield from (f"-L{lib_dir}" for lib_dir in self.deps_lib_dirs)
526
574
 
527
575
  def xenv_PATH(self):
528
576
  yield f"{self.deps}/bin"
@@ -536,7 +584,7 @@ class ModuleBuilder:
536
584
  def xenv_PKG_CONFIG_PATH(self):
537
585
  yield from os.environ.get("PKG_CONFIG_PATH", "").split(":")
538
586
  if self.modules.selected:
539
- yield f"{self.deps_lib}/pkgconfig"
587
+ yield from (f"{lib_dir}/pkgconfig" for lib_dir in self.deps_lib_dirs)
540
588
 
541
589
  def _do_run(self, program, *args, fatal=True, env=None):
542
590
  return runez.run(program, *args, passthrough=self._log_handler, stdout=None, stderr=None, fatal=fatal, env=env)
@@ -607,8 +655,16 @@ class ModuleBuilder:
607
655
  self._finalize()
608
656
  return
609
657
 
658
+ # Some URL's may not end in file extension, such as with redirects.
659
+ # Github releases asset endpoint is this way .../releases/assets/48151
660
+
610
661
  # Split on '#' for urls that include a checksum, such as #sha256=... fragment
611
662
  basename = runez.basename(self.url, extension_marker="#")
663
+ if not basename.endswith((".zip", ".tar.gz")):
664
+ suffix = self.src_suffix or ".tar.gz"
665
+ suffix = ".%s" % (suffix.strip(".")) # Ensure it starts with a dot (in case config forgot leading dot)
666
+ basename = f"{self.m_name}-{self.version}{suffix}"
667
+
612
668
  path = self.setup.folders.sources / basename
613
669
  if not path.exists():
614
670
  proxies = {}
@@ -618,7 +674,8 @@ class ModuleBuilder:
618
674
  https_proxy = os.environ.get("HTTPS_PROXY") or os.environ.get("https_proxy")
619
675
  if https_proxy:
620
676
  proxies["https"] = https_proxy
621
- RestClient().download(self.url, path, proxies=proxies)
677
+
678
+ RestClient().download(self.url, path, proxies=proxies, headers=self.headers)
622
679
 
623
680
  runez.decompress(path, self.m_src_build, simplify=True)
624
681
 
@@ -639,6 +696,7 @@ class ModuleBuilder:
639
696
  folder = folder / self.m_build_cwd
640
697
 
641
698
  with runez.CurrentFolder(folder):
699
+ self._apply_patches()
642
700
  self._prepare()
643
701
  func()
644
702
  self._finalize()
@@ -652,6 +710,15 @@ class ModuleBuilder:
652
710
  else:
653
711
  os.environ[k] = v
654
712
 
713
+ def _apply_patches(self):
714
+ if patches := self.cfg_patches():
715
+ for patch in patches:
716
+ if runez.DRYRUN:
717
+ print(f"Would apply patch: {patch}")
718
+ else:
719
+ print(f"Applying patch: {patch}")
720
+ patch_file(patch["file"], patch["regex"], patch["replacement"])
721
+
655
722
  def _get_env_vars(self):
656
723
  """Yield all found env vars, first found wins"""
657
724
  result = {}
@@ -747,10 +814,12 @@ class PythonBuilder(ModuleBuilder):
747
814
  # Some libs get funky permissions for some reason
748
815
  super()._prepare()
749
816
  self.setup.ensure_clean_folder(self.install_folder)
750
- for path in runez.ls_dir(self.deps_lib):
751
- if not path.name.endswith(".la"):
752
- expected = 0o755 if path.is_dir() else 0o644
753
- current = path.stat().st_mode & 0o777
754
- if current != expected:
755
- LOG.info("Corrected permissions for %s (was %s)", runez.short(path), oct(current))
756
- path.chmod(expected)
817
+
818
+ for lib_dir in self.deps_lib_dirs:
819
+ for path in runez.ls_dir(lib_dir):
820
+ if not path.name.endswith(".la"):
821
+ expected = 0o755 if path.is_dir() else 0o644
822
+ current = path.stat().st_mode & 0o777
823
+ if current != expected:
824
+ LOG.info("Corrected permissions for %s (was %s)", runez.short(path), oct(current))
825
+ path.chmod(expected)
@@ -104,10 +104,13 @@ class Cpython(PythonBuilder):
104
104
  if PPG.config.get_value("cpython-use-github"):
105
105
  return f"https://github.com/python/cpython/archive/refs/tags/v{self.version}.tar.gz"
106
106
 
107
+ if cfg_url := self.cfg_url(self.version):
108
+ return cfg_url
109
+
107
110
  return f"https://www.python.org/ftp/python/{self.version.main}/Python-{self.version}.tar.xz"
108
111
 
109
112
  def xenv_LDFLAGS_NODIST(self):
110
- yield f"-L{self.deps_lib}"
113
+ yield from (f"-L{lib_dir}" for lib_dir in self.deps_lib_dirs)
111
114
  if PPG.target.is_linux:
112
115
  yield "-Wl,-z,origin"
113
116
  # rpath intentionally long to give 'patchelf' some room
@@ -139,7 +142,7 @@ class Cpython(PythonBuilder):
139
142
 
140
143
  if not self.has_configure_opt("--with-system-ffi"):
141
144
  if self.active_module(LibFFI):
142
- yield f"LIBFFI_INCLUDEDIR={self.deps_lib}"
145
+ yield f"LIBFFI_INCLUDEDIR={self.deps_lib_dir}"
143
146
  yield "--with-system-ffi=no"
144
147
 
145
148
  else:
@@ -163,7 +166,11 @@ class Cpython(PythonBuilder):
163
166
  # TODO: this doesn't seem to be enough, on macos cpython's ./configure still picks up the shared macos tcl/tk libs
164
167
  version = Version(tkinter.version)
165
168
  yield f"--with-tcltk-includes=-I{self.deps}/include"
166
- yield f"--with-tcltk-libs=-L{self.deps_lib} -ltcl{version.mm} -ltk{version.mm}"
169
+
170
+ lib_dir_flags = " ".join(f"-L{lib_dir}" for lib_dir in self.deps_lib_dirs)
171
+ yield f"--with-tcltk-libs={lib_dir_flags}"
172
+ yield f"-ltcl{version.mm}"
173
+ yield f"-ltk{version.mm}"
167
174
 
168
175
  @runez.cached_property
169
176
  def prefix_lib_folder(self):
@@ -6,7 +6,7 @@ class GettextTiny(ModuleBuilder):
6
6
 
7
7
  @property
8
8
  def url(self):
9
- return f"https://github.com/sabotage-linux/gettext-tiny/archive/refs/tags/v{self.version}.tar.gz"
9
+ return self.cfg_url(self.version) or f"https://github.com/sabotage-linux/gettext-tiny/archive/refs/tags/v{self.version}.tar.gz"
10
10
 
11
11
  @property
12
12
  def version(self):
@@ -21,14 +21,24 @@ class Bdb(ModuleBuilder):
21
21
 
22
22
  @property
23
23
  def url(self):
24
- return f"https://ftp.osuosl.org/pub/blfs/conglomeration/db/db-{self.version}.tar.gz"
24
+ return self.cfg_url(self.version) or f"https://ftp.osuosl.org/pub/blfs/conglomeration/db/db-{self.version}.tar.gz"
25
25
 
26
26
  @property
27
27
  def version(self):
28
28
  return self.cfg_version("6.2.32")
29
29
 
30
+ def c_configure_args(self):
31
+ if config_args := self.cfg_configure(self.deps_lib_dir, self.deps_lib64_dir):
32
+ yield config_args
33
+
34
+ else:
35
+ yield "--enable-shared=no"
36
+ yield "--enable-static=yes"
37
+ yield "--enable-dbm"
38
+ yield "--with-pic=yes"
39
+
30
40
  def _do_linux_compile(self):
31
- self.run_configure("../dist/configure", "--enable-shared=no", "--enable-static=yes", "--enable-dbm", "--with-pic=yes")
41
+ self.run_configure("../dist/configure", self.c_configure_args())
32
42
  self.run_make()
33
43
  self.run_make("install")
34
44
 
@@ -46,7 +56,7 @@ class Bzip2(ModuleBuilder):
46
56
 
47
57
  @property
48
58
  def url(self):
49
- return f"https://sourceware.org/pub/bzip2/bzip2-{self.version}.tar.gz"
59
+ return self.cfg_url(self.version) or f"https://sourceware.org/pub/bzip2/bzip2-{self.version}.tar.gz"
50
60
 
51
61
  @property
52
62
  def version(self):
@@ -70,27 +80,30 @@ class Gdbm(ModuleBuilder):
70
80
 
71
81
  @property
72
82
  def url(self):
73
- return f"https://ftp.gnu.org/gnu/gdbm/gdbm-{self.version}.tar.gz"
83
+ return self.cfg_url(self.version) or f"https://ftp.gnu.org/gnu/gdbm/gdbm-{self.version}.tar.gz"
74
84
 
75
85
  @property
76
86
  def version(self):
77
87
  return self.cfg_version("1.24")
78
88
 
89
+ def c_configure_args(self):
90
+ if config_args := self.cfg_configure(self.deps_lib_dir, self.deps_lib64_dir):
91
+ yield config_args
92
+
93
+ else:
94
+ yield "--enable-shared=no"
95
+ yield "--enable-static=yes"
96
+ yield "--with-pic=yes"
97
+ yield "--disable-nls"
98
+ yield "--disable-dependency-tracking"
99
+ yield "--disable-rpath"
100
+ yield "--disable-silent-rules"
101
+ yield "--without-libiconv-prefix"
102
+ yield "--without-libintl-prefix"
103
+ yield "--without-readline"
104
+
79
105
  def _do_linux_compile(self):
80
- self.run_configure(
81
- "./configure",
82
- "--enable-shared=no",
83
- "--enable-static=yes",
84
- "--with-pic=yes",
85
- "--enable-libgdbm-compat",
86
- "--disable-dependency-tracking",
87
- "--disable-nls",
88
- "--disable-rpath",
89
- "--disable-silent-rules",
90
- "--without-libiconv-prefix",
91
- "--without-libintl-prefix",
92
- "--without-readline",
93
- )
106
+ self.run_configure("./configure", self.c_configure_args())
94
107
  self.run_make()
95
108
  self.run_make("install")
96
109
  runez.move(self.deps / "include/ndbm.h", self.deps / "include/gdbm-ndbm.h")
@@ -110,21 +123,27 @@ class LibFFI(ModuleBuilder):
110
123
 
111
124
  @property
112
125
  def url(self):
113
- return f"https://github.com/libffi/libffi/releases/download/v{self.version}/libffi-{self.version}.tar.gz"
126
+ return (
127
+ self.cfg_url(self.version) or f"https://github.com/libffi/libffi/releases/download/v{self.version}/libffi-{self.version}.tar.gz"
128
+ )
114
129
 
115
130
  @property
116
131
  def version(self):
117
132
  return self.cfg_version("3.4.6")
118
133
 
134
+ def c_configure_args(self):
135
+ if config_args := self.cfg_configure(self.deps_lib_dir, self.deps_lib64_dir):
136
+ yield config_args
137
+
138
+ else:
139
+ yield "--enable-shared=no"
140
+ yield "--enable-static=yes"
141
+ yield "--with-pic=yes"
142
+ yield PPG.target.is_macos and "--disable-multi-os-directory"
143
+ yield "--disable-docs"
144
+
119
145
  def _do_linux_compile(self):
120
- self.run_configure(
121
- "./configure",
122
- "--enable-shared=no",
123
- "--enable-static=yes",
124
- "--with-pic=yes",
125
- PPG.target.is_macos and "--disable-multi-os-directory",
126
- "--disable-docs",
127
- )
146
+ self.run_configure("./configure", self.c_configure_args())
128
147
  self.run_make()
129
148
  self.run_make("install")
130
149
 
@@ -146,7 +165,10 @@ class Openssl(ModuleBuilder):
146
165
  if self.version and self.version.startswith("1.1.1"):
147
166
  # Not sure why URL suddenly changed for this on github...
148
167
  vfolder = self.version.replace(".", "_")
149
- return f"https://github.com/openssl/openssl/releases/download/OpenSSL_{vfolder}/openssl-{self.version}.tar.gz"
168
+ return (
169
+ self.cfg_url(self.version)
170
+ or f"https://github.com/openssl/openssl/releases/download/OpenSSL_{vfolder}/openssl-{self.version}.tar.gz"
171
+ )
150
172
 
151
173
  return f"https://github.com/openssl/openssl/releases/download/openssl-{self.version}/openssl-{self.version}.tar.gz"
152
174
 
@@ -157,11 +179,16 @@ class Openssl(ModuleBuilder):
157
179
  return self.cfg_version("3.0.15")
158
180
 
159
181
  def c_configure_args(self):
160
- yield "--openssldir=/etc/ssl"
161
- yield "no-shared", "no-idea", "no-tests"
182
+ if config_args := self.cfg_configure(self.deps_lib_dir, self.deps_lib64_dir):
183
+ yield config_args
184
+
185
+ else:
186
+ yield "-v"
187
+ yield "--openssldir=/etc/ssl"
188
+ yield "no-shared", "no-idea", "no-tests"
162
189
 
163
190
  def _do_linux_compile(self):
164
- self.run_configure("./config", "-v", self.c_configure_args())
191
+ self.run_configure("./config", self.c_configure_args())
165
192
  self.run_make("depend")
166
193
  self.run_make()
167
194
  self.run_make("install_sw") # See https://github.com/openssl/openssl/issues/8170
@@ -174,33 +201,37 @@ class Ncurses(ModuleBuilder):
174
201
 
175
202
  @property
176
203
  def url(self):
177
- return f"https://ftp.gnu.org/pub/gnu/ncurses/ncurses-{self.version}.tar.gz"
204
+ return self.cfg_url(self.version) or f"https://ftp.gnu.org/pub/gnu/ncurses/ncurses-{self.version}.tar.gz"
178
205
 
179
206
  @property
180
207
  def version(self):
181
208
  return self.cfg_version("6.5")
182
209
 
183
210
  def c_configure_args(self):
184
- yield "--disable-shared"
185
- yield "--enable-static"
186
- yield "--without-ada"
187
- yield "--disable-db-install"
188
- yield "--without-manpages"
189
- yield "--without-progs"
190
- yield "--without-tests"
191
- yield f"--with-pkg-config-libdir={self.deps_lib}/pkgconfig"
192
- yield "--enable-pc-files"
193
- yield "--with-debug=no"
194
- yield "--with-gpm=no"
195
- yield "--enable-widec"
196
- yield "--enable-symlinks"
197
- yield "--enable-sigwinch"
198
- yield "--without-develop"
199
- if PPG.target.is_linux:
200
- yield "--with-terminfo-dirs=/etc/terminfo:/lib/terminfo:/usr/share/terminfo"
201
-
202
- if PPG.target.is_macos:
203
- yield "--with-terminfo-dirs=/usr/share/terminfo"
211
+ if config_args := self.cfg_configure(self.deps_lib_dir, self.deps_lib64_dir):
212
+ yield config_args
213
+
214
+ else:
215
+ yield "--disable-shared"
216
+ yield "--enable-static"
217
+ yield "--without-ada"
218
+ yield "--disable-db-install"
219
+ yield "--without-manpages"
220
+ yield "--without-progs"
221
+ yield "--without-tests"
222
+ yield f"--with-pkg-config-libdir={self.deps_lib_dir}/pkgconfig"
223
+ yield "--enable-pc-files"
224
+ yield "--with-debug=no"
225
+ yield "--with-gpm=no"
226
+ yield "--enable-widec"
227
+ yield "--enable-symlinks"
228
+ yield "--enable-sigwinch"
229
+ yield "--without-develop"
230
+ if PPG.target.is_linux:
231
+ yield "--with-terminfo-dirs=/etc/terminfo:/lib/terminfo:/usr/share/terminfo"
232
+
233
+ if PPG.target.is_macos:
234
+ yield "--with-terminfo-dirs=/usr/share/terminfo"
204
235
 
205
236
  def _do_linux_compile(self):
206
237
  self.run_configure("./configure", self.c_configure_args())
@@ -227,23 +258,27 @@ class Readline(ModuleBuilder):
227
258
 
228
259
  @property
229
260
  def url(self):
230
- return f"https://ftp.gnu.org/gnu/readline/readline-{self.version}.tar.gz"
261
+ return self.cfg_url(self.version) or f"https://ftp.gnu.org/gnu/readline/readline-{self.version}.tar.gz"
231
262
 
232
263
  @property
233
264
  def version(self):
234
265
  return self.cfg_version("8.2.13")
235
266
 
267
+ def c_configure_args(self):
268
+ if config_args := self.cfg_configure(self.deps_lib_dir, self.deps_lib64_dir):
269
+ yield config_args
270
+
271
+ else:
272
+ yield "--enable-shared=no"
273
+ yield "--enable-static=yes"
274
+ yield "--with-curses"
275
+ yield "--enable-multibyte"
276
+ yield "--disable-install-examples"
277
+ yield "--disable-docs"
278
+ yield "--enable-portable-binary"
279
+
236
280
  def _do_linux_compile(self):
237
- self.run_configure(
238
- "./configure",
239
- "--disable-shared",
240
- "--enable-static",
241
- "--with-curses",
242
- "--enable-multibyte",
243
- "--disable-install-examples",
244
- "--disable-docs",
245
- "--enable-portable-binary",
246
- )
281
+ self.run_configure("./configure", self.c_configure_args())
247
282
  self.run_make()
248
283
  self.run_make("install")
249
284
 
@@ -267,21 +302,25 @@ class Sqlite(ModuleBuilder):
267
302
 
268
303
  @property
269
304
  def url(self):
270
- return f"https://github.com/sqlite/sqlite/archive/refs/tags/version-{self.version}.tar.gz"
305
+ return self.cfg_url(self.version) or f"https://github.com/sqlite/sqlite/archive/refs/tags/version-{self.version}.tar.gz"
271
306
 
272
307
  @property
273
308
  def version(self):
274
309
  return self.cfg_version("3.47.0")
275
310
 
311
+ def c_configure_args(self):
312
+ if config_args := self.cfg_configure(self.deps_lib_dir, self.deps_lib64_dir):
313
+ yield config_args
314
+
315
+ else:
316
+ yield "--enable-shared=no"
317
+ yield "--enable-static=yes"
318
+ yield "--disable-tcl"
319
+ yield "--disable-readline"
320
+ yield "--with-pic=yes"
321
+
276
322
  def _do_linux_compile(self):
277
- self.run_configure(
278
- "./configure",
279
- "--enable-shared=no",
280
- "--enable-static=yes",
281
- "--disable-tcl",
282
- "--disable-readline",
283
- "--with-pic=yes",
284
- )
323
+ self.run_configure("./configure", self.c_configure_args())
285
324
  self.run_make()
286
325
  self.run_make("install")
287
326
 
@@ -300,14 +339,23 @@ class Uuid(ModuleBuilder):
300
339
 
301
340
  @property
302
341
  def url(self):
303
- return f"https://sourceforge.net/projects/libuuid/files/libuuid-{self.version}.tar.gz"
342
+ return self.cfg_url(self.version) or f"https://sourceforge.net/projects/libuuid/files/libuuid-{self.version}.tar.gz"
304
343
 
305
344
  @property
306
345
  def version(self):
307
346
  return self.cfg_version("1.0.3")
308
347
 
348
+ def c_configure_args(self):
349
+ if config_args := self.cfg_configure(self.deps_lib_dir, self.deps_lib64_dir):
350
+ yield config_args
351
+
352
+ else:
353
+ yield "--enable-shared=no"
354
+ yield "--enable-static=yes"
355
+ yield "--with-pic=yes"
356
+
309
357
  def _do_linux_compile(self):
310
- self.run_configure("./configure", "--enable-shared=no", "--enable-static=yes", "--with-pic=yes")
358
+ self.run_configure("./configure", self.c_configure_args())
311
359
  self.run_make()
312
360
  self.run_make("install")
313
361
 
@@ -321,24 +369,28 @@ class Xz(ModuleBuilder):
321
369
 
322
370
  @property
323
371
  def url(self):
324
- return f"https://downloads.sourceforge.net/project/lzmautils/xz-{self.version}.tar.gz"
372
+ return self.cfg_url(self.version) or f"https://downloads.sourceforge.net/project/lzmautils/xz-{self.version}.tar.gz"
325
373
 
326
374
  @property
327
375
  def version(self):
328
376
  return self.cfg_version("5.6.3")
329
377
 
378
+ def c_configure_args(self):
379
+ if config_args := self.cfg_configure(self.deps_lib_dir, self.deps_lib64_dir):
380
+ yield config_args
381
+
382
+ else:
383
+ yield "--enable-shared=no"
384
+ yield "--enable-static=yes"
385
+ yield "--with-pic=yes"
386
+ yield "--disable-rpath"
387
+ yield "--disable-dependency-tracking"
388
+ yield "--disable-doc"
389
+ yield "--disable-nls"
390
+ yield "--without-libintl-prefix"
391
+
330
392
  def _do_linux_compile(self):
331
- self.run_configure(
332
- "./configure",
333
- "--enable-shared=no",
334
- "--enable-static=yes",
335
- "--with-pic=yes",
336
- "--disable-rpath",
337
- "--disable-dependency-tracking",
338
- "--disable-doc",
339
- "--disable-nls",
340
- "--without-libintl-prefix",
341
- )
393
+ self.run_configure("./configure", self.c_configure_args())
342
394
  self.run_make()
343
395
  self.run_make("install")
344
396
 
@@ -360,13 +412,20 @@ class Zlib(ModuleBuilder):
360
412
 
361
413
  @property
362
414
  def url(self):
363
- return f"https://zlib.net/fossils/zlib-{self.version}.tar.gz"
415
+ return self.cfg_url(self.version) or f"https://zlib.net/fossils/zlib-{self.version}.tar.gz"
364
416
 
365
417
  @property
366
418
  def version(self):
367
419
  return self.cfg_version("1.3.1")
368
420
 
421
+ def c_configure_args(self):
422
+ if config_args := self.cfg_configure(self.deps_lib_dir, self.deps_lib64_dir):
423
+ yield config_args
424
+
425
+ else:
426
+ yield "--static"
427
+
369
428
  def _do_linux_compile(self):
370
- self.run_configure("./configure", "--static")
429
+ self.run_configure("./configure", self.c_configure_args())
371
430
  self.run_make()
372
431
  self.run_make("install")
@@ -53,7 +53,7 @@ class Tk(ModuleBuilder):
53
53
  def c_configure_args(self):
54
54
  yield "--enable-shared=no"
55
55
  yield "--enable-threads"
56
- yield f"--with-tcl={self.deps_lib}"
56
+ yield f"--with-tcl={self.deps_lib_dir}"
57
57
  yield "--without-x"
58
58
  if PPG.target.is_macos: # pragma: no cover, tcl/tk is "best effort"
59
59
  yield "--enable-aqua=yes"
@@ -89,8 +89,8 @@ class Tix(ModuleBuilder):
89
89
  def c_configure_args(self):
90
90
  yield "--enable-shared=no"
91
91
  yield "--enable-threads"
92
- yield f"--with-tcl={self.deps_lib}"
93
- yield f"--with-tk={self.deps_lib}"
92
+ yield f"--with-tcl={self.deps_lib_dir}"
93
+ yield f"--with-tk={self.deps_lib_dir}"
94
94
  yield "--without-x"
95
95
 
96
96
  def _do_linux_compile(self):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: portable-python
3
- Version: 1.9.7
3
+ Version: 1.9.9
4
4
  Summary: Portable python binaries
5
5
  Home-page: https://github.com/codrsquad/portable-python
6
6
  Author: Zoran Simic
@@ -18,19 +18,18 @@ Classifier: Operating System :: POSIX
18
18
  Classifier: Operating System :: Unix
19
19
  Classifier: Programming Language :: Python
20
20
  Classifier: Programming Language :: Python :: 3
21
- Classifier: Programming Language :: Python :: 3.6
22
- Classifier: Programming Language :: Python :: 3.7
23
21
  Classifier: Programming Language :: Python :: 3.8
24
22
  Classifier: Programming Language :: Python :: 3.9
25
23
  Classifier: Programming Language :: Python :: 3.10
26
24
  Classifier: Programming Language :: Python :: 3.11
27
25
  Classifier: Programming Language :: Python :: 3.12
26
+ Classifier: Programming Language :: Python :: 3.13
28
27
  Classifier: Programming Language :: Python :: Implementation :: CPython
29
28
  Classifier: Topic :: Software Development :: Build Tools
30
29
  Classifier: Topic :: System :: Installation/Setup
31
30
  Classifier: Topic :: System :: Software Distribution
32
31
  Classifier: Topic :: Utilities
33
- Requires-Python: >=3.6
32
+ Requires-Python: >=3.8
34
33
  Description-Content-Type: text/x-rst
35
34
  License-File: LICENSE
36
35
  Requires-Dist: click~=8.0
@@ -9,8 +9,15 @@ def test_config(cli):
9
9
  with pytest.raises(runez.system.AbortException):
10
10
  PPG.config.parsed_yaml("a: b\ninvalid line", "testing")
11
11
 
12
+ # Exercise custom url in config
13
+ cli.run("-ntmacos-arm64", "-c", cli.tests_path("sample-config1.yml"), "build", "3.9.7", "-mbzip2")
14
+ assert cli.succeeded
15
+ assert "Would download https://my-enterprise/.../assets/bzip2/123#sha256=123...def\n" in cli.logged
16
+ assert "Would untar build/sources/bzip2-1.2.3.tar.gz -> build/components/bzip2\n" in cli.logged
17
+
12
18
  cli.run("-ntmacos-arm64", "-c", cli.tests_path("sample-config1.yml"), "build", "3.9.7", "-mnone")
13
19
  assert cli.succeeded
20
+
14
21
  assert " -mpip install --no-cache-dir --upgrade my-additional-package" in cli.logged
15
22
  assert "env MACOSX_DEPLOYMENT_TARGET=12" in cli.logged # Comes from more specific macos-arm64.yml
16
23
  assert " -> dist/cpython-3.9.7-macos-arm64.tar.xz" in cli.logged # Comes from macos.yml (not defined in macos-arm64.yml)
File without changes