orphans 1.0.0__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.
Files changed (78) hide show
  1. orphans-1.0.0/.github/ISSUE_TEMPLATE/bug.yml +49 -0
  2. orphans-1.0.0/.github/ISSUE_TEMPLATE/config.yml +8 -0
  3. orphans-1.0.0/.github/ISSUE_TEMPLATE/install.yml +44 -0
  4. orphans-1.0.0/.github/ISSUE_TEMPLATE/manager.yml +30 -0
  5. orphans-1.0.0/.github/workflows/ci.yml +61 -0
  6. orphans-1.0.0/.github/workflows/release.yml +57 -0
  7. orphans-1.0.0/.gitignore +24 -0
  8. orphans-1.0.0/LICENSE +21 -0
  9. orphans-1.0.0/PKG-INFO +126 -0
  10. orphans-1.0.0/README.md +74 -0
  11. orphans-1.0.0/core/aliases.py +51 -0
  12. orphans-1.0.0/core/analyzer.py +11 -0
  13. orphans-1.0.0/core/cleanup.py +134 -0
  14. orphans-1.0.0/core/cli_output.py +84 -0
  15. orphans-1.0.0/core/config.py +78 -0
  16. orphans-1.0.0/core/disk_analyzer.py +72 -0
  17. orphans-1.0.0/core/duplicate_scanner.py +43 -0
  18. orphans-1.0.0/core/format.py +11 -0
  19. orphans-1.0.0/core/graph.py +41 -0
  20. orphans-1.0.0/core/health_scorer.py +83 -0
  21. orphans-1.0.0/core/project_scanner.py +229 -0
  22. orphans-1.0.0/core/repair.py +153 -0
  23. orphans-1.0.0/core/scan.py +58 -0
  24. orphans-1.0.0/core/scanners/brew_scanner.py +79 -0
  25. orphans-1.0.0/core/scanners/cargo_scanner.py +63 -0
  26. orphans-1.0.0/core/scanners/npm_scanner.py +95 -0
  27. orphans-1.0.0/core/scanners/pip_scanner.py +134 -0
  28. orphans-1.0.0/core/snapshot.py +200 -0
  29. orphans-1.0.0/core/uninstaller.py +92 -0
  30. orphans-1.0.0/core/vulnerability_scanner.py +28 -0
  31. orphans-1.0.0/docs/RELEASE.md +72 -0
  32. orphans-1.0.0/docs/badges/_logo_paths.json +11 -0
  33. orphans-1.0.0/docs/badges/_make_badges.py +239 -0
  34. orphans-1.0.0/docs/badges/cargo.svg +19 -0
  35. orphans-1.0.0/docs/badges/homebrew.svg +19 -0
  36. orphans-1.0.0/docs/badges/license.svg +18 -0
  37. orphans-1.0.0/docs/badges/npm.svg +19 -0
  38. orphans-1.0.0/docs/badges/pip.svg +20 -0
  39. orphans-1.0.0/docs/badges/pypi.svg +21 -0
  40. orphans-1.0.0/docs/badges/python.svg +22 -0
  41. orphans-1.0.0/docs/demo.png +0 -0
  42. orphans-1.0.0/main.py +146 -0
  43. orphans-1.0.0/models/package.py +49 -0
  44. orphans-1.0.0/models/vulnerability.py +22 -0
  45. orphans-1.0.0/pyproject.toml +64 -0
  46. orphans-1.0.0/registry/brew_client.py +44 -0
  47. orphans-1.0.0/registry/cache.py +62 -0
  48. orphans-1.0.0/registry/crates_client.py +46 -0
  49. orphans-1.0.0/registry/npm_registry_client.py +45 -0
  50. orphans-1.0.0/registry/osv_client.py +157 -0
  51. orphans-1.0.0/registry/pypi_client.py +68 -0
  52. orphans-1.0.0/tests/test_analyzer.py +54 -0
  53. orphans-1.0.0/tests/test_brew_scanner.py +5 -0
  54. orphans-1.0.0/tests/test_cache.py +6 -0
  55. orphans-1.0.0/tests/test_cargo_scanner.py +5 -0
  56. orphans-1.0.0/tests/test_cleanup.py +17 -0
  57. orphans-1.0.0/tests/test_cli.py +11 -0
  58. orphans-1.0.0/tests/test_cli_output.py +20 -0
  59. orphans-1.0.0/tests/test_config.py +7 -0
  60. orphans-1.0.0/tests/test_disk_analyzer.py +5 -0
  61. orphans-1.0.0/tests/test_duplicate_scanner.py +5 -0
  62. orphans-1.0.0/tests/test_format.py +37 -0
  63. orphans-1.0.0/tests/test_graph.py +39 -0
  64. orphans-1.0.0/tests/test_health.py +21 -0
  65. orphans-1.0.0/tests/test_main.py +17 -0
  66. orphans-1.0.0/tests/test_npm_scanner.py +5 -0
  67. orphans-1.0.0/tests/test_package.py +29 -0
  68. orphans-1.0.0/tests/test_pip_scanner.py +5 -0
  69. orphans-1.0.0/tests/test_project_scanner.py +6 -0
  70. orphans-1.0.0/tests/test_registry.py +5 -0
  71. orphans-1.0.0/tests/test_repair.py +13 -0
  72. orphans-1.0.0/tests/test_scan.py +25 -0
  73. orphans-1.0.0/tests/test_scanners.py +0 -0
  74. orphans-1.0.0/tests/test_scanners_pkg.py +5 -0
  75. orphans-1.0.0/tests/test_snapshot.py +20 -0
  76. orphans-1.0.0/tests/test_uninstaller.py +14 -0
  77. orphans-1.0.0/tests/test_vulnerability.py +5 -0
  78. orphans-1.0.0/tests/test_vulnerability_scanner.py +5 -0
@@ -0,0 +1,49 @@
1
+ name: Bug report
2
+ description: Something orphans does is wrong or broken
3
+ labels: ["bug"]
4
+ body:
5
+ - type: markdown
6
+ attributes:
7
+ value: |
8
+ Thanks for taking the time to report a bug. Fill in what you can.
9
+ - type: input
10
+ id: os
11
+ attributes:
12
+ label: Operating system
13
+ placeholder: "macOS 14, Ubuntu 24.04, Windows 11"
14
+ validations:
15
+ required: true
16
+ - type: input
17
+ id: version
18
+ attributes:
19
+ label: orphans version
20
+ placeholder: "run orphans --version and paste the output"
21
+ validations:
22
+ required: true
23
+ - type: textarea
24
+ id: command
25
+ attributes:
26
+ label: Command you ran
27
+ placeholder: "orphans --cleanup --dry-run"
28
+ validations:
29
+ required: true
30
+ - type: textarea
31
+ id: expected
32
+ attributes:
33
+ label: What you expected to happen
34
+ validations:
35
+ required: true
36
+ - type: textarea
37
+ id: actual
38
+ attributes:
39
+ label: What actually happened
40
+ render: shell
41
+ validations:
42
+ required: true
43
+ - type: textarea
44
+ id: managers
45
+ attributes:
46
+ label: Package managers you have installed
47
+ placeholder: "pip, npm, cargo, brew"
48
+ validations:
49
+ required: false
@@ -0,0 +1,8 @@
1
+ blank_issues_enabled: true
2
+ contact_links:
3
+ - name: Documentation
4
+ url: https://github.com/ado11231/orphans#readme
5
+ about: Read the README for install steps and usage.
6
+ - name: PyPI page
7
+ url: https://pypi.org/project/orphans/
8
+ about: The published package on PyPI.
@@ -0,0 +1,44 @@
1
+ name: Installation help
2
+ description: orphans will not install or will not run after install
3
+ labels: ["install"]
4
+ body:
5
+ - type: markdown
6
+ attributes:
7
+ value: |
8
+ Tell us what went wrong during install. The more detail you give, the
9
+ faster we can help.
10
+ - type: input
11
+ id: os
12
+ attributes:
13
+ label: Operating system
14
+ placeholder: "macOS 14, Ubuntu 24.04, Windows 11"
15
+ validations:
16
+ required: true
17
+ - type: input
18
+ id: python
19
+ attributes:
20
+ label: Python version
21
+ placeholder: "3.12.4"
22
+ validations:
23
+ required: true
24
+ - type: input
25
+ id: how
26
+ attributes:
27
+ label: How did you install orphans
28
+ placeholder: "pipx install orphans, pip install ., from the wheel"
29
+ validations:
30
+ required: true
31
+ - type: textarea
32
+ id: command
33
+ attributes:
34
+ label: Command you ran
35
+ placeholder: "orphans --version"
36
+ validations:
37
+ required: true
38
+ - type: textarea
39
+ id: error
40
+ attributes:
41
+ label: Full error output
42
+ render: shell
43
+ validations:
44
+ required: true
@@ -0,0 +1,30 @@
1
+ name: Package manager request
2
+ description: Ask about a package manager orphans does not scan yet
3
+ labels: ["manager"]
4
+ body:
5
+ - type: markdown
6
+ attributes:
7
+ value: |
8
+ orphans scans pip, npm, cargo, and Homebrew today. If you want another
9
+ package manager added, tell us which one and why.
10
+ - type: input
11
+ id: manager
12
+ attributes:
13
+ label: Package manager name
14
+ placeholder: "yarn, pnpm, apt, dnf"
15
+ validations:
16
+ required: true
17
+ - type: input
18
+ id: link
19
+ attributes:
20
+ label: Link to its website or docs
21
+ placeholder: "https://yarnpkg.com"
22
+ validations:
23
+ required: false
24
+ - type: textarea
25
+ id: why
26
+ attributes:
27
+ label: Why you want it added
28
+ placeholder: "I use it every day and I have no way to find orphans in it."
29
+ validations:
30
+ required: true
@@ -0,0 +1,61 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ branches: [main]
8
+
9
+ jobs:
10
+ test:
11
+ runs-on: ubuntu-latest
12
+ strategy:
13
+ matrix:
14
+ python-version: ["3.11", "3.12", "3.13"]
15
+
16
+ steps:
17
+ - uses: actions/checkout@v4
18
+
19
+ - name: Set up Python ${{ matrix.python-version }}
20
+ uses: actions/setup-python@v5
21
+ with:
22
+ python-version: ${{ matrix.python-version }}
23
+
24
+ - name: Install
25
+ run: |
26
+ python -m pip install --upgrade pip
27
+ pip install -e .
28
+ pip install ruff pytest
29
+
30
+ - name: Lint
31
+ run: ruff check .
32
+
33
+ - name: Test
34
+ run: python -m pytest tests/ -q
35
+
36
+ build-and-install:
37
+ # Build the wheel exactly as release.yml does and install it in a clean
38
+ # pipx environment, so a packaging regression (missing module, broken
39
+ # console-script, version metadata) is caught before tag + publish.
40
+ runs-on: ubuntu-latest
41
+ steps:
42
+ - uses: actions/checkout@v4
43
+
44
+ - name: Set up Python
45
+ uses: actions/setup-python@v5
46
+ with:
47
+ python-version: "3.11"
48
+
49
+ - name: Install build + install tooling
50
+ run: |
51
+ python -m pip install --upgrade pip
52
+ pip install --upgrade build pipx
53
+
54
+ - name: Build wheel and sdist
55
+ run: python -m build
56
+
57
+ - name: pipx-install the built wheel
58
+ run: pipx install --force dist/*.whl
59
+
60
+ - name: console-script runs and --version works
61
+ run: orphans --version
@@ -0,0 +1,57 @@
1
+ name: Release (PyPI)
2
+
3
+ # Builds the wheel + sdist on a pushed v* tag and publishes to PyPI using
4
+ # OIDC trusted publishing (no stored API token). Configure the trusted
5
+ # publisher once on pypi.org first — see docs/RELEASE.md.
6
+ on:
7
+ push:
8
+ tags:
9
+ - "v*"
10
+
11
+ # OIDC trusted publishing requires id-token: write.
12
+ permissions:
13
+ contents: read
14
+ id-token: write
15
+
16
+ jobs:
17
+ build:
18
+ runs-on: ubuntu-latest
19
+ steps:
20
+ - uses: actions/checkout@v4
21
+
22
+ - name: Set up Python
23
+ uses: actions/setup-python@v5
24
+ with:
25
+ python-version: "3.11"
26
+
27
+ - name: Install build tooling
28
+ run: pip install --upgrade build
29
+
30
+ - name: Build wheel and sdist
31
+ run: python -m build
32
+
33
+ - name: Smoke-install the wheel and run --version
34
+ run: |
35
+ python -m pip install --upgrade pip
36
+ python -m pip install dist/*.whl
37
+ orphans --version
38
+
39
+ - name: Upload build artifacts
40
+ uses: actions/upload-artifact@v4
41
+ with:
42
+ name: dist
43
+ path: dist/
44
+
45
+ publish:
46
+ needs: build
47
+ runs-on: ubuntu-latest
48
+ environment: pypi
49
+ steps:
50
+ - name: Download build artifacts
51
+ uses: actions/download-artifact@v4
52
+ with:
53
+ name: dist
54
+ path: dist/
55
+
56
+ - name: Publish to PyPI
57
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,24 @@
1
+ __pycache__/
2
+ *.py[cod]
3
+ *.pyo
4
+ .venv/
5
+ venv/
6
+ env/
7
+ *.egg-info/
8
+ dist/
9
+ build/
10
+ .pytest_cache/
11
+ .benchmarks/
12
+
13
+ *.db
14
+ *.sqlite
15
+ *.sqlite3
16
+
17
+ .env
18
+ .env.local
19
+
20
+ .DS_Store
21
+ Thumbs.db
22
+
23
+ .vscode/
24
+ .idea/
orphans-1.0.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 adnan
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.
orphans-1.0.0/PKG-INFO ADDED
@@ -0,0 +1,126 @@
1
+ Metadata-Version: 2.4
2
+ Name: orphans
3
+ Version: 1.0.0
4
+ Summary: See every package installed on your machine and know which ones are safe to remove.
5
+ Project-URL: Homepage, https://github.com/ado11231/orphans
6
+ Project-URL: Repository, https://github.com/ado11231/orphans
7
+ Project-URL: Issues, https://github.com/ado11231/orphans/issues
8
+ Author: Adnan Alagic
9
+ License: MIT License
10
+
11
+ Copyright (c) 2026 adnan
12
+
13
+ Permission is hereby granted, free of charge, to any person obtaining a copy
14
+ of this software and associated documentation files (the "Software"), to deal
15
+ in the Software without restriction, including without limitation the rights
16
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
17
+ copies of the Software, and to permit persons to whom the Software is
18
+ furnished to do so, subject to the following conditions:
19
+
20
+ The above copyright notice and this permission notice shall be included in all
21
+ copies or substantial portions of the Software.
22
+
23
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
24
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
26
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
28
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
29
+ SOFTWARE.
30
+ License-File: LICENSE
31
+ Keywords: auditor,cargo,cleanup,homebrew,npm,orphan,package-manager,pip
32
+ Classifier: Development Status :: 4 - Beta
33
+ Classifier: Environment :: Console
34
+ Classifier: Intended Audience :: Developers
35
+ Classifier: License :: OSI Approved :: MIT License
36
+ Classifier: Operating System :: MacOS
37
+ Classifier: Operating System :: POSIX
38
+ Classifier: Programming Language :: Python :: 3
39
+ Classifier: Programming Language :: Python :: 3 :: Only
40
+ Classifier: Programming Language :: Python :: 3.11
41
+ Classifier: Programming Language :: Python :: 3.12
42
+ Classifier: Programming Language :: Python :: 3.13
43
+ Classifier: Topic :: System :: Installation/Setup
44
+ Classifier: Topic :: Utilities
45
+ Classifier: Typing :: Typed
46
+ Requires-Python: >=3.11
47
+ Requires-Dist: httpx<1.0,>=0.27
48
+ Requires-Dist: packaging>=20.0
49
+ Requires-Dist: pipdeptree<3.0,>=2.0
50
+ Requires-Dist: rich<14.0,>=13.0
51
+ Description-Content-Type: text/markdown
52
+
53
+ <h3 align="center">orphans</h3>
54
+
55
+ <p align="center">
56
+ <a href="https://pypi.org/project/orphans/"><img src="docs/badges/pypi.svg" alt="PyPI version"></a>
57
+ <a href="https://www.python.org/downloads/"><img src="docs/badges/python.svg" alt="Python versions"></a>
58
+ <a href="LICENSE"><img src="docs/badges/license.svg" alt="License"></a>
59
+ </p>
60
+
61
+ <p align="center">
62
+ <img src="docs/demo.png" alt="orphans screenshot" width="600">
63
+ </p>
64
+
65
+ <p align="center"><b>See every package on your machine and know which ones you can remove.</b></p>
66
+
67
+ <p align="center">
68
+ <b>orphans</b> looks at every package installed on your computer. It tells you
69
+ which ones are safe to remove. It never removes anything without asking you first.
70
+ </p>
71
+
72
+ <h3 align="center">Supported Package Managers</h3>
73
+
74
+ <p align="center">
75
+ <a href="https://pip.pypa.io"><img src="docs/badges/pip.svg" alt="pip"></a>
76
+ <a href="https://www.npmjs.com"><img src="docs/badges/npm.svg" alt="npm"></a>
77
+ <a href="https://doc.rust-lang.org/cargo"><img src="docs/badges/cargo.svg" alt="cargo"></a>
78
+ <a href="https://brew.sh"><img src="docs/badges/homebrew.svg" alt="Homebrew"></a>
79
+ </p>
80
+
81
+ ## Installation
82
+
83
+ Python 3.11 or newer required. Install orphans with pipx.
84
+
85
+ ```bash
86
+ pipx install orphans
87
+ ```
88
+
89
+ Can be installed from source code.
90
+
91
+ ```bash
92
+ git clone https://github.com/ado11231/orphans
93
+ cd orphans
94
+ pip install .
95
+ ```
96
+
97
+ Check Installation.
98
+
99
+ ```bash
100
+ orphans --version
101
+ ```
102
+
103
+ ## Usage
104
+
105
+ Run orphans to scan your machine.
106
+
107
+ ```bash
108
+ orphans
109
+ ```
110
+
111
+
112
+ | Flag | What it does |
113
+ | --- | --- |
114
+ | `orphans --cleanup` | Removes orphan packages |
115
+ | `orphans --cleanup --dry-run` | Shows what would be removed |
116
+ | `orphans --repair` | Updates old packages |
117
+ | `orphans --export results.json` | Saves results to a file |
118
+ | `orphans --format json` | Prints results as json |
119
+ | `orphans --snapshot` | Saves the current state |
120
+ | `orphans --rollback <snapshot>` | Restores a saved state |
121
+ | `orphans --watch` | Scans again every minute |
122
+ | `orphans --version` | Shows the version |
123
+
124
+ ## License
125
+
126
+ MIT, see [LICENSE](LICENSE).
@@ -0,0 +1,74 @@
1
+ <h3 align="center">orphans</h3>
2
+
3
+ <p align="center">
4
+ <a href="https://pypi.org/project/orphans/"><img src="docs/badges/pypi.svg" alt="PyPI version"></a>
5
+ <a href="https://www.python.org/downloads/"><img src="docs/badges/python.svg" alt="Python versions"></a>
6
+ <a href="LICENSE"><img src="docs/badges/license.svg" alt="License"></a>
7
+ </p>
8
+
9
+ <p align="center">
10
+ <img src="docs/demo.png" alt="orphans screenshot" width="600">
11
+ </p>
12
+
13
+ <p align="center"><b>See every package on your machine and know which ones you can remove.</b></p>
14
+
15
+ <p align="center">
16
+ <b>orphans</b> looks at every package installed on your computer. It tells you
17
+ which ones are safe to remove. It never removes anything without asking you first.
18
+ </p>
19
+
20
+ <h3 align="center">Supported Package Managers</h3>
21
+
22
+ <p align="center">
23
+ <a href="https://pip.pypa.io"><img src="docs/badges/pip.svg" alt="pip"></a>
24
+ <a href="https://www.npmjs.com"><img src="docs/badges/npm.svg" alt="npm"></a>
25
+ <a href="https://doc.rust-lang.org/cargo"><img src="docs/badges/cargo.svg" alt="cargo"></a>
26
+ <a href="https://brew.sh"><img src="docs/badges/homebrew.svg" alt="Homebrew"></a>
27
+ </p>
28
+
29
+ ## Installation
30
+
31
+ Python 3.11 or newer required. Install orphans with pipx.
32
+
33
+ ```bash
34
+ pipx install orphans
35
+ ```
36
+
37
+ Can be installed from source code.
38
+
39
+ ```bash
40
+ git clone https://github.com/ado11231/orphans
41
+ cd orphans
42
+ pip install .
43
+ ```
44
+
45
+ Check Installation.
46
+
47
+ ```bash
48
+ orphans --version
49
+ ```
50
+
51
+ ## Usage
52
+
53
+ Run orphans to scan your machine.
54
+
55
+ ```bash
56
+ orphans
57
+ ```
58
+
59
+
60
+ | Flag | What it does |
61
+ | --- | --- |
62
+ | `orphans --cleanup` | Removes orphan packages |
63
+ | `orphans --cleanup --dry-run` | Shows what would be removed |
64
+ | `orphans --repair` | Updates old packages |
65
+ | `orphans --export results.json` | Saves results to a file |
66
+ | `orphans --format json` | Prints results as json |
67
+ | `orphans --snapshot` | Saves the current state |
68
+ | `orphans --rollback <snapshot>` | Restores a saved state |
69
+ | `orphans --watch` | Scans again every minute |
70
+ | `orphans --version` | Shows the version |
71
+
72
+ ## License
73
+
74
+ MIT, see [LICENSE](LICENSE).
@@ -0,0 +1,51 @@
1
+ from __future__ import annotations
2
+
3
+ KNOWN_ALIASES: list[tuple[str, str]] = [
4
+ ("Pillow", "pil"),
5
+ ("PyYAML", "yaml"),
6
+ ("python-dateutil", "dateutil"),
7
+ ("python-dotenv", "dotenv"),
8
+ ("markdown-it-py", "markdown_it"),
9
+ ("paho-mqtt", "paho"),
10
+ ("influxdb-client", "influxdb_client"),
11
+ ("Pygments", "pygments"),
12
+ ("pyserial", "serial"),
13
+ ("cffi", "cffi"),
14
+ ("cryptography", "cryptography"),
15
+ ("certifi", "certifi"),
16
+ ("six", "six"),
17
+ ("rich", "rich"),
18
+ ("click", "click"),
19
+ ("fastapi", "fastapi"),
20
+ ("uvicorn", "uvicorn"),
21
+ ("numpy", "numpy"),
22
+ ("pydantic", "pydantic"),
23
+ ("starlette", "starlette"),
24
+ ("httptools", "httptools"),
25
+ ("uvloop", "uvloop"),
26
+ ("websockets", "websockets"),
27
+ ("watchfiles", "watchfiles"),
28
+ ("python-multipart", "python_multipart"),
29
+ ("aenum", "aenum"),
30
+ ("reactivex", "reactivex"),
31
+ ("reedsolo", "reedsolo"),
32
+ ("typing-extensions", "typing_extensions"),
33
+ ("typing-inspection", "typing_inspection"),
34
+ ("pydantic-core", "pydantic_core"),
35
+ ("annotated-types", "annotated_types"),
36
+ ("rich-click", "rich_click"),
37
+ ("esp-idf-nvs-partition-gen", "esp_idf_nvs_partition_gen"),
38
+ ("intelhex", "intelhex"),
39
+ ("bitstring", "bitstring"),
40
+ ("bitarray", "bitarray"),
41
+ ("esptool", "esptool"),
42
+ ("tibs", "tibs"),
43
+ ]
44
+
45
+ PACKAGE_TO_IMPORT: dict[str, str] = {
46
+ p.lower().replace("-", "_"): i for p, i in KNOWN_ALIASES
47
+ }
48
+
49
+ IMPORT_TO_PACKAGE: dict[str, str] = {
50
+ i: p for p, i in KNOWN_ALIASES
51
+ }
@@ -0,0 +1,11 @@
1
+ from __future__ import annotations
2
+
3
+ from models.package import InstallType, Package
4
+
5
+
6
+ def find_orphans(packages: list[Package]) -> list[Package]:
7
+ return [
8
+ pkg for pkg in packages
9
+ if pkg.install_type == InstallType.DEPENDENCY
10
+ and not pkg.dependents
11
+ ]