pkgdx 0.5.0__py3-none-any.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.
- pkgdx/__init__.py +17 -0
- pkgdx/__main__.py +207 -0
- pkgdx/_core.py +649 -0
- pkgdx/_types.py +111 -0
- pkgdx/exceptions.py +37 -0
- pkgdx/logging/__init__.py +15 -0
- pkgdx/logging/_logging.py +49 -0
- pkgdx/logging/config.toml +48 -0
- pkgdx/py.typed +0 -0
- pkgdx/standards/__init__.py +182 -0
- pkgdx/standards/_cli.py +380 -0
- pkgdx/standards/_hooks.py +53 -0
- pkgdx/standards/hooks.toml +50 -0
- pkgdx/standards/mypy.ini +44 -0
- pkgdx/standards/pymarkdown.toml +9 -0
- pkgdx/standards/ruff.toml +57 -0
- pkgdx-0.5.0.dist-info/METADATA +277 -0
- pkgdx-0.5.0.dist-info/RECORD +22 -0
- pkgdx-0.5.0.dist-info/WHEEL +4 -0
- pkgdx-0.5.0.dist-info/entry_points.txt +7 -0
- pkgdx-0.5.0.dist-info/licenses/COPYRIGHT +15 -0
- pkgdx-0.5.0.dist-info/licenses/LICENSE +201 -0
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: pkgdx
|
|
3
|
+
Version: 0.5.0
|
|
4
|
+
Summary: A package to centralise standards across Python projects.
|
|
5
|
+
Project-URL: Documentation, https://gitlab.com/andyrids/pkgdx/blob/main/README.md
|
|
6
|
+
Project-URL: Repository, https://gitlab.com/andyrids/pkgdx
|
|
7
|
+
Project-URL: Issues, https://gitlab.com/andyrids/pkgdx/issues
|
|
8
|
+
Project-URL: Changelog, https://gitlab.com/andyrids/pkgdx/blob/main/CHANGELOG.md
|
|
9
|
+
Author-email: Andrew Ridyard <andyrids.culprit320@passmail.com>
|
|
10
|
+
Maintainer-email: Andrew Ridyard <andyrids.culprit320@passmail.com>
|
|
11
|
+
License-Expression: Apache-2.0
|
|
12
|
+
License-File: COPYRIGHT
|
|
13
|
+
License-File: LICENSE
|
|
14
|
+
Keywords: CLI,DevEx,linting,pre-commit,typing
|
|
15
|
+
Classifier: Development Status :: 4 - Beta
|
|
16
|
+
Classifier: Intended Audience :: Developers
|
|
17
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
22
|
+
Classifier: Typing :: Typed
|
|
23
|
+
Requires-Python: >=3.11
|
|
24
|
+
Requires-Dist: detect-secrets>=1.5.0
|
|
25
|
+
Requires-Dist: mypy>=2.1.0
|
|
26
|
+
Requires-Dist: prek~=0.4.8
|
|
27
|
+
Requires-Dist: pymarkdownlnt>=0.9.37
|
|
28
|
+
Requires-Dist: rich>=15.0.0
|
|
29
|
+
Requires-Dist: ruff>=0.15.20
|
|
30
|
+
Requires-Dist: tomlkit>=0.15.0
|
|
31
|
+
Description-Content-Type: text/markdown
|
|
32
|
+
|
|
33
|
+
# Package Developer Experience (DX) Toolkit [`Pkgdx`]
|
|
34
|
+
|
|
35
|
+
I created `pkgdx` as a way to improve DX for my Python projects. The package is installed as
|
|
36
|
+
as a development dependency, providing a command-line interface (CLI) for canonical standards
|
|
37
|
+
configuration.
|
|
38
|
+
|
|
39
|
+
## Overview
|
|
40
|
+
|
|
41
|
+
`pkgdx` centralises creation and implementation of coding standards across projects, providing a
|
|
42
|
+
single source of truth for toolchain configuration:
|
|
43
|
+
|
|
44
|
+
1. Mypy (Python static type checking)
|
|
45
|
+
2. Ruff (Python linting & formatting)
|
|
46
|
+
3. PyMarkdown (Markdown linting)
|
|
47
|
+
4. detect-secrets (secret detection)
|
|
48
|
+
5. Prek (hook framework)
|
|
49
|
+
|
|
50
|
+
## Quick start
|
|
51
|
+
|
|
52
|
+
1. Run `uv add --dev pkgdx` for a consuming project
|
|
53
|
+
2. Run `uv run pkgdx init` to configure hooks and install Git shims
|
|
54
|
+
3. Run `uv run pkgdx config --export` to export toolchain config files
|
|
55
|
+
|
|
56
|
+
The config files; `hooks.toml`, `mypy.ini`, `pymarkdown.toml` and `ruff.toml` are exported to
|
|
57
|
+
`$PKGDX_CONFIG_DIR` | `%APPDATA%/pkgdx` | `$XDG_CONFIG_HOME/pkgdx` | `~/.config/pkgdx`.
|
|
58
|
+
|
|
59
|
+
1. Modify these files to maintain a new global canonical standards config
|
|
60
|
+
2. Delete a file to revert to the repsective, bundled config
|
|
61
|
+
3. Run `uv run pkgdx config` to check config detection and location
|
|
62
|
+
|
|
63
|
+
To quickly demo `pkgdx`, clone this repository, cd into `./pkgdx/` and run the command below:
|
|
64
|
+
|
|
65
|
+
```sh
|
|
66
|
+
just consumer-demo
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
> [!IMPORTANT]
|
|
70
|
+
> Use `uvx rust-just consumer-demo` if [Just](https://just.systems/man/en/) command runner
|
|
71
|
+
> is not installed.
|
|
72
|
+
|
|
73
|
+

|
|
74
|
+
|
|
75
|
+
Further installation and setup guidance is available below.
|
|
76
|
+
|
|
77
|
+
## Why?
|
|
78
|
+
|
|
79
|
+
Other methods of maintaining standards include templating tools like `Cookiecutter` or `Copier`,
|
|
80
|
+
which inject configurations directly into the project `pyproject.toml` and/or root directory.
|
|
81
|
+
|
|
82
|
+
`pkgdx` automates the implementation of a common standard through pre-commit hooks and CI/CD,
|
|
83
|
+
removing the need for extensive `pyproject.toml` boilerplate.
|
|
84
|
+
|
|
85
|
+
> [!TIP]
|
|
86
|
+
> `pkgdx` compliments project templating tools - it does not replace them.
|
|
87
|
+
|
|
88
|
+
## How?
|
|
89
|
+
|
|
90
|
+
Configuration files and CLI are contained in the `standards/` subpackage and developments tools
|
|
91
|
+
have console scripts (`[project.scripts]`) and pre-commit hooks (`.pre-commit-hooks.yaml`), which
|
|
92
|
+
are installed through the CLI via Prek.
|
|
93
|
+
|
|
94
|
+
> [!NOTE]
|
|
95
|
+
> [`Prek`](https://prek.j178.dev/) is a Rust-based, drop-in replacement for
|
|
96
|
+
> [`pre-commit`](https://pre-commit.com/) that maintains compatibility with
|
|
97
|
+
> any existing `.pre-commit-config.yaml`.
|
|
98
|
+
|
|
99
|
+
When Prek runs a hook (e.g. `pkgdx-lint`), the CLI intercepts the command and executes the
|
|
100
|
+
corresponding tool with a bundled configuration.
|
|
101
|
+
|
|
102
|
+
As `pkgdx` is versioned and tagged, updates can be implemented across all projects via standard
|
|
103
|
+
dependency updates and `prek update` command.
|
|
104
|
+
|
|
105
|
+
Consuming projects can add project-specific requirements to the `pyproject.toml`, which can be
|
|
106
|
+
implemented through commands such as `uv run mypy`.
|
|
107
|
+
|
|
108
|
+
To apply the canonical standards to a project, run the `init` command:
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
uv run pkgdx init
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
To see verbose logging output, use the `--debug` or `-d` option:
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
uv run pkgdx -d init
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
To overwrite or reset an existing `prek.toml` in the project root, use the `--reset` option:
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
uv run pkgdx init --reset
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
To see which configuration file each hook uses, run the `config` command. See
|
|
127
|
+
[Adopting your own standards](#adopting-your-own-standards-external-users).
|
|
128
|
+
|
|
129
|
+
```bash
|
|
130
|
+
uv run pkgdx config
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
## Installation
|
|
134
|
+
|
|
135
|
+
This project is hosted on GitLab and each release is published to PyPI and the GitLab project
|
|
136
|
+
Package Registry. The project is also mirrored on GitHub.
|
|
137
|
+
|
|
138
|
+
> [!NOTE]
|
|
139
|
+
> Pkgdx installation is package-manager agnostic. Use another manager like Poetry and replace the
|
|
140
|
+
> `uv run` accordingly or omit entirely, with an activated virtual environment.
|
|
141
|
+
|
|
142
|
+
### PyPI
|
|
143
|
+
|
|
144
|
+
```bash
|
|
145
|
+
uv add --dev pkgdx
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
### Package registry
|
|
149
|
+
|
|
150
|
+
```bash
|
|
151
|
+
uv add pkgdx --dev --index gitlab=https://gitlab.com/api/v4/projects/82928123/packages/pypi/simple
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
### Project URL
|
|
155
|
+
|
|
156
|
+
```bash
|
|
157
|
+
uv add --dev git+https://gitlab.com/andyrids/pkgdx.git
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
```bash
|
|
161
|
+
uv add --dev git+https://gitlab.com/andyrids/pkgdx.git@v0.5.0
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
## CI/CD integration
|
|
165
|
+
|
|
166
|
+
Pkgdx can be included in GitLab/Github CI/CD pipelines to enforce centralised standards without
|
|
167
|
+
heavy boilerplate across each CI/CD YAML config.
|
|
168
|
+
|
|
169
|
+
> [!TIP]
|
|
170
|
+
> See `ruff-lint-job` in the project
|
|
171
|
+
> [.gitlab-ci.yml](https://gitlab.com/andyrids/pkgdx/-/blob/main/.gitlab-ci.yml) for an example.
|
|
172
|
+
|
|
173
|
+
## Adopting your own standards (external users)
|
|
174
|
+
|
|
175
|
+
`pkgdx` ships bundled canonical standards. To change them without forking, place your own files in a
|
|
176
|
+
user config directory. Forking remains an option for teams that want versioned, tagged standards
|
|
177
|
+
(see [Fork the repo](#fork-the-repo-alternative-for-teams)).
|
|
178
|
+
|
|
179
|
+
### (1) Know where the user config directory is
|
|
180
|
+
|
|
181
|
+
`pkgdx` looks for the user config directory in this order:
|
|
182
|
+
|
|
183
|
+
1. The directory named by the `PKGDX_CONFIG_DIR` environment variable, if it is set and non-empty.
|
|
184
|
+
2. The platform default:
|
|
185
|
+
- Windows: `%APPDATA%\pkgdx`
|
|
186
|
+
- Linux, macOS and other OSes: `$XDG_CONFIG_HOME/pkgdx` if `XDG_CONFIG_HOME` is an absolute
|
|
187
|
+
path, otherwise `~/.config/pkgdx`
|
|
188
|
+
|
|
189
|
+
If `PKGDX_CONFIG_DIR` is set but is not an existing directory, the lint, format, typing and markdown
|
|
190
|
+
hooks, `pkgdx init` and `pkgdx config` fail with exit code 1 and a single error message without a
|
|
191
|
+
traceback. A missing platform directory is normal and is ignored.
|
|
192
|
+
|
|
193
|
+
### (2) Add your configuration files
|
|
194
|
+
|
|
195
|
+
Place any of these files in the user config directory:
|
|
196
|
+
|
|
197
|
+
- `ruff.toml` - Ruff linting & formatting rules
|
|
198
|
+
- `mypy.ini` - Mypy static typing rules
|
|
199
|
+
- `pymarkdown.toml` - PyMarkdown linting rules
|
|
200
|
+
- `hooks.toml` - Prek config template
|
|
201
|
+
|
|
202
|
+
Each file is chosen independently. If the user config directory holds a file with one of these
|
|
203
|
+
names, `pkgdx` uses it; otherwise it uses the bundled file. A directory holding only `ruff.toml`
|
|
204
|
+
overrides Ruff and nothing else.
|
|
205
|
+
|
|
206
|
+
detect-secrets has no configuration file, so it always uses its bundled settings.
|
|
207
|
+
|
|
208
|
+
> [!IMPORTANT]
|
|
209
|
+
> `hooks.toml` affects only `pkgdx init`, which uses it to write the `prek.toml` template. A
|
|
210
|
+
> `prek.toml` that was already copied keeps its old hooks. After upgrading `pkgdx` or changing
|
|
211
|
+
> `hooks.toml`, refresh the copy with `uv run pkgdx init --reset`.
|
|
212
|
+
|
|
213
|
+
### (3) Check and seed with `pkgdx config`
|
|
214
|
+
|
|
215
|
+
```bash
|
|
216
|
+
uv run pkgdx config
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
This prints one row per file on standard output: its name, its source (`user` or `bundled`) and
|
|
220
|
+
its resolved path. A summary line on standard error names the user config directory and whether
|
|
221
|
+
`PKGDX_CONFIG_DIR` set it.
|
|
222
|
+
|
|
223
|
+
To start from the bundled files, export them into the user config directory:
|
|
224
|
+
|
|
225
|
+
```bash
|
|
226
|
+
uv run pkgdx config --export
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
`--export` creates the platform directory if needed, copies each bundled file that is missing and
|
|
230
|
+
never overwrites an existing file. It prints one line per file, `created` or `unchanged`, in the
|
|
231
|
+
same format as `pkgdx init`.
|
|
232
|
+
|
|
233
|
+
### (4) CI & team parity
|
|
234
|
+
|
|
235
|
+
The user config directory lives on your machine. Without further action, CI and collaborators fall
|
|
236
|
+
back to the bundled config, so results can differ between local runs and pipelines.
|
|
237
|
+
|
|
238
|
+
Recommended pattern:
|
|
239
|
+
|
|
240
|
+
1. Keep the four files in your own standards Git repository.
|
|
241
|
+
2. Clone that repository locally and either use it as the user config directory or point
|
|
242
|
+
`PKGDX_CONFIG_DIR` at it.
|
|
243
|
+
3. In CI, clone the same repository and export `PKGDX_CONFIG_DIR` to the clone.
|
|
244
|
+
|
|
245
|
+
```yaml
|
|
246
|
+
lint-job:
|
|
247
|
+
variables:
|
|
248
|
+
PKGDX_CONFIG_DIR: $CI_PROJECT_DIR/.pkgdx-standards
|
|
249
|
+
before_script:
|
|
250
|
+
- git clone --depth 1 https://gitlab.com/your-group/your-standards.git "$PKGDX_CONFIG_DIR"
|
|
251
|
+
script:
|
|
252
|
+
- uv run pkgdx-lint-hook
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
Alternative: commit the four files to each project (for example in `.pkgdx/`) and set
|
|
256
|
+
`PKGDX_CONFIG_DIR=.pkgdx`. A relative path is resolved against the working directory.
|
|
257
|
+
|
|
258
|
+
### Fork the repo (alternative for teams)
|
|
259
|
+
|
|
260
|
+
Use a fork when you want standards that are versioned and released with the package.
|
|
261
|
+
|
|
262
|
+
1. Fork the repo to your own namespace.
|
|
263
|
+
2. Modify the files in `src/pkgdx/standards/` (`mypy.ini`, `pymarkdown.toml`, `ruff.toml` and
|
|
264
|
+
`hooks.toml`).
|
|
265
|
+
3. In `src/pkgdx/standards/hooks.toml`, change the `repo` value from
|
|
266
|
+
`"https://gitlab.com/andyrids/pkgdx"` to your forked repo URL, and set `rev` to the tag you
|
|
267
|
+
will create.
|
|
268
|
+
4. Tag a new release. The CI/CD pipeline builds and publishes the package to your Package
|
|
269
|
+
Registry, which you can install as a dev dependency via the repo URL or Package Registry URL.
|
|
270
|
+
5. The `publish-pypi-job` uploads to PyPI from protected `v*` tags only. To publish your fork
|
|
271
|
+
there, rename the package and register your own PyPI trusted publisher; otherwise delete the
|
|
272
|
+
job.
|
|
273
|
+
|
|
274
|
+
## Contribution
|
|
275
|
+
|
|
276
|
+
Contributions are welcome and these should be made through the
|
|
277
|
+
[GitLab repository](https://gitlab.com/andyrids/pkgdx).
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
pkgdx/__init__.py,sha256=pmolI5GA6n4q2uEa97tb7MLevik8NfX_tjhM7RhMFow,414
|
|
2
|
+
pkgdx/__main__.py,sha256=cmThBQJU4gC1bINIBul3kb2NjhIqT0acPpftxL1JX-w,5504
|
|
3
|
+
pkgdx/_core.py,sha256=NWXSw1F7QrtNlw8iB2TlUkfCSQEIdCmsAFwAgOsxp7Y,20808
|
|
4
|
+
pkgdx/_types.py,sha256=KzlVAYWx0TmdMlz6ksxLsHNfhYmIGeTWtPVRbsxN8TU,3474
|
|
5
|
+
pkgdx/exceptions.py,sha256=_118fGmAG7F-XTXH4vIagaRWYmAD05hdfjxm4ay2qv4,889
|
|
6
|
+
pkgdx/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
7
|
+
pkgdx/logging/__init__.py,sha256=8pAXo_qLoK8kg_9QK4ZZTveYdbx_tnrsJt8fhnJijzQ,284
|
|
8
|
+
pkgdx/logging/_logging.py,sha256=GddBQatSCaOAJt75BbUgUQ4KPz8Xp9IWDBCwOiifUoc,1586
|
|
9
|
+
pkgdx/logging/config.toml,sha256=ndJxcHAIBTOuT44qFKEwa3poO4FGXB6kl7ZoVQeTIEo,1180
|
|
10
|
+
pkgdx/standards/__init__.py,sha256=XT9EnUalp3DD-KOZz3shf-JNQMZgos7H7fOWY7Upu9Y,4965
|
|
11
|
+
pkgdx/standards/_cli.py,sha256=8LZJwNluvchS8SC2VuYIc5peU5j2n-RKNRii0W8mIMg,11984
|
|
12
|
+
pkgdx/standards/_hooks.py,sha256=Oh02kpCYiLG_fNZpC17Osr5KUA2kkKk9bmGQNa4e66I,1733
|
|
13
|
+
pkgdx/standards/hooks.toml,sha256=SG_1jVUm28djB4qfniVY6OIx0uV_U715EJ8S757ShLQ,908
|
|
14
|
+
pkgdx/standards/mypy.ini,sha256=HseNuMZ0aPpfNSgmbsW1Td6Neq1r8l2Q9_eYiw_uefw,1179
|
|
15
|
+
pkgdx/standards/pymarkdown.toml,sha256=jAZimwPrMI7ZJLuMJ98NUQob_R8ntFs26J5XMiNrOYM,354
|
|
16
|
+
pkgdx/standards/ruff.toml,sha256=dSkaxnZL-AdNpr7gk8cvHANE8QS7m3cGNxO0SXHN5QA,2465
|
|
17
|
+
pkgdx-0.5.0.dist-info/METADATA,sha256=e_xtBVXaO4SC4FyiWvU_qu2EwmAI_P2XClrt0bVnqlI,10070
|
|
18
|
+
pkgdx-0.5.0.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
|
|
19
|
+
pkgdx-0.5.0.dist-info/entry_points.txt,sha256=KmXDSDD0LrwCiFrAWv7udAQbZ5CK_WPr2BML3uQ5PIg,287
|
|
20
|
+
pkgdx-0.5.0.dist-info/licenses/COPYRIGHT,sha256=3Rn0kwj7Lv-lSCYzAQ9syXnCrpsKzZ2IeISEGfasxv4,592
|
|
21
|
+
pkgdx-0.5.0.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
22
|
+
pkgdx-0.5.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
[console_scripts]
|
|
2
|
+
pkgdx = pkgdx.__main__:main
|
|
3
|
+
pkgdx-format-hook = pkgdx.__main__:ruff_format
|
|
4
|
+
pkgdx-lint-hook = pkgdx.__main__:ruff_lint
|
|
5
|
+
pkgdx-markdown-hook = pkgdx.__main__:pymarkdown_lint
|
|
6
|
+
pkgdx-secrets-hook = pkgdx.__main__:detect_secrets
|
|
7
|
+
pkgdx-typing-hook = pkgdx.__main__:mypy_typing
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
Copyright 2026 Andrew Ridyard
|
|
2
|
+
|
|
3
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
you may not use this file except in compliance with the License.
|
|
5
|
+
You may obtain a copy of the License at
|
|
6
|
+
|
|
7
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
|
|
9
|
+
Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
See the License for the specific language governing permissions and
|
|
13
|
+
limitations under the License.
|
|
14
|
+
|
|
15
|
+
SPDX-License-Identifier: Apache-2.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 [yyyy] [name of copyright owner]
|
|
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.
|