license-gate 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.
- license_gate-0.1.0/.gitignore +7 -0
- license_gate-0.1.0/LICENSE +201 -0
- license_gate-0.1.0/NOTICE +7 -0
- license_gate-0.1.0/PKG-INFO +311 -0
- license_gate-0.1.0/README.md +296 -0
- license_gate-0.1.0/examples/quick_start.sh +1 -0
- license_gate-0.1.0/examples/usage.sh +12 -0
- license_gate-0.1.0/pyproject.toml +71 -0
- license_gate-0.1.0/src/license_gate/AGENTS.md +17 -0
- license_gate-0.1.0/src/license_gate/__init__.py +329 -0
- license_gate-0.1.0/src/license_gate/_metadata.py +147 -0
- license_gate-0.1.0/src/license_gate/py.typed +0 -0
- license_gate-0.1.0/tests/test_plugin.py +201 -0
|
@@ -0,0 +1,201 @@
|
|
|
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
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising 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
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is 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
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the 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 but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated 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,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and 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
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [2025] [Jacob Stewart @ Swarmauri]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
|
@@ -0,0 +1,311 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: license-gate
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Check installed Python dependency licenses through pytest
|
|
5
|
+
Project-URL: Repository, https://github.com/groupsum/license-gate
|
|
6
|
+
Author-email: Jacob Stewart <jacob@swarmauri.com>
|
|
7
|
+
License-Expression: Apache-2.0
|
|
8
|
+
License-File: LICENSE
|
|
9
|
+
License-File: NOTICE
|
|
10
|
+
Requires-Python: <3.15,>=3.10
|
|
11
|
+
Requires-Dist: packaging>=24.2
|
|
12
|
+
Requires-Dist: pytest>=8
|
|
13
|
+
Requires-Dist: tomli>=2; python_version < '3.11'
|
|
14
|
+
Description-Content-Type: text/markdown
|
|
15
|
+
|
|
16
|
+
# license-gate
|
|
17
|
+
|
|
18
|
+
<!-- readme-standards:begin branding -->
|
|
19
|
+
<p align="center"><a href="https://github.com/groupsum/license-gate"><img src="https://github.com/groupsum/license-gate/blob/master/docs/assets/license-gate.png?raw=true" alt="License Gate logo" width="300"></a></p>
|
|
20
|
+
<p align="center"><strong>license-gate</strong></p>
|
|
21
|
+
<p align="center">Check installed Python dependency licenses through pytest</p>
|
|
22
|
+
<p align="center">
|
|
23
|
+
<a href="https://pypi.org/project/license-gate/"><img alt="pypi: license-gate unpublished" src="https://img.shields.io/static/v1?label=pypi&message=license-gate%20unpublished&labelColor=292421&color=805500"></a>
|
|
24
|
+
<a href="https://github.com/groupsum/license-gate/blob/master/pkgs/070-facade/license-gate/pyproject.toml"><img alt="Source version: 0.1.0" src="https://img.shields.io/static/v1?label=Source%20version&message=0.1.0&labelColor=292421&color=994525"></a>
|
|
25
|
+
<a href="https://github.com/groupsum/license-gate/blob/master/pkgs/070-facade/license-gate/pyproject.toml"><img alt="Python: >=3.10,<3.15" src="https://img.shields.io/static/v1?label=Python&message=%3E%3D3.10%2C%3C3.15&labelColor=292421&color=994525"></a>
|
|
26
|
+
<a href="https://github.com/groupsum/license-gate/blob/master/pkgs/070-facade/license-gate/pyproject.toml"><img alt="Layer: facade" src="https://img.shields.io/static/v1?label=Layer&message=facade&labelColor=292421&color=994525"></a>
|
|
27
|
+
<a href="https://github.com/groupsum/license-gate/blob/master/pkgs/070-facade/license-gate/README.md#lifecycle-and-migration"><img alt="Lifecycle: experimental" src="https://img.shields.io/static/v1?label=Lifecycle&message=experimental&labelColor=292421&color=67437E"></a>
|
|
28
|
+
<a href="https://github.com/groupsum/license-gate/blob/master/pkgs/070-facade/license-gate/LICENSE"><img alt="License: Apache-2.0" src="https://img.shields.io/static/v1?label=License&message=Apache-2.0&labelColor=292421&color=994525"></a>
|
|
29
|
+
<a href="https://github.com/groupsum/license-gate/blob/master/pkgs/070-facade/license-gate/NOTICE"><img alt="Notice: attribution" src="https://img.shields.io/static/v1?label=Notice&message=attribution&labelColor=292421&color=994525"></a>
|
|
30
|
+
</p>
|
|
31
|
+
<p align="center">
|
|
32
|
+
<a href="https://pypi.org/project/license-gate/"><img alt="pypi downloads: license-gate: unpublished" src="https://img.shields.io/static/v1?label=pypi%20downloads&message=license-gate%3A%20unpublished&labelColor=292421&color=805500"></a>
|
|
33
|
+
<a href="https://github.com/groupsum/license-gate/blob/master/pkgs/070-facade/license-gate/README.md"><img alt="README hits: license-gate" src="https://hits.sh/github.com/groupsum/license-gate/pkgs/070-facade/license-gate/README.md.svg?label=README%20hits&labelColor=292421&color=08704E"></a>
|
|
34
|
+
</p>
|
|
35
|
+
<p align="center">
|
|
36
|
+
<a href="https://github.com/groupsum/license-gate/actions/workflows/ci.yml"><img alt="README standards: CI gate" src="https://img.shields.io/static/v1?label=README%20standards&message=CI%20gate&labelColor=292421&color=67437E"></a>
|
|
37
|
+
<a href="https://github.com/groupsum/license-gate/actions/workflows/ci.yml"><img alt="Tests: repository CI" src="https://img.shields.io/static/v1?label=Tests&message=repository%20CI&labelColor=292421&color=67437E"></a>
|
|
38
|
+
<a href="https://github.com/groupsum/license-gate/blob/master/README.md#certification-status"><img alt="Certification: not certified" src="https://img.shields.io/static/v1?label=Certification&message=not%20certified&labelColor=292421&color=805500"></a>
|
|
39
|
+
<a href="https://github.com/groupsum/license-gate/blob/master/.ssot/registry.json"><img alt="Governance: repository policy" src="https://img.shields.io/static/v1?label=Governance&message=repository%20policy&labelColor=292421&color=67437E"></a>
|
|
40
|
+
<a href="https://github.com/groupsum/license-gate/actions/workflows/ci.yml"><img alt="Evidence: test suite" src="https://img.shields.io/static/v1?label=Evidence&message=test%20suite&labelColor=292421&color=67437E"></a>
|
|
41
|
+
</p>
|
|
42
|
+
<p align="center"><a href="#overview">Overview</a> · <a href="#installation">Installation</a> · <a href="#quick-start">Quick Start</a> · <a href="#usage">Usage</a> · <a href="#public-api-and-import-surfaces">API</a> · <a href="#contributing">Contributing</a> · <a href="#governance">Governance</a> · <a href="#license">License</a></p>
|
|
43
|
+
<!-- readme-standards:end branding -->
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## Overview
|
|
48
|
+
|
|
49
|
+
### Summary
|
|
50
|
+
|
|
51
|
+
License Gate audits the installed dependency graph of a Python distribution using pytest.
|
|
52
|
+
|
|
53
|
+
### Why This Package
|
|
54
|
+
|
|
55
|
+
A wheel can resolve different dependencies from an editable workspace. Running in the consumer environment checks the versions actually installed.
|
|
56
|
+
|
|
57
|
+
### When to Use
|
|
58
|
+
|
|
59
|
+
Run after installing the candidate distribution and its runtime dependencies in a clean environment.
|
|
60
|
+
|
|
61
|
+
### Features
|
|
62
|
+
|
|
63
|
+
Choose one case per dependency or a single aggregate result. Reports include dependency identities, versions and license metadata.
|
|
64
|
+
|
|
65
|
+
### Non-Goals
|
|
66
|
+
|
|
67
|
+
The scanner reads distribution metadata and bundled license files. Legal review and source-code license attribution remain separate tasks.
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
## Getting Started
|
|
72
|
+
|
|
73
|
+
### Prerequisites
|
|
74
|
+
|
|
75
|
+
Use a supported Python interpreter and install the distribution under review in the same environment as pytest.
|
|
76
|
+
|
|
77
|
+
### Installation
|
|
78
|
+
|
|
79
|
+
#### Install with uv
|
|
80
|
+
|
|
81
|
+
<!-- readme-standards:begin installation.uv -->
|
|
82
|
+
`license-gate` is not declared published. From the source checkout:
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
uv pip install .
|
|
86
|
+
```
|
|
87
|
+
<!-- readme-standards:end installation.uv -->
|
|
88
|
+
|
|
89
|
+
#### Install with pip
|
|
90
|
+
|
|
91
|
+
<!-- readme-standards:begin installation.pip -->
|
|
92
|
+
`license-gate` is not declared published. From the source checkout:
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
python -m pip install .
|
|
96
|
+
```
|
|
97
|
+
<!-- readme-standards:end installation.pip -->
|
|
98
|
+
|
|
99
|
+
#### Install with Poetry
|
|
100
|
+
|
|
101
|
+
<!-- readme-standards:begin installation.poetry -->
|
|
102
|
+
`license-gate` is not declared published. From a separate Poetry project, replace the path with your checkout:
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
poetry add /path/to/license-gate
|
|
106
|
+
```
|
|
107
|
+
<!-- readme-standards:end installation.poetry -->
|
|
108
|
+
|
|
109
|
+
### Quick Start
|
|
110
|
+
|
|
111
|
+
#### Example
|
|
112
|
+
|
|
113
|
+
<!-- readme-standards:begin example.quick-start -->
|
|
114
|
+
Source: [examples/quick_start.sh](https://github.com/groupsum/license-gate/blob/master/pkgs/070-facade/license-gate/examples/quick_start.sh).
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
pytest --pylicense-package=license-gate
|
|
118
|
+
```
|
|
119
|
+
<!-- readme-standards:end example.quick-start -->
|
|
120
|
+
|
|
121
|
+
#### Expected Result
|
|
122
|
+
|
|
123
|
+
The parameterized command produces pytest cases for installed dependencies. An unaccepted dependency with an unknown license fails the run.
|
|
124
|
+
|
|
125
|
+
---
|
|
126
|
+
|
|
127
|
+
## Usage
|
|
128
|
+
|
|
129
|
+
### Common Workflows
|
|
130
|
+
|
|
131
|
+
<!-- readme-standards:begin example.usage -->
|
|
132
|
+
Source: [examples/usage.sh](https://github.com/groupsum/license-gate/blob/master/pkgs/070-facade/license-gate/examples/usage.sh).
|
|
133
|
+
|
|
134
|
+
```bash
|
|
135
|
+
# Run with License Gate installed.
|
|
136
|
+
set -eu
|
|
137
|
+
workdir=$(mktemp -d)
|
|
138
|
+
trap 'rm -f "$workdir/pyproject.toml"; rmdir "$workdir"' EXIT
|
|
139
|
+
cat > "$workdir/pyproject.toml" <<'TOML'
|
|
140
|
+
[dependency-groups]
|
|
141
|
+
test = ["pytest>=8", "license-gate"]
|
|
142
|
+
|
|
143
|
+
[tool.pytest.ini_options]
|
|
144
|
+
addopts = "--pylicense-package=license-gate --pylicense-mode=aggregate"
|
|
145
|
+
TOML
|
|
146
|
+
pytest -p no:cacheprovider -c "$workdir/pyproject.toml" "$workdir"
|
|
147
|
+
```
|
|
148
|
+
<!-- readme-standards:end example.usage -->
|
|
149
|
+
|
|
150
|
+
### Configuration
|
|
151
|
+
|
|
152
|
+
Set pytest options in the consuming project as shown above. Replace the audit target with your installed distribution name. See the [pyproject.toml configuration guide](src/license_gate/AGENTS.md) for uv setup and isolated wheel checks.
|
|
153
|
+
|
|
154
|
+
Use `--pylicense-allow-list`, `--pylicense-disallow-list` and `--pylicense-accept-deps` to configure the audit.
|
|
155
|
+
|
|
156
|
+
### Error Handling
|
|
157
|
+
|
|
158
|
+
Inspect the dependency and version in the failed pytest case. Review its metadata before adding an exception.
|
|
159
|
+
|
|
160
|
+
### Best Practices
|
|
161
|
+
|
|
162
|
+
Record the reason for each accepted dependency and run the scan against a freshly installed wheel.
|
|
163
|
+
|
|
164
|
+
---
|
|
165
|
+
|
|
166
|
+
## Package Boundary
|
|
167
|
+
|
|
168
|
+
### What It Owns
|
|
169
|
+
|
|
170
|
+
The facade owns installed metadata discovery, license normalization, pytest collection and reporting.
|
|
171
|
+
|
|
172
|
+
### Public API and Import Surfaces
|
|
173
|
+
|
|
174
|
+
Pytest loads the `license_gate` entry point. Downstream policy plugins can call `license_gate.accept_dependencies(config, names)`.
|
|
175
|
+
|
|
176
|
+
### Entry Points
|
|
177
|
+
|
|
178
|
+
<!-- readme-standards:begin entry-points -->
|
|
179
|
+
- `pytest11` → `license_gate` → `license_gate`
|
|
180
|
+
<!-- readme-standards:end entry-points -->
|
|
181
|
+
|
|
182
|
+
### Injected Dependencies
|
|
183
|
+
|
|
184
|
+
Pytest supplies the session configuration. The scanner reads distributions from the active interpreter.
|
|
185
|
+
|
|
186
|
+
### Protocol Consumers
|
|
187
|
+
|
|
188
|
+
The downstream Swarmauri adapter extends dependency policy through the pytest configuration hook.
|
|
189
|
+
|
|
190
|
+
### Extensions
|
|
191
|
+
|
|
192
|
+
Keep organization-specific exemptions in downstream plugins or explicitly supplied policy.
|
|
193
|
+
|
|
194
|
+
---
|
|
195
|
+
|
|
196
|
+
## Operations and Readiness
|
|
197
|
+
|
|
198
|
+
### Operational Requirements
|
|
199
|
+
|
|
200
|
+
Run in an isolated environment where the selected distribution and its dependency closure are installed.
|
|
201
|
+
|
|
202
|
+
### Health and Observability
|
|
203
|
+
|
|
204
|
+
Pytest reports each failed dependency with its version. Aggregate mode groups failures into one result.
|
|
205
|
+
|
|
206
|
+
### Security and Resource Limits
|
|
207
|
+
|
|
208
|
+
Use trusted package artifacts and execution environments. The scan reads metadata locally.
|
|
209
|
+
|
|
210
|
+
### Compatibility
|
|
211
|
+
|
|
212
|
+
The facade declares Python 3.10 through 3.14. Workspace governance uses Python 3.12 or later within that range.
|
|
213
|
+
|
|
214
|
+
---
|
|
215
|
+
|
|
216
|
+
## Verification
|
|
217
|
+
|
|
218
|
+
### Tests
|
|
219
|
+
|
|
220
|
+
Run `uv run --locked --all-packages pytest tests pkgs --pylicense-package=license-gate` from the repository root.
|
|
221
|
+
|
|
222
|
+
### Certification Status
|
|
223
|
+
|
|
224
|
+
Release certification is pending the shared closure gates.
|
|
225
|
+
|
|
226
|
+
### Evidence
|
|
227
|
+
|
|
228
|
+
Run the SSOT-linked cases with `uv run --locked ssot spec run-tests . --id spc:1000` from the root.
|
|
229
|
+
|
|
230
|
+
---
|
|
231
|
+
|
|
232
|
+
## FAQ
|
|
233
|
+
|
|
234
|
+
### Why
|
|
235
|
+
|
|
236
|
+
The original implementation bundled Swarmauri exceptions with general license checks. The facade makes independent adoption possible.
|
|
237
|
+
|
|
238
|
+
### How
|
|
239
|
+
|
|
240
|
+
An installed wheel exposes the pytest entry point. The downstream adapter registers additional dependency names for its own session.
|
|
241
|
+
|
|
242
|
+
### When
|
|
243
|
+
|
|
244
|
+
Switch consumers after verifying publication and a clean installation of the new distribution.
|
|
245
|
+
|
|
246
|
+
---
|
|
247
|
+
|
|
248
|
+
## Documentation and Related Packages
|
|
249
|
+
|
|
250
|
+
### More Documentation
|
|
251
|
+
|
|
252
|
+
Use `pytest --help` in the installed environment to inspect the pylicense options.
|
|
253
|
+
|
|
254
|
+
### Related Packages
|
|
255
|
+
|
|
256
|
+
The Swarmauri SDK maintains the downstream `swarmauri-tests-pylicense` distribution.
|
|
257
|
+
|
|
258
|
+
### Project Links
|
|
259
|
+
|
|
260
|
+
<!-- readme-standards:begin project-links -->
|
|
261
|
+
- [Repository](https://github.com/groupsum/license-gate)
|
|
262
|
+
- [pypi: license-gate](https://pypi.org/project/license-gate/)
|
|
263
|
+
<!-- readme-standards:end project-links -->
|
|
264
|
+
|
|
265
|
+
---
|
|
266
|
+
|
|
267
|
+
## Contributing
|
|
268
|
+
|
|
269
|
+
### How to Contribute
|
|
270
|
+
|
|
271
|
+
Submit a pull request with a regression test covering the affected collection mode or metadata format.
|
|
272
|
+
|
|
273
|
+
### Development Setup
|
|
274
|
+
|
|
275
|
+
Run `uv sync --locked --all-packages` and use the root environment for pytest, Ruff and ty.
|
|
276
|
+
|
|
277
|
+
### Notes for Maintainers
|
|
278
|
+
|
|
279
|
+
Build the candidate using `uv build --package license-gate --no-sources` and verify the wheel outside the checkout.
|
|
280
|
+
|
|
281
|
+
---
|
|
282
|
+
|
|
283
|
+
## Governance
|
|
284
|
+
|
|
285
|
+
### Ownership and Decision Making
|
|
286
|
+
|
|
287
|
+
GroupSum maintains this repository. Changes to package behavior and governance go through review.
|
|
288
|
+
|
|
289
|
+
### Standards and Policies
|
|
290
|
+
|
|
291
|
+
The root index declares package ownership. The SSOT registry links governance requirements to executable tests.
|
|
292
|
+
|
|
293
|
+
### Lifecycle and Migration
|
|
294
|
+
|
|
295
|
+
The initial release retains the existing pylicense options and delegates Swarmauri-specific approvals to its downstream adapter.
|
|
296
|
+
|
|
297
|
+
---
|
|
298
|
+
|
|
299
|
+
## License and Attribution
|
|
300
|
+
|
|
301
|
+
### License
|
|
302
|
+
|
|
303
|
+
<!-- readme-standards:begin license -->
|
|
304
|
+
Licensed under `Apache-2.0`. See [LICENSE](https://github.com/groupsum/license-gate/blob/master/pkgs/070-facade/license-gate/LICENSE).
|
|
305
|
+
<!-- readme-standards:end license -->
|
|
306
|
+
|
|
307
|
+
### Notices
|
|
308
|
+
|
|
309
|
+
<!-- readme-standards:begin notices -->
|
|
310
|
+
See [NOTICE](https://github.com/groupsum/license-gate/blob/master/pkgs/070-facade/license-gate/NOTICE) for attribution.
|
|
311
|
+
<!-- readme-standards:end notices -->
|