pkgwho 0.1.1__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.
@@ -0,0 +1,27 @@
1
+ # Python bytecode and caches
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+ .pytest_cache/
6
+ .mypy_cache/
7
+ .ruff_cache/
8
+ .coverage
9
+ htmlcov/
10
+
11
+ # Packaging and virtual environments
12
+ build/
13
+ dist/
14
+ *.egg-info/
15
+ .venv/
16
+ venv/
17
+ ENV/
18
+
19
+ # Local configuration and secrets
20
+ .env
21
+ .env.*
22
+ !.env.example
23
+
24
+ # Editor and operating system files
25
+ .vscode/
26
+ .idea/
27
+ .DS_Store
pkgwho-0.1.1/AGENTS.md ADDED
@@ -0,0 +1,30 @@
1
+ # Repository Guidelines
2
+
3
+ ## Project Structure
4
+ - `src/pkgwho/`: Python package and CLI implementation.
5
+ - `tests/`: pytest tests (`test_*.py`).
6
+ - Root metadata and user documentation: `pyproject.toml`, `README.md`.
7
+
8
+ ## Development
9
+ - Create the development environment with `uv venv --python 3.12`.
10
+ - Install the package and development tools with
11
+ `uv pip install --python .venv/bin/python -e ".[dev]"`.
12
+ - Run the CLI with `pkgwho COMMAND`; use `pkgwho --help` for options.
13
+ - Check type hints with
14
+ `uv run --python .venv/bin/python mypy src/pkgwho`.
15
+ - Run pytest with elevated permissions:
16
+ `uv run --python .venv/bin/python pytest`.
17
+ - Python 3.10 or newer is supported. Use type hints and 4-space indentation.
18
+ - Use elevated permissions when a required development or system operation
19
+ cannot be completed with normal permissions.
20
+
21
+ ## Implementation Principles
22
+ - Query package managers with `subprocess` argument lists; do not use
23
+ `shell=True`.
24
+ - Treat executable paths as supporting evidence and prefer manager databases.
25
+ - Show uninstall commands, but never uninstall packages automatically.
26
+ - Use semantic commit messages with a Conventional Commit type, such as
27
+ `feat: add snap detection`, `fix: handle missing package tools`, or
28
+ `docs: clarify package search`.
29
+ - Create commits with elevated permissions.
30
+ - Update `release-notes.md` in the same commit whenever bumping the version.
@@ -0,0 +1,9 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026-present Toshihiro Kamiya <kamiya@mbj.nifty.com>
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
+
7
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
pkgwho-0.1.1/PKG-INFO ADDED
@@ -0,0 +1,141 @@
1
+ Metadata-Version: 2.5
2
+ Name: pkgwho
3
+ Version: 0.1.1
4
+ Summary: Identify the packages that provide commands and fonts on Linux
5
+ Project-URL: Documentation, https://github.com/tos-kamiya/pkgwho#readme
6
+ Project-URL: Issues, https://github.com/tos-kamiya/pkgwho/issues
7
+ Project-URL: Source, https://github.com/tos-kamiya/pkgwho
8
+ Project-URL: Changelog, https://github.com/tos-kamiya/pkgwho/blob/main/release-notes.md
9
+ Author-email: Toshihiro Kamiya <kamiya@mbj.nifty.com>
10
+ License-Expression: MIT
11
+ License-File: LICENSE.txt
12
+ Keywords: command,font,linux,package manager,package ownership
13
+ Classifier: Development Status :: 4 - Beta
14
+ Classifier: Environment :: Console
15
+ Classifier: Operating System :: POSIX :: Linux
16
+ Classifier: Programming Language :: Python
17
+ Classifier: Programming Language :: Python :: 3 :: Only
18
+ Classifier: Programming Language :: Python :: 3.10
19
+ Classifier: Programming Language :: Python :: 3.11
20
+ Classifier: Programming Language :: Python :: 3.12
21
+ Classifier: Programming Language :: Python :: 3.13
22
+ Classifier: Programming Language :: Python :: 3.14
23
+ Classifier: Programming Language :: Python :: Implementation :: CPython
24
+ Classifier: Programming Language :: Python :: Implementation :: PyPy
25
+ Classifier: Topic :: System :: Installation/Setup
26
+ Classifier: Topic :: System :: Systems Administration
27
+ Classifier: Topic :: Utilities
28
+ Requires-Python: >=3.10
29
+ Provides-Extra: dev
30
+ Requires-Dist: mypy>=1.0.0; extra == 'dev'
31
+ Requires-Dist: pytest>=7; extra == 'dev'
32
+ Description-Content-Type: text/markdown
33
+
34
+ # pkgwho
35
+
36
+ Find which package manager installed a command or font on Linux, or search
37
+ installed packages by name. pkgwho checks dpkg/apt, Snap, Flatpak, pipx, uv
38
+ tools, Cargo, and Homebrew, and suggests how to remove packages. It never
39
+ uninstalls anything automatically.
40
+
41
+ ## Installation
42
+
43
+ Install directly from GitHub with [pipx](https://pipx.pypa.io/):
44
+
45
+ ```console
46
+ pipx install git+https://github.com/tos-kamiya/pkgwho.git
47
+ ```
48
+
49
+ ## Usage
50
+
51
+ Pass one or more search terms. By default, pkgwho searches commands, packages,
52
+ and fonts for each term:
53
+
54
+ ```console
55
+ pkgwho git snap flatpak
56
+ pkgwho /usr/local/bin/my-command
57
+ ```
58
+
59
+ The exit status is nonzero if any query has no result in the selected search
60
+ types. In combined mode, a query succeeds if any of the searches finds a result.
61
+
62
+ ### `--type {command,package,font,all}`
63
+
64
+ Choose what to search. The default is `all`.
65
+
66
+ | Type | Search |
67
+ | --- | --- |
68
+ | `command` | Resolve a command in `PATH` or a file path and identify its package owner. |
69
+ | `package` | Find installed package names by case-insensitive partial match, including libraries. |
70
+ | `font` | Find installed font family or full names by case- and punctuation-insensitive partial match. |
71
+ | `all` | Search all three independently. A package may appear in more than one result. |
72
+
73
+ ```console
74
+ pkgwho --type command git
75
+ pkgwho --type package chrome
76
+ pkgwho --type font "Noto Sans"
77
+ ```
78
+
79
+ Command searches report `unknown` when no supported manager claims the file.
80
+ They also report matching PATH entries in Bash, Zsh, and Fish configuration,
81
+ including Fish's `fish_user_paths`. These entries are not proof of installation;
82
+ configuration files are read but never executed or modified.
83
+
84
+ Font searches require Fontconfig's `fc-list`. Results include the font file and,
85
+ when found in the dpkg or Homebrew formula database, its package and suggested
86
+ uninstall command. Unowned files are still shown. An unavailable `fc-list` is
87
+ reported and causes a nonzero exit status in font-only mode.
88
+
89
+ ### `--no-limit`
90
+
91
+ Text output shows up to 20 matches per search. Use `--no-limit` to display all
92
+ matches:
93
+
94
+ ```console
95
+ pkgwho --type package nvidia --no-limit
96
+ ```
97
+
98
+ ### `--json`
99
+
100
+ Emit a JSON array for one or more queries:
101
+
102
+ ```console
103
+ pkgwho git unknown-tool --json
104
+ ```
105
+
106
+ In combined mode, each array element contains `query`, `command`, `package`,
107
+ and `font` fields. In single-type mode, each element contains that search's
108
+ result directly. JSON includes all matches without the text output's default
109
+ 20-match limit.
110
+
111
+ ### `-o FILE`, `--output FILE`
112
+
113
+ Write the selected output format to a file instead of standard output. Existing
114
+ files are overwritten:
115
+
116
+ ```console
117
+ pkgwho git --json --output results.json
118
+ ```
119
+
120
+ ### `-h`, `--help`
121
+
122
+ Show command-line usage and exit.
123
+
124
+ ### `--version`
125
+
126
+ Show the installed pkgwho version and exit.
127
+
128
+ ## Supported managers
129
+
130
+ - **dpkg/apt**: queries dpkg's file ownership database.
131
+ - **Snap**: checks commands exposed in `/snap/bin` against installed snaps.
132
+ - **Flatpak**: recognizes application launchers exported in Flatpak's
133
+ `exports/bin` directories.
134
+ - **pipx**: maps exposed applications from `pipx list` to their environments.
135
+ - **uv**: maps exposed executables from `uv tool list` to installed tools.
136
+ - **Cargo**: maps binaries from `cargo install --list` to installed crates.
137
+ - **Homebrew**: queries installed formulae and matches files listed by Homebrew.
138
+
139
+ ## License
140
+
141
+ `pkgwho` is distributed under the terms of the [MIT](https://spdx.org/licenses/MIT.html) license.
pkgwho-0.1.1/README.md ADDED
@@ -0,0 +1,108 @@
1
+ # pkgwho
2
+
3
+ Find which package manager installed a command or font on Linux, or search
4
+ installed packages by name. pkgwho checks dpkg/apt, Snap, Flatpak, pipx, uv
5
+ tools, Cargo, and Homebrew, and suggests how to remove packages. It never
6
+ uninstalls anything automatically.
7
+
8
+ ## Installation
9
+
10
+ Install directly from GitHub with [pipx](https://pipx.pypa.io/):
11
+
12
+ ```console
13
+ pipx install git+https://github.com/tos-kamiya/pkgwho.git
14
+ ```
15
+
16
+ ## Usage
17
+
18
+ Pass one or more search terms. By default, pkgwho searches commands, packages,
19
+ and fonts for each term:
20
+
21
+ ```console
22
+ pkgwho git snap flatpak
23
+ pkgwho /usr/local/bin/my-command
24
+ ```
25
+
26
+ The exit status is nonzero if any query has no result in the selected search
27
+ types. In combined mode, a query succeeds if any of the searches finds a result.
28
+
29
+ ### `--type {command,package,font,all}`
30
+
31
+ Choose what to search. The default is `all`.
32
+
33
+ | Type | Search |
34
+ | --- | --- |
35
+ | `command` | Resolve a command in `PATH` or a file path and identify its package owner. |
36
+ | `package` | Find installed package names by case-insensitive partial match, including libraries. |
37
+ | `font` | Find installed font family or full names by case- and punctuation-insensitive partial match. |
38
+ | `all` | Search all three independently. A package may appear in more than one result. |
39
+
40
+ ```console
41
+ pkgwho --type command git
42
+ pkgwho --type package chrome
43
+ pkgwho --type font "Noto Sans"
44
+ ```
45
+
46
+ Command searches report `unknown` when no supported manager claims the file.
47
+ They also report matching PATH entries in Bash, Zsh, and Fish configuration,
48
+ including Fish's `fish_user_paths`. These entries are not proof of installation;
49
+ configuration files are read but never executed or modified.
50
+
51
+ Font searches require Fontconfig's `fc-list`. Results include the font file and,
52
+ when found in the dpkg or Homebrew formula database, its package and suggested
53
+ uninstall command. Unowned files are still shown. An unavailable `fc-list` is
54
+ reported and causes a nonzero exit status in font-only mode.
55
+
56
+ ### `--no-limit`
57
+
58
+ Text output shows up to 20 matches per search. Use `--no-limit` to display all
59
+ matches:
60
+
61
+ ```console
62
+ pkgwho --type package nvidia --no-limit
63
+ ```
64
+
65
+ ### `--json`
66
+
67
+ Emit a JSON array for one or more queries:
68
+
69
+ ```console
70
+ pkgwho git unknown-tool --json
71
+ ```
72
+
73
+ In combined mode, each array element contains `query`, `command`, `package`,
74
+ and `font` fields. In single-type mode, each element contains that search's
75
+ result directly. JSON includes all matches without the text output's default
76
+ 20-match limit.
77
+
78
+ ### `-o FILE`, `--output FILE`
79
+
80
+ Write the selected output format to a file instead of standard output. Existing
81
+ files are overwritten:
82
+
83
+ ```console
84
+ pkgwho git --json --output results.json
85
+ ```
86
+
87
+ ### `-h`, `--help`
88
+
89
+ Show command-line usage and exit.
90
+
91
+ ### `--version`
92
+
93
+ Show the installed pkgwho version and exit.
94
+
95
+ ## Supported managers
96
+
97
+ - **dpkg/apt**: queries dpkg's file ownership database.
98
+ - **Snap**: checks commands exposed in `/snap/bin` against installed snaps.
99
+ - **Flatpak**: recognizes application launchers exported in Flatpak's
100
+ `exports/bin` directories.
101
+ - **pipx**: maps exposed applications from `pipx list` to their environments.
102
+ - **uv**: maps exposed executables from `uv tool list` to installed tools.
103
+ - **Cargo**: maps binaries from `cargo install --list` to installed crates.
104
+ - **Homebrew**: queries installed formulae and matches files listed by Homebrew.
105
+
106
+ ## License
107
+
108
+ `pkgwho` is distributed under the terms of the [MIT](https://spdx.org/licenses/MIT.html) license.
@@ -0,0 +1,82 @@
1
+ [build-system]
2
+ requires = ["hatchling>=1.27"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "pkgwho"
7
+ dynamic = ["version"]
8
+ description = "Identify the packages that provide commands and fonts on Linux"
9
+ readme = "README.md"
10
+ requires-python = ">=3.10"
11
+ license = "MIT"
12
+ license-files = ["LICENSE.txt"]
13
+ keywords = ["package manager", "package ownership", "command", "font", "linux"]
14
+ authors = [
15
+ { name = "Toshihiro Kamiya", email = "kamiya@mbj.nifty.com" },
16
+ ]
17
+ classifiers = [
18
+ "Development Status :: 4 - Beta",
19
+ "Environment :: Console",
20
+ "Operating System :: POSIX :: Linux",
21
+ "Programming Language :: Python",
22
+ "Programming Language :: Python :: 3 :: Only",
23
+ "Programming Language :: Python :: 3.10",
24
+ "Programming Language :: Python :: 3.11",
25
+ "Programming Language :: Python :: 3.12",
26
+ "Programming Language :: Python :: 3.13",
27
+ "Programming Language :: Python :: 3.14",
28
+ "Programming Language :: Python :: Implementation :: CPython",
29
+ "Programming Language :: Python :: Implementation :: PyPy",
30
+ "Topic :: System :: Installation/Setup",
31
+ "Topic :: System :: Systems Administration",
32
+ "Topic :: Utilities",
33
+ ]
34
+ dependencies = []
35
+
36
+ [project.optional-dependencies]
37
+ dev = ["mypy>=1.0.0", "pytest>=7"]
38
+
39
+ [project.scripts]
40
+ pkgwho = "pkgwho.cli:main"
41
+
42
+ [project.urls]
43
+ Documentation = "https://github.com/tos-kamiya/pkgwho#readme"
44
+ Issues = "https://github.com/tos-kamiya/pkgwho/issues"
45
+ Source = "https://github.com/tos-kamiya/pkgwho"
46
+ Changelog = "https://github.com/tos-kamiya/pkgwho/blob/main/release-notes.md"
47
+
48
+ [tool.hatch.version]
49
+ path = "src/pkgwho/__about__.py"
50
+
51
+ [tool.hatch.build.targets.sdist]
52
+ exclude = ["/dev-notes"]
53
+
54
+ [tool.hatch.envs.types]
55
+ extra-dependencies = [
56
+ "mypy>=1.0.0",
57
+ ]
58
+ [tool.hatch.envs.types.scripts]
59
+ check = "mypy --install-types --non-interactive {args:src/pkgwho tests}"
60
+
61
+ [tool.mypy]
62
+ python_version = "3.10"
63
+ files = ["src/pkgwho"]
64
+
65
+ [tool.coverage.run]
66
+ source_pkgs = ["pkgwho", "tests"]
67
+ branch = true
68
+ parallel = true
69
+ omit = [
70
+ "src/pkgwho/__about__.py",
71
+ ]
72
+
73
+ [tool.coverage.paths]
74
+ pkgwho = ["src/pkgwho", "*/pkgwho/src/pkgwho"]
75
+ tests = ["tests", "*/pkgwho/tests"]
76
+
77
+ [tool.coverage.report]
78
+ exclude_lines = [
79
+ "no cov",
80
+ "if __name__ == .__main__.:",
81
+ "if TYPE_CHECKING:",
82
+ ]
@@ -0,0 +1,51 @@
1
+ # Changelog
2
+
3
+ ## 0.1.1 - 2026-11-16
4
+
5
+ - Exclude development notes from source distributions.
6
+ - Remove the obsolete handoff document.
7
+
8
+ ## 0.1.0 - 2026-11-16
9
+
10
+ - Separate command, package, and font searches with `--type command`,
11
+ `--type package`, and `--type font`; `--type all` searches all three.
12
+ - Remove `--apps-only`; package searches now include libraries and other
13
+ non-application packages.
14
+ - Add package search results to the combined JSON output.
15
+
16
+ ## 0.0.7 - 2026-11-16
17
+
18
+ - Remove the `--font` alias; use `--type font` for font searches.
19
+ - Prepare package metadata for distribution on PyPI.
20
+
21
+ ## 0.0.6 - 2026-11-16
22
+
23
+ - Search installed fonts by family or full name using Fontconfig, showing font
24
+ files and their dpkg or Homebrew package owners when available.
25
+ - Search commands and fonts by default; use `--type command`, `--type font`,
26
+ or `--type all` to select the search scope.
27
+ - Support JSON output and display limits for font search results.
28
+
29
+ ## 0.0.5 - 2026-10-19
30
+
31
+ - Report shell configuration sources that add a resolved command's directory
32
+ to PATH, including Bash, Zsh, Fish, and Fish's persistent `fish_user_paths`.
33
+ - Distinguish PATH configuration records from evidence of package ownership.
34
+
35
+ ## 0.0.4 - 2026-10-07
36
+
37
+ - Add JSON output for one or more commands.
38
+ - Add `-o` / `--output` to save results to a file.
39
+
40
+ ## 0.0.3 - 2026-10-07
41
+
42
+ - Add package detection for pipx, uv tools, Cargo, and Homebrew.
43
+ - Search installed package names across all supported package managers.
44
+
45
+ ## 0.0.2 - 2026-10-07
46
+
47
+ - Add application-only filtering and a match limit to package search results.
48
+ - Add `--apps-only true|false` to choose whether to include non-application
49
+ packages.
50
+ - Include Debian package sections in search results to improve default
51
+ filtering.
@@ -0,0 +1,4 @@
1
+ # SPDX-FileCopyrightText: 2026-present Toshihiro Kamiya <kamiya@mbj.nifty.com>
2
+ #
3
+ # SPDX-License-Identifier: MIT
4
+ __version__ = "0.1.1"
@@ -0,0 +1,3 @@
1
+ # SPDX-FileCopyrightText: 2026-present Toshihiro Kamiya <kamiya@mbj.nifty.com>
2
+ #
3
+ # SPDX-License-Identifier: MIT