py-msbuild-extractor 0.0.1__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.
- py_msbuild_extractor/__init__.py +12 -0
- py_msbuild_extractor/__main__.py +6 -0
- py_msbuild_extractor/_launcher.py +58 -0
- py_msbuild_extractor/bin/msbuild-extractor.exe +0 -0
- py_msbuild_extractor/licenses/msbuild-extractor-sample-LICENSE.txt +21 -0
- py_msbuild_extractor-0.0.1.dist-info/METADATA +39 -0
- py_msbuild_extractor-0.0.1.dist-info/RECORD +10 -0
- py_msbuild_extractor-0.0.1.dist-info/WHEEL +5 -0
- py_msbuild_extractor-0.0.1.dist-info/entry_points.txt +2 -0
- py_msbuild_extractor-0.0.1.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"""py-msbuild-extractor: a pip-installable win-x64 launcher.
|
|
2
|
+
|
|
3
|
+
This package bundles a self-contained build of
|
|
4
|
+
`microsoft/msbuild-extractor-sample <https://github.com/microsoft/msbuild-extractor-sample>`_
|
|
5
|
+
and exposes it through the ``msbuild-extractor`` console script. It only
|
|
6
|
+
redistributes the launcher; the machine running it still needs the Visual Studio
|
|
7
|
+
C++ build toolchain (see the project README).
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
from py_msbuild_extractor._launcher import main
|
|
11
|
+
|
|
12
|
+
__all__ = ["main"]
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"""Locate the bundled win-x64 executable and forward argv to it."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import os
|
|
6
|
+
import subprocess
|
|
7
|
+
import sys
|
|
8
|
+
from importlib import resources
|
|
9
|
+
|
|
10
|
+
_EXE_NAME = "msbuild-extractor.exe"
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def _resolve_exe() -> str:
|
|
14
|
+
"""Return the filesystem path to the bundled win-x64 executable.
|
|
15
|
+
|
|
16
|
+
``importlib.resources`` yields a real on-disk path here because the exe is
|
|
17
|
+
ordinary package data extracted alongside the installed package, not a
|
|
18
|
+
zip-imported resource.
|
|
19
|
+
"""
|
|
20
|
+
resource = resources.files(__package__).joinpath("bin", _EXE_NAME)
|
|
21
|
+
with resources.as_file(resource) as path:
|
|
22
|
+
return os.fspath(path)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
def main(argv: "list[str] | None" = None) -> int:
|
|
26
|
+
"""Invoke the bundled executable, forwarding command-line arguments.
|
|
27
|
+
|
|
28
|
+
Returns the executable's exit code so the console script propagates it.
|
|
29
|
+
"""
|
|
30
|
+
if os.name != "nt":
|
|
31
|
+
sys.stderr.write(
|
|
32
|
+
"py-msbuild-extractor is Windows-only: it wraps a win-x64 native "
|
|
33
|
+
"executable and depends on the Visual Studio C++ toolchain "
|
|
34
|
+
"(vswhere.exe, VCTargetsPath/VCToolsInstallDir, cl.exe). "
|
|
35
|
+
f"Current platform: {sys.platform}.\n"
|
|
36
|
+
)
|
|
37
|
+
return 1
|
|
38
|
+
|
|
39
|
+
exe = _resolve_exe()
|
|
40
|
+
if not os.path.exists(exe):
|
|
41
|
+
sys.stderr.write(
|
|
42
|
+
f"Bundled executable not found at {exe!r}. This wheel appears to be "
|
|
43
|
+
"missing its packaged launcher; reinstall py-msbuild-extractor from "
|
|
44
|
+
"a win_amd64 wheel.\n"
|
|
45
|
+
)
|
|
46
|
+
return 1
|
|
47
|
+
|
|
48
|
+
args = sys.argv[1:] if argv is None else list(argv)
|
|
49
|
+
try:
|
|
50
|
+
completed = subprocess.run([exe, *args])
|
|
51
|
+
except OSError as err: # pragma: no cover - defensive
|
|
52
|
+
sys.stderr.write(f"Failed to launch {exe!r}: {err}\n")
|
|
53
|
+
return 1
|
|
54
|
+
return completed.returncode
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
if __name__ == "__main__":
|
|
58
|
+
raise SystemExit(main())
|
|
Binary file
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: py-msbuild-extractor
|
|
3
|
+
Version: 0.0.1
|
|
4
|
+
Summary: Windows-only pip launcher bundling microsoft/msbuild-extractor-sample (generates compile_commands.json from MSBuild/.vcxproj solutions).
|
|
5
|
+
Author: py-msbuild-extractor contributors
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/renefritze/py-msbuild-extractor
|
|
8
|
+
Project-URL: Upstream project, https://github.com/microsoft/msbuild-extractor-sample
|
|
9
|
+
Keywords: msbuild,compile_commands,vcxproj,clangd,compilation-database,windows
|
|
10
|
+
Classifier: Development Status :: 4 - Beta
|
|
11
|
+
Classifier: Environment :: Console
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
14
|
+
Classifier: Operating System :: Microsoft :: Windows
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Topic :: Software Development :: Build Tools
|
|
17
|
+
Requires-Python: >=3.8
|
|
18
|
+
Description-Content-Type: text/markdown
|
|
19
|
+
|
|
20
|
+
# py-msbuild-extractor
|
|
21
|
+
|
|
22
|
+
Windows-only pip launcher that bundles a self-contained win-x64 build of
|
|
23
|
+
[`microsoft/msbuild-extractor-sample`](https://github.com/microsoft/msbuild-extractor-sample)
|
|
24
|
+
and exposes it as the `msbuild-extractor` command. It generates
|
|
25
|
+
`compile_commands.json` from Visual C++ MSBuild projects (`.vcxproj`, `.sln`,
|
|
26
|
+
`.slnx`).
|
|
27
|
+
|
|
28
|
+
```console
|
|
29
|
+
pip install py-msbuild-extractor
|
|
30
|
+
msbuild-extractor --help
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
This wheel only redistributes the launcher. The machine running it must have
|
|
34
|
+
**Visual Studio Build Tools with the C++ (Desktop development with C++)
|
|
35
|
+
workload** installed — the tool shells out to `vswhere.exe`, resolves
|
|
36
|
+
`VCTargetsPath`/`VCToolsInstallDir`, and invokes `cl.exe`.
|
|
37
|
+
|
|
38
|
+
See the [project repository](https://github.com/renefritze/py-msbuild-extractor)
|
|
39
|
+
for full documentation, the pinned upstream commit, and how it is built.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
py_msbuild_extractor/__init__.py,sha256=3HF00AJxTK4gWKq91CXsqHtCEoPJoBzZORr8hA55Cd8,488
|
|
2
|
+
py_msbuild_extractor/__main__.py,sha256=4EW8E9CHIqLJ1xU7Nb1DZz4FdYrQf3kMpulkXi7yPkc,190
|
|
3
|
+
py_msbuild_extractor/_launcher.py,sha256=EiIT0nwWEtqZkqcdfAxZNBwGlRKwDsNe2oN9tfykwQk,1922
|
|
4
|
+
py_msbuild_extractor/bin/msbuild-extractor.exe,sha256=DhhI_KqaQN1MWvBmdpmuX_TzEKgIQIezetM9avk2FSM,76212065
|
|
5
|
+
py_msbuild_extractor/licenses/msbuild-extractor-sample-LICENSE.txt,sha256=XKKSDU9WlUEAyPNlRhq6e2xhVNpJc097JwPZJ1rUnRE,1077
|
|
6
|
+
py_msbuild_extractor-0.0.1.dist-info/METADATA,sha256=UnRaf6wGmw4nIRYl5mXOjuHN3NFoVxXGz95T8YB72uA,1790
|
|
7
|
+
py_msbuild_extractor-0.0.1.dist-info/WHEEL,sha256=hVx9elvUDfBjRmbl8JwIcXXikst35RZTZK9nspfI_28,98
|
|
8
|
+
py_msbuild_extractor-0.0.1.dist-info/entry_points.txt,sha256=3PTI0maMJAldnp1ElYiXlf2e40Zgu4F3EivsCiE3Nsw,74
|
|
9
|
+
py_msbuild_extractor-0.0.1.dist-info/top_level.txt,sha256=KvxAhGKHltjiB0Zm-ptBrIMReJW_YMPyYXVxpYf-sd0,21
|
|
10
|
+
py_msbuild_extractor-0.0.1.dist-info/RECORD,,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
py_msbuild_extractor
|