portable-python 1.9.8__py3-none-any.whl → 1.9.9__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.
@@ -492,10 +492,23 @@ class ModuleBuilder:
492
492
  def cfg_version(self, default):
493
493
  return PPG.config.get_value("%s-version" % self.m_name) or default
494
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
+
495
504
  def cfg_url(self, version):
496
505
  if config_url := PPG.config.get_value("%s-url" % self.m_name):
497
506
  url_template = Template(config_url)
498
- return url_template.substitute(version=version)
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)
499
512
 
500
513
  def cfg_configure(self, deps_lib_dir, deps_lib64_dir):
501
514
  if configure := PPG.config.get_value("%s-configure" % self.m_name):
@@ -510,6 +523,16 @@ class ModuleBuilder:
510
523
  """Url of source tarball, if any"""
511
524
  return ""
512
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
+
513
536
  @property
514
537
  def version(self):
515
538
  """Version to use"""
@@ -632,8 +655,16 @@ class ModuleBuilder:
632
655
  self._finalize()
633
656
  return
634
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
+
635
661
  # Split on '#' for urls that include a checksum, such as #sha256=... fragment
636
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
+
637
668
  path = self.setup.folders.sources / basename
638
669
  if not path.exists():
639
670
  proxies = {}
@@ -643,7 +674,8 @@ class ModuleBuilder:
643
674
  https_proxy = os.environ.get("HTTPS_PROXY") or os.environ.get("https_proxy")
644
675
  if https_proxy:
645
676
  proxies["https"] = https_proxy
646
- RestClient().download(self.url, path, proxies=proxies)
677
+
678
+ RestClient().download(self.url, path, proxies=proxies, headers=self.headers)
647
679
 
648
680
  runez.decompress(path, self.m_src_build, simplify=True)
649
681
 
@@ -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):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: portable-python
3
- Version: 1.9.8
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
@@ -1,4 +1,4 @@
1
- portable_python/__init__.py,sha256=Ld95T798R07e8UOKNc3XL6iaxtCykEnQ8h2dQHGk0IY,29356
1
+ portable_python/__init__.py,sha256=WbW_8kWASSkljLz0o48WMCuSofeB8p18vUXQElCplGU,30724
2
2
  portable_python/__main__.py,sha256=fjtkudRFxLSLTSqzkWYnQLMGRG0BRUc6GeqY201taCE,149
3
3
  portable_python/cli.py,sha256=hml834t9RMjQ1s5-DwiEJhdjI8IfsObTLzU8jMbhze0,7610
4
4
  portable_python/config.py,sha256=9mo4uCJ77-mXZNc9tvOngPlCu6gcMMEbVDmeiKi0W2Y,13714
@@ -6,13 +6,13 @@ portable_python/cpython.py,sha256=GH99cTgrC9V5WoDw6OtT9X2dEiBu9i6QclLfQq70Cd8,16
6
6
  portable_python/inspector.py,sha256=4nyGuTFbY1X3wfj9TPTQe69ABzshMvY4RjUat4y_9BU,21349
7
7
  portable_python/tracking.py,sha256=308K--adSivstOqnD9oczlY77FZV_cgNy7xL8BS9ROg,1978
8
8
  portable_python/versions.py,sha256=kHARK3Htby-e3jMYesUu6cF0i3QU5WBMApXng-iCpCM,7085
9
- portable_python/external/__init__.py,sha256=-VfkDp9riXFdmcmOKlw4COTTYZj95DYJmKM80E_xa_o,699
9
+ portable_python/external/__init__.py,sha256=3KgdTIZG1x-Sm0nPMKl4c3elCtBy6spD6qASpvdR8ZI,729
10
10
  portable_python/external/_inspect.py,sha256=Z1WKcYB-m-fx7nW3n1tvpEgZ02ajCyC-_MfY6Bb_7SE,3715
11
11
  portable_python/external/xcpython.py,sha256=D0DWKipcdlZfBITGG2EteNPf8rnDLTrYk78lNIPl_WQ,13096
12
12
  portable_python/external/xtkinter.py,sha256=KlhFUvIXWy7gX6FrZBieekrULx4kF12H2Q010GZEj20,3502
13
- portable_python-1.9.8.dist-info/LICENSE,sha256=BB27gUWIcmc-bauY_M6COCMtiy4hN2mou1RdadlbXbs,1068
14
- portable_python-1.9.8.dist-info/METADATA,sha256=Neckx7LnmxejIG-OGTWxjUvhRvRNWRu-zrnewR33Qy0,8785
15
- portable_python-1.9.8.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
16
- portable_python-1.9.8.dist-info/entry_points.txt,sha256=Zo8HR39evgAgm4e2UhenD7kkpJvEXp_VB4aIrL_3_VY,66
17
- portable_python-1.9.8.dist-info/top_level.txt,sha256=S203pfaAC8FDZvrHsCWWua_9ZfSDEDCD1w90zzYFhOU,16
18
- portable_python-1.9.8.dist-info/RECORD,,
13
+ portable_python-1.9.9.dist-info/LICENSE,sha256=BB27gUWIcmc-bauY_M6COCMtiy4hN2mou1RdadlbXbs,1068
14
+ portable_python-1.9.9.dist-info/METADATA,sha256=JuRTY-TcD-i6uMTJwFx-5v0dWdOa9LFCvDK4D727AyE,8785
15
+ portable_python-1.9.9.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
16
+ portable_python-1.9.9.dist-info/entry_points.txt,sha256=Zo8HR39evgAgm4e2UhenD7kkpJvEXp_VB4aIrL_3_VY,66
17
+ portable_python-1.9.9.dist-info/top_level.txt,sha256=S203pfaAC8FDZvrHsCWWua_9ZfSDEDCD1w90zzYFhOU,16
18
+ portable_python-1.9.9.dist-info/RECORD,,