pact-python-cli 2.6.0.1__py3-none-win_arm64.whl → 2.6.4.0__py3-none-win_arm64.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.
pact_cli/__init__.py CHANGED
@@ -31,6 +31,7 @@ __url__ = "https://github.com/pact-foundation/pact-python"
31
31
  import os
32
32
  import shutil
33
33
  import sys
34
+ import sysconfig
34
35
  import warnings
35
36
  from pathlib import Path
36
37
  from typing import TYPE_CHECKING
@@ -43,7 +44,7 @@ from pact_cli.__version__ import (
43
44
  )
44
45
 
45
46
  if TYPE_CHECKING:
46
- from collections.abc import Mapping
47
+ from collections.abc import Iterator, Mapping
47
48
 
48
49
  _USE_SYSTEM_BINS = os.getenv("PACT_USE_SYSTEM_BINS", "").upper() in ("TRUE", "YES")
49
50
  _BIN_DIR = Path(__file__).parent.resolve() / "bin"
@@ -148,6 +149,39 @@ def _exec() -> None:
148
149
  os.execve(executable, [executable, *args], _telemetry_env()) # noqa: S606
149
150
 
150
151
 
152
+ def _bundled_bin_dirs() -> Iterator[Path]:
153
+ """
154
+ Determine the directories that may contain the bundled Pact binaries.
155
+
156
+ The binaries are normally bundled in a `bin` directory alongside this
157
+ module, which is the first location searched. Relying solely on the
158
+ module-relative path is fragile, however: for editable or relocated
159
+ installs, or when a virtual environment is reused across several checkouts,
160
+ `__file__` may resolve to a directory that no longer contains the binaries.
161
+ The installation's `site-packages` directories are therefore also derived
162
+ from `sysconfig` so the bundled `bin` directory can be located independently
163
+ of `__file__`.
164
+
165
+ Returns:
166
+ The candidate directories to search, in order of preference and
167
+ deduplicated.
168
+ """
169
+ seen: set[Path] = set()
170
+ resolved_bin_dir = _BIN_DIR.resolve()
171
+ if resolved_bin_dir.is_dir():
172
+ yield resolved_bin_dir
173
+ seen.add(resolved_bin_dir)
174
+ for name in ("platlib", "purelib"):
175
+ if (
176
+ (path := sysconfig.get_path(name))
177
+ and (candidate := Path(path).resolve() / "pact_cli" / "bin")
178
+ and candidate.is_dir()
179
+ and candidate not in seen
180
+ ):
181
+ yield candidate
182
+ seen.add(candidate)
183
+
184
+
151
185
  def _find_executable(executable: str) -> str | None:
152
186
  """
153
187
  Find the path to an executable.
@@ -173,7 +207,8 @@ def _find_executable(executable: str) -> str | None:
173
207
  if _USE_SYSTEM_BINS:
174
208
  bin_path = shutil.which(executable)
175
209
  else:
176
- bin_path = shutil.which(executable, path=str(_BIN_DIR))
210
+ search_path = os.pathsep.join(str(d) for d in _bundled_bin_dirs())
211
+ bin_path = shutil.which(executable, path=search_path) if search_path else None
177
212
  if bin_path is None:
178
213
  system_path = shutil.which(executable)
179
214
  if system_path is not None:
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.4
1
+ Metadata-Version: 2.5
2
2
  Name: pact-python-cli
3
- Version: 2.6.0.1
3
+ Version: 2.6.4.0
4
4
  Summary: Pact CLI bundle for Python
5
5
  Project-URL: Bug Tracker, https://github.com/pact-foundation/pact-python/issues
6
6
  Project-URL: Changelog, https://github.com/pact-foundation/pact-python/blob/main/pact-python-cli/CHANGELOG.md
@@ -21,13 +21,13 @@ Classifier: Operating System :: Microsoft :: Windows
21
21
  Classifier: Operating System :: POSIX :: Linux
22
22
  Classifier: Programming Language :: Python
23
23
  Classifier: Programming Language :: Python :: 3 :: Only
24
- Classifier: Programming Language :: Python :: 3.10
25
24
  Classifier: Programming Language :: Python :: 3.11
26
25
  Classifier: Programming Language :: Python :: 3.12
27
26
  Classifier: Programming Language :: Python :: 3.13
28
27
  Classifier: Programming Language :: Python :: 3.14
28
+ Classifier: Programming Language :: Python :: 3.15
29
29
  Classifier: Topic :: Software Development :: Testing
30
- Requires-Python: >=3.10
30
+ Requires-Python: >=3.11
31
31
  Description-Content-Type: text/markdown
32
32
 
33
33
 
@@ -0,0 +1,10 @@
1
+ pact_cli/.gitkeep,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
+ pact_cli/__init__.py,sha256=L6oF4-zbZ_qMrn0JpW45L4YsGP6aVyMLKED2wXwzeXQ,9382
3
+ pact_cli/__version__.py,sha256=mSzUTJdZnBqA83odfLyJXs72nLg7UKIsowp12hx2lyA,309
4
+ pact_cli/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
+ pact_cli/bin/pact.exe,sha256=LjnIDm6NkukK91RXI-YehQeLwyEbrP-qmvDxECCcJ2M,11942400
6
+ pact_python_cli-2.6.4.0.dist-info/METADATA,sha256=-AnysGxjHgOAJSJ3KJHPJVGIpPgZbuiqrykBpgNVRg8,7335
7
+ pact_python_cli-2.6.4.0.dist-info/WHEEL,sha256=WTj0zi89uiylgAEJwZ9wPtxpBBYQwbRhAb_LkpCAIy0,93
8
+ pact_python_cli-2.6.4.0.dist-info/entry_points.txt,sha256=utvyeaJBkfSBeNzomnnAD603lsoeRV5_NrIpgfoUtIM,375
9
+ pact_python_cli-2.6.4.0.dist-info/licenses/LICENSE,sha256=RMcvx3YlJ7ZFfF7np7LAs4yo6C7oht1ZJywBn1Mxz7g,1093
10
+ pact_python_cli-2.6.4.0.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: hatchling 1.30.1
2
+ Generator: hatchling 1.32.4
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-win_arm64
@@ -1,10 +0,0 @@
1
- pact_cli/.gitkeep,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- pact_cli/__init__.py,sha256=4zpYaXx2iozStD6pMVKXO4aNKt2A05WAQMqPNlEvBak,7939
3
- pact_cli/__version__.py,sha256=mSzUTJdZnBqA83odfLyJXs72nLg7UKIsowp12hx2lyA,309
4
- pact_cli/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
- pact_cli/bin/pact.exe,sha256=LjnIDm6NkukK91RXI-YehQeLwyEbrP-qmvDxECCcJ2M,11942400
6
- pact_python_cli-2.6.0.1.dist-info/METADATA,sha256=3RA4SPIdlp2yjDsxBaZD0N3FohAjbyIcOnb1SgSG5aU,7335
7
- pact_python_cli-2.6.0.1.dist-info/WHEEL,sha256=TcQL_YpAKiyZ1eeDF2uWn7p7k9Ze646QIWp_3vi_IWo,93
8
- pact_python_cli-2.6.0.1.dist-info/entry_points.txt,sha256=utvyeaJBkfSBeNzomnnAD603lsoeRV5_NrIpgfoUtIM,375
9
- pact_python_cli-2.6.0.1.dist-info/licenses/LICENSE,sha256=RMcvx3YlJ7ZFfF7np7LAs4yo6C7oht1ZJywBn1Mxz7g,1093
10
- pact_python_cli-2.6.0.1.dist-info/RECORD,,