pkgconf 2.1.1.post6__py3-none-win_amd64.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.
Binary file
pkgconf/__init__.py ADDED
@@ -0,0 +1,84 @@
1
+ import importlib
2
+ import importlib.metadata
3
+ import importlib.resources
4
+ import itertools
5
+ import os
6
+ import pathlib
7
+ import shutil
8
+ import subprocess
9
+ import sys
10
+ import sysconfig
11
+
12
+ from collections.abc import Sequence
13
+ from typing import Any
14
+
15
+
16
+ __version__ = '2.1.1-6'
17
+
18
+
19
+ def get_executable() -> pathlib.Path:
20
+ """Get the pkgconf executable."""
21
+ if os.name == 'posix':
22
+ executable_name = 'pkgconf'
23
+ else:
24
+ raise NotImplementedError
25
+ return pathlib.Path(importlib.resources.files('pkgconf') / '.bin' / executable_name)
26
+
27
+
28
+ def _get_module_paths(name: str) -> list[str]:
29
+ module = importlib.import_module(name)
30
+ if 'NamespacePath' in module.__path__.__class__.__name__:
31
+ return list(module.__path__)
32
+ return [os.fspath(importlib.resources.files(name))]
33
+
34
+
35
+ def get_pkg_config_path() -> Sequence[str]:
36
+ """Calculate PKG_CONFIG_PATH for Python packages in the current environment.
37
+
38
+ Python packages may register a directory for their pkg-config files by
39
+ specifying a "pkg-config" entrypoint.
40
+
41
+ TODO: Document the entrypoint creation and point to that here.
42
+ [project.entry-points.pkg-config]
43
+ entrypoint-name = 'project.package'
44
+ """
45
+ entrypoints = importlib.metadata.entry_points(group='pkg_config')
46
+ return itertools.chain.from_iterable([_get_module_paths(entry.value) for entry in entrypoints])
47
+
48
+
49
+ def run_pkgconf(*args: str, **subprocess_kwargs: Any) -> subprocess.Popen:
50
+ """Run the pkgconf executable.
51
+
52
+ :param args: Arguments to pass to the pkgconf call.
53
+ :param subprocess_kwargs: Keyword arguments to pass to the subprocess.run call.
54
+ """
55
+ env = os.environ.copy()
56
+ env['PKG_CONFIG_PATH'] = os.pathsep.join(
57
+ (
58
+ env.get('PKG_CONFIG_PATH', ''),
59
+ *get_pkg_config_path(),
60
+ )
61
+ )
62
+ return subprocess.run([get_executable(), *args], env=env, **subprocess_kwargs)
63
+
64
+
65
+ def _entrypoint() -> None:
66
+ args = sys.argv[1:]
67
+ try:
68
+ run_pkgconf(*args, check=True)
69
+ except subprocess.SubprocessError:
70
+ # If our pkgconf lookup fails, fallback to the system pkgconf/pkg-config.
71
+ # For simplicity, the previous call will output to stdout/stderr
72
+ # regardless of its success, since capturing stdout/stderr in order to
73
+ # replay is tricky. If the fallback path triggers, it will also output
74
+ # to stdout/stderr, meaning we will have the output of both process
75
+ # calls. While a bit unexpected, I believe this is the best option for
76
+ # debugging.
77
+ scripts = sysconfig.get_path('scripts')
78
+ path_list = os.environ.get('PATH', os.defpath).split(os.pathsep)
79
+ if scripts in path_list:
80
+ path_list.remove(scripts)
81
+ path = os.pathsep.join(path_list)
82
+ system_executable = shutil.which('pkgconf', path=path) or shutil.which('pkg-config', path=path)
83
+ if system_executable:
84
+ subprocess.run([system_executable, *args])
pkgconf/diagnose.py ADDED
@@ -0,0 +1,25 @@
1
+ import importlib.metadata
2
+ import importlib.resources
3
+ import os
4
+
5
+ import pkgconf
6
+
7
+
8
+ def report() -> None:
9
+ print(f'pkgconf executable: {pkgconf.get_executable()}')
10
+
11
+ entrypoints = importlib.metadata.entry_points(group='pkg-config')
12
+ print('entrypoints:')
13
+ for entry in entrypoints:
14
+ print(f' {entry.name}:')
15
+ print(f' value: {entry.value}')
16
+ print(f' path: {os.fspath(importlib.resources.files(entry.value))}')
17
+
18
+ print(f'PKG_CONFIG_PATH: {os.pathsep.join(pkgconf.get_pkg_config_path())}')
19
+
20
+
21
+ if __name__ == '__main__':
22
+ try:
23
+ report()
24
+ except (KeyboardInterrupt, BrokenPipeError):
25
+ pass
@@ -0,0 +1,19 @@
1
+ Copyright (c) 2024 pypackaging-native contributors
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
4
+ this software and associated documentation files (the “Software”), to deal in
5
+ the Software without restriction, including without limitation the rights to
6
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
7
+ of the Software, and to permit persons to whom the Software is furnished to do
8
+ so, subject to the following conditions:
9
+
10
+ The above copyright notice and this permission notice shall be included in all
11
+ copies or substantial portions of the Software.
12
+
13
+ THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19
+ SOFTWARE.
@@ -0,0 +1,64 @@
1
+ Metadata-Version: 2.1
2
+ Name: pkgconf
3
+ Version: 2.1.1.post6
4
+ Summary: `pkgconf` is a program which helps with discovering library dependencies and configuring compiler and linker flags.
5
+ Home-page: https://pkgconf-pypi.readthedocs.io/en/latest/
6
+ Author-Email: Ralf Gommers <ralf.gommers@gmail.com>, =?utf-8?b?RmlsaXBlIExhw4PCrW5z?= <lains@riseup.net>
7
+ License: Copyright (c) 2024 pypackaging-native contributors
8
+
9
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
10
+ this software and associated documentation files (the “Software”), to deal in
11
+ the Software without restriction, including without limitation the rights to
12
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
13
+ of the Software, and to permit persons to whom the Software is furnished to do
14
+ so, subject to the following conditions:
15
+
16
+ The above copyright notice and this permission notice shall be included in all
17
+ copies or substantial portions of the Software.
18
+
19
+ THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25
+ SOFTWARE.
26
+ Classifier: Development Status :: 4 - Beta
27
+ Classifier: Intended Audience :: Developers
28
+ Classifier: License :: OSI Approved :: MIT License
29
+ Classifier: License :: OSI Approved :: ISC License (ISCL)
30
+ Classifier: Programming Language :: C
31
+ Classifier: Topic :: Software Development
32
+ Classifier: Operating System :: Microsoft :: Windows
33
+ Classifier: Operating System :: POSIX
34
+ Classifier: Operating System :: Unix
35
+ Classifier: Operating System :: MacOS
36
+ Project-URL: Homepage, https://pkgconf-pypi.readthedocs.io/en/latest/
37
+ Project-URL: Issues, https://github.com/pypackaging-native/pkgconf-pypi/issues
38
+ Project-URL: Source, https://github.com/pypackaging-native/pkgconf-pypi
39
+ Provides-Extra: docs
40
+ Provides-Extra: test
41
+ Requires-Dist: sphinx~=7.0; extra == "docs"
42
+ Requires-Dist: furo; extra == "docs"
43
+ Requires-Dist: sphinx-design; extra == "docs"
44
+ Requires-Dist: pytest; extra == "test"
45
+ Requires-Dist: meson-python; extra == "test"
46
+ Requires-Dist: environment-helpers>=0.1.1.post1; extra == "test"
47
+ Requires-Dist: pytest-mock>=2; extra == "test"
48
+ Description-Content-Type: text/markdown
49
+
50
+ # pkgconf-pypi
51
+
52
+ This goal of this repo is to facility building and publishing of
53
+ [pkgconf](https://github.com/pkgconf/pkgconf) binaries on PyPI, primarily for
54
+ ease of installing in a cross-platform manner. This is useful when `pkgconf` is
55
+ for example needed in workflows of other Python packages.
56
+
57
+ ## Choices
58
+
59
+ The intent is to:
60
+
61
+ - distribute `pkgconf` without any modifications
62
+ - configure the build with no system directory
63
+ - install `pkg-config` as an alias in the scripts directory of the Python
64
+ environment
@@ -0,0 +1,8 @@
1
+ pkgconf-2.1.1.post6.dist-info/METADATA,sha256=UUuTuwV5yd0G3yrqZOHe27ZfTPXkD9vQB2PdKIp9zG0,3163
2
+ pkgconf-2.1.1.post6.dist-info/WHEEL,sha256=B3B4KN1DoTlWtNhRRRGkD-knxtCiXk730NQ8ihkn3eI,85
3
+ pkgconf-2.1.1.post6.dist-info/entry_points.txt,sha256=12p9IsNu-vfxckgJZuzatv_xMgryOvcSOuURqvNllKY,82
4
+ pkgconf-2.1.1.post6.dist-info/LICENSE,sha256=ZkgDE-MK5aHoknemDQt1la7dQ91Mw6i5YRVW120ARTg,1102
5
+ pkgconf/.bin/pkgconf.exe,sha256=W7ThrUenpbThIA-Xx8jEfcXqXR-6zyiL3q0uxv0fP1A,88064
6
+ pkgconf/__init__.py,sha256=As6jxWG5kqSxnRS5eFOvKyb-VmWg1y0fQ6wz0XgdFsg,3009
7
+ pkgconf/diagnose.py,sha256=68J_xXr3S92lGrVkzlnpLzasGwa2Rzb3rraxbhce-j4,671
8
+ pkgconf-2.1.1.post6.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: meson
3
+ Root-Is-Purelib: false
4
+ Tag: py3-none-linux_x86_64
@@ -0,0 +1,4 @@
1
+ [console_scripts]
2
+ pkg-config = pkgconf:_entrypoint
3
+ pkgconf = pkgconf:_entrypoint
4
+