pipsutra 0.1.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.
@@ -0,0 +1,23 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ pull_request:
6
+
7
+ jobs:
8
+ test:
9
+ runs-on: ${{ matrix.os }}
10
+ strategy:
11
+ fail-fast: false
12
+ matrix:
13
+ os: [ubuntu-latest, windows-latest, macos-latest]
14
+ python-version: ["3.11", "3.12", "3.13"]
15
+ steps:
16
+ - uses: actions/checkout@v4
17
+ - uses: actions/setup-python@v5
18
+ with:
19
+ python-version: ${{ matrix.python-version }}
20
+ - run: python -m pip install -e ".[dev]"
21
+ - run: ruff check .
22
+ - run: ruff format --check .
23
+ - run: pytest
@@ -0,0 +1,65 @@
1
+ name: Publish Python distribution
2
+
3
+ on:
4
+ release:
5
+ types: [published]
6
+
7
+ permissions:
8
+ contents: read
9
+
10
+ jobs:
11
+ build:
12
+ runs-on: ubuntu-latest
13
+ steps:
14
+ - uses: actions/checkout@v4
15
+ - uses: actions/setup-python@v5
16
+ with:
17
+ python-version: "3.13"
18
+ - name: Build and verify distributions
19
+ run: |
20
+ python -m pip install --upgrade ".[dev]" build twine
21
+ ruff check .
22
+ ruff format --check .
23
+ pytest
24
+ python -m build
25
+ python -m twine check dist/*
26
+ - name: Upload distributions
27
+ uses: actions/upload-artifact@v4
28
+ with:
29
+ name: python-distributions
30
+ path: dist/
31
+ if-no-files-found: error
32
+
33
+ publish-pypi:
34
+ name: Publish to PyPI
35
+ needs: build
36
+ runs-on: ubuntu-latest
37
+ environment:
38
+ name: pypi
39
+ url: https://pypi.org/p/pipsutra
40
+ permissions:
41
+ id-token: write
42
+ steps:
43
+ - name: Download distributions
44
+ uses: actions/download-artifact@v4
45
+ with:
46
+ name: python-distributions
47
+ path: dist/
48
+ - uses: actions/setup-python@v5
49
+ with:
50
+ python-version: "3.13"
51
+ - name: Install twine
52
+ run: python -m pip install --upgrade twine
53
+ - name: Mint OIDC token and publish to PyPI
54
+ run: |
55
+ OIDC_TOKEN=$(curl -sS -H "Authorization: bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN" \
56
+ "$ACTIONS_ID_TOKEN_REQUEST_URL&audience=pypi" | python3 -c "import sys,json; print(json.load(sys.stdin)['value'])")
57
+ echo "OIDC token acquired"
58
+ MINT_RESP=$(curl -sS -X POST https://pypi.org/_/oidc/mint-token \
59
+ -H "Content-Type: application/json" \
60
+ -d "{\"token\": \"$OIDC_TOKEN\"}")
61
+ echo "Mint response: $MINT_RESP"
62
+ PYPI_TOKEN=$(echo "$MINT_RESP" | python3 -c "import sys,json; print(json.load(sys.stdin)['token'])")
63
+ python -m twine upload --verbose \
64
+ -u __token__ -p "$PYPI_TOKEN" \
65
+ dist/*
@@ -0,0 +1,17 @@
1
+ __pycache__/
2
+ *.py[cod]
3
+ *.egg-info/
4
+ .venv/
5
+ venv/
6
+ .pytest_cache/
7
+ .mypy_cache/
8
+ .ruff_cache/
9
+ .coverage
10
+ htmlcov/
11
+ dist/
12
+ build/
13
+ .pipsutra/
14
+ pipsutra-inventory.json
15
+ .env
16
+ pipsutra-report.json
17
+ .tox/
@@ -0,0 +1,33 @@
1
+ # Changelog
2
+
3
+ All notable changes to PipSutra are documented here.
4
+
5
+ ## [0.1.0] - 2026-12-01
6
+
7
+ ### Added
8
+
9
+ - Read declared dependencies from `requirements.txt` and PEP 621 dependency
10
+ fields in `pyproject.toml`.
11
+ - Inspect installed distribution metadata without importing package modules.
12
+ - Infer direct/transitive dependency reachability from installed metadata.
13
+ - Query exact installed PyPI package versions through the OSV batch API.
14
+ - Four explainable Python AST rules: `DG-PY-001` (`eval`/`exec`),
15
+ `DG-PY-002` (`os.system`), `DG-PY-003` (subprocess `shell=True`),
16
+ `DG-PY-004` (`pickle.loads`).
17
+ - Versioned JSON scan reports and terminal summaries.
18
+ - Severity-based CI exit gating with `--fail-on`.
19
+ - Cross-platform CI (Linux, Windows, macOS; Python 3.11–3.13).
20
+ - PyPI Trusted Publishing release workflow.
21
+ - Developer attribution: Nikhil Mutreja.
22
+ - Apache-2.0 license.
23
+
24
+ ### Limitations
25
+
26
+ - No lockfile-native dependency resolution, package provenance verification,
27
+ dynamic sandboxing, malware verdicts, or automatic remediation.
28
+ - Vulnerability coverage depends on OSV availability and data quality.
29
+ - Static rules are intentionally limited and can produce false positives and
30
+ false negatives.
31
+ - The aggregate risk score is a heuristic, not a calibrated probability or
32
+ safety certification.
33
+ - Marker evaluation reflects the running interpreter/platform only.
@@ -0,0 +1,12 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ We are committed to a welcoming, respectful, and harassment-free community.
4
+ Be considerate, use welcoming language, respect differing viewpoints, accept
5
+ constructive criticism, and focus on what is best for the community.
6
+
7
+ Unacceptable behavior includes harassment, insults, discrimination, personal
8
+ attacks, and publishing others' private information without permission.
9
+
10
+ Project maintainers are responsible for clarifying and enforcing these
11
+ standards. This project adopts the Contributor Covenant, version 2.1:
12
+ https://www.contributor-covenant.org/version/2/1/code_of_conduct/
@@ -0,0 +1,29 @@
1
+ # Contributing
2
+
3
+ Thanks for your interest in PipSutra.
4
+
5
+ ## Development setup
6
+
7
+ ```bash
8
+ python -m venv .venv
9
+ source .venv/bin/activate
10
+ python -m pip install -e ".[dev]"
11
+ ```
12
+
13
+ ## Before submitting a change
14
+
15
+ ```bash
16
+ ruff check .
17
+ ruff format --check .
18
+ mypy src/pipsutra
19
+ pytest
20
+ ```
21
+
22
+ Add tests for bug fixes and new behavior. Keep findings evidence-based and avoid
23
+ claiming that a package is malicious from a single weak indicator.
24
+
25
+ ## Contributions and licensing
26
+
27
+ By intentionally submitting a contribution for inclusion, you agree that it is
28
+ submitted under the project's Apache License 2.0, subject to any separate written
29
+ agreement. You retain copyright in your contribution.
pipsutra-0.1.0/LICENSE ADDED
@@ -0,0 +1,196 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all other
16
+ entities that control, are controlled by, or are under common control
17
+ with that entity. For the purposes of this definition, "control" means
18
+ (i) the power, direct or indirect, to cause the direction or management
19
+ of such entity, whether by contract or otherwise, or (ii) ownership of
20
+ fifty percent (50%) or more of the outstanding shares, or (iii)
21
+ beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity exercising
24
+ permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation source,
28
+ and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but not
32
+ limited to compiled object code, generated documentation, and
33
+ conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or Object
36
+ form, made available under the License, as indicated by a copyright
37
+ notice that is included in or attached to the work (an example is
38
+ provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including the
49
+ original version of the Work and any modifications or additions to
50
+ that Work or Derivative Works thereof, that is intentionally submitted
51
+ to Licensor for inclusion in the Work by the copyright owner or by an
52
+ individual or Legal Entity authorized to submit on behalf of the
53
+ copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including communication on
56
+ electronic mailing lists, source code control systems, and issue
57
+ tracking systems that are managed by, or on behalf of, the Licensor
58
+ for the purpose of discussing and improving the Work, but excluding
59
+ communication that is conspicuously marked or otherwise designated
60
+ in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of, publicly
70
+ display, publicly perform, sublicense, and distribute the Work and
71
+ such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable by
79
+ such Contributor that are necessarily infringed by their Contribution(s)
80
+ alone or by combination of their Contribution(s) with the Work to
81
+ which such Contribution(s) was submitted. If You institute patent
82
+ litigation against any entity (including a cross-claim or counterclaim)
83
+ alleging that the Work or a Contribution incorporated within the Work
84
+ constitutes direct or contributory patent infringement, then any patent
85
+ licenses granted to You under this License for that Work shall
86
+ terminate as of the date such litigation is filed.
87
+
88
+ 4. Redistribution. You may reproduce and distribute copies of the Work
89
+ or Derivative Works thereof in any medium, with or without
90
+ modifications, and in Source or Object form, provided that You meet
91
+ the following conditions:
92
+
93
+ (a) You must give any other recipients of the Work or Derivative Works
94
+ a copy of this License; and
95
+
96
+ (b) You must cause any modified files to carry prominent notices
97
+ stating that You changed the files; and
98
+
99
+ (c) You must retain, in the Source form of any Derivative Works that
100
+ You distribute, all copyright, patent, trademark, and attribution
101
+ notices from the Source form of the Work, excluding those notices
102
+ that do not pertain to any part of the Derivative Works; and
103
+
104
+ (d) If the Work includes a "NOTICE" text file as part of its
105
+ distribution, then any Derivative Works that You distribute must
106
+ include a readable copy of the attribution notices contained within
107
+ such NOTICE file, excluding those notices that do not pertain to any
108
+ part of the Derivative Works, in at least one of the following places:
109
+ within a NOTICE text file distributed as part of the Derivative Works;
110
+ within the Source form or documentation, if provided along with the
111
+ Derivative Works; or, within a display generated by the Derivative Works,
112
+ if and wherever such third-party notices normally appear. The contents
113
+ of the NOTICE file are for informational purposes only and do not
114
+ modify the License. You may add Your own attribution notices within
115
+ Derivative Works that You distribute, alongside or as an addendum to
116
+ the NOTICE text from the Work, provided that such additional
117
+ attribution notices cannot be construed as modifying the License.
118
+
119
+ You may add Your own copyright statement to Your modifications and
120
+ may provide additional or different license terms and conditions for
121
+ use, reproduction, or distribution of Your modifications, or for any
122
+ such Derivative Works as a whole, provided Your use, reproduction,
123
+ and distribution of the Work otherwise complies with the conditions
124
+ stated in this License.
125
+
126
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
127
+ any Contribution intentionally submitted for inclusion in the Work to
128
+ the Licensor shall be under the terms and conditions of this License,
129
+ without any additional terms or conditions. Notwithstanding the above,
130
+ nothing herein shall supersede or modify the terms of any separate
131
+ license agreement you may have executed with Licensor regarding such
132
+ Contributions.
133
+
134
+ 6. Trademarks. This License does not grant permission to use the trade
135
+ names, trademarks, service marks, or product names of the Licensor,
136
+ except as required for reasonable and customary use in describing the
137
+ origin of the Work and reproducing the content of the NOTICE file.
138
+
139
+ 7. Disclaimer of Warranty. Unless required by applicable law or
140
+ agreed to in writing, Licensor provides the Work (and each Contributor
141
+ provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES
142
+ OR CONDITIONS OF ANY KIND, either express or implied, including,
143
+ without limitation, any warranties or conditions of TITLE,
144
+ NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR
145
+ PURPOSE. You are solely responsible for determining the
146
+ appropriateness of using or redistributing the Work and assume any
147
+ risks associated with Your exercise of permissions under this License.
148
+
149
+ 8. Limitation of Liability. In no event and under no legal theory,
150
+ whether in tort (including negligence), contract, or otherwise,
151
+ unless required by applicable law (such as deliberate and grossly
152
+ negligent acts) or agreed to in writing, shall any Contributor be
153
+ liable to You for damages, including any direct, indirect, special,
154
+ incidental, or consequential damages of any character arising as a
155
+ result of this License or out of the use or inability to use the Work
156
+ (including but not limited to damages for loss of goodwill, work
157
+ stoppage, computer failure or malfunction, or any and all other
158
+ commercial damages or losses), even if such Contributor has been
159
+ advised of the possibility of such damages.
160
+
161
+ 9. Accepting Warranty or Additional Liability. While redistributing
162
+ the Work or Derivative Works thereof, You may choose to offer, and
163
+ charge a fee for, acceptance of support, warranty, indemnity, or
164
+ other liability obligations and/or rights consistent with this License.
165
+ However, in accepting such obligations, You may act only on Your own
166
+ behalf and on Your sole responsibility, not on behalf of any other
167
+ Contributor, and only if You agree to indemnify, defend, and hold each
168
+ Contributor harmless for any liability incurred by, or claims asserted
169
+ against, such Contributor by reason of your accepting any such
170
+ warranty or additional liability.
171
+
172
+ END OF TERMS AND CONDITIONS
173
+
174
+ APPENDIX: How to apply the Apache License to your work.
175
+
176
+ To apply the Apache License to your work, attach the following
177
+ boilerplate notice, with the fields enclosed by brackets "[]" replaced
178
+ with your own identifying information. (Don't include the brackets!)
179
+ The text should be enclosed in the appropriate comment syntax for the
180
+ file format. We also recommend that a file or class name and
181
+ description of purpose be included on the same "printed page" as the
182
+ copyright notice for easier identification within third-party archives.
183
+
184
+ Copyright [yyyy] [name of copyright owner]
185
+
186
+ Licensed under the Apache License, Version 2.0 (the "License");
187
+ you may not use this file except in compliance with the License.
188
+ You may obtain a copy of the License at
189
+
190
+ http://www.apache.org/licenses/LICENSE-2.0
191
+
192
+ Unless required by applicable law or agreed to in writing, software
193
+ distributed under the License is distributed on an "AS IS" BASIS,
194
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
195
+ See the License for the specific language governing permissions and
196
+ limitations under the License.
pipsutra-0.1.0/NOTICE ADDED
@@ -0,0 +1,5 @@
1
+ PipSutra
2
+ Copyright 2026 Nikhil Mutreja
3
+
4
+ PipSutra is developed by Nikhil Mutreja and distributed under the Apache
5
+ License, Version 2.0. See the LICENSE file for the complete license text.