ggcode 1.1.32__tar.gz → 1.1.34__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ggcode
3
- Version: 1.1.32
3
+ Version: 1.1.34
4
4
  Summary: Thin Python wrapper that installs the ggcode GitHub Release binary
5
5
  Author: topcheer
6
6
  License: MIT
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ggcode
3
- Version: 1.1.32
3
+ Version: 1.1.34
4
4
  Summary: Thin Python wrapper that installs the ggcode GitHub Release binary
5
5
  Author: topcheer
6
6
  License: MIT
@@ -10,6 +10,7 @@ import shutil
10
10
  import stat
11
11
  import subprocess
12
12
  import sys
13
+ import ssl
13
14
  import tarfile
14
15
  import tempfile
15
16
  import urllib.parse
@@ -86,8 +87,20 @@ def metadata_path(directory: Path) -> Path:
86
87
  return directory / METADATA
87
88
 
88
89
 
90
+ def _build_ssl_context() -> ssl.SSLContext:
91
+ ctx = ssl.create_default_context()
92
+ ctx.check_hostname = False
93
+ ctx.verify_mode = ssl.CERT_NONE
94
+ return ctx
95
+
96
+
97
+ def _urlopen(url: str) -> object:
98
+ ctx = _build_ssl_context()
99
+ return urllib.request.urlopen(url, context=ctx)
100
+
101
+
89
102
  def download(url: str) -> bytes:
90
- with urllib.request.urlopen(url) as response:
103
+ with _urlopen(url) as response:
91
104
  return response.read()
92
105
 
93
106
 
@@ -95,7 +108,7 @@ def resolve_release_version(version: str) -> str:
95
108
  if version != "latest":
96
109
  return version
97
110
 
98
- with urllib.request.urlopen(f"https://github.com/{OWNER}/{REPO}/releases/latest") as response:
111
+ with _urlopen(f"https://github.com/{OWNER}/{REPO}/releases/latest") as response:
99
112
  final_url = response.geturl()
100
113
 
101
114
  parsed = urllib.parse.urlparse(final_url)
@@ -130,7 +143,11 @@ def existing_install(requested_version: str, binary_name: str) -> InstallResult
130
143
  binary_path = directory / binary_name
131
144
  if not binary_path.exists():
132
145
  continue
133
- metadata = read_metadata(directory) or {}
146
+ metadata = read_metadata(directory)
147
+ if metadata is None:
148
+ # No .ggcode-wrapper.json means this binary was not installed by the wrapper
149
+ # (e.g. a Python pip entry point script with the same name). Skip it.
150
+ continue
134
151
  if requested_version != "latest" and metadata.get("version") != requested_version:
135
152
  continue
136
153
  path_updated = ensure_installed_path(directory)
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "ggcode"
7
- version = "1.1.32"
7
+ version = "1.1.34"
8
8
  description = "Thin Python wrapper that installs the ggcode GitHub Release binary"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.9"
File without changes
File without changes
File without changes