|
Metadata-Version: 2.4 |
|
Name: lightning-utilities |
|
Version: 0.14.3 |
|
Summary: Lightning toolbox for across the our ecosystem. |
|
Home-page: https://github.com/Lightning-AI/utilities |
|
Download-URL: https://github.com/Lightning-AI/utilities |
|
Author: Lightning AI et al. |
|
Author-email: pytorch@lightning.ai |
|
License: Apache-2.0 |
|
Project-URL: Bug Tracker, https://github.com/Lightning-AI/utilities/issues |
|
Project-URL: Documentation, https://dev-toolbox.rtfd.io/en/latest/ |
|
Project-URL: Source Code, https://github.com/Lightning-AI/utilities |
|
Keywords: Utilities,DevOps,CI/CD |
|
Classifier: Environment :: Console |
|
Classifier: Natural Language :: English |
|
Classifier: Development Status :: 3 - Alpha |
|
Classifier: Intended Audience :: Developers |
|
Classifier: Operating System :: OS Independent |
|
Classifier: Programming Language :: Python :: 3 |
|
Classifier: Programming Language :: Python :: 3.8 |
|
Classifier: Programming Language :: Python :: 3.9 |
|
Classifier: Programming Language :: Python :: 3.10 |
|
Classifier: Programming Language :: Python :: 3.11 |
|
Classifier: Programming Language :: Python :: 3.12 |
|
Classifier: Programming Language :: Python :: 3.13 |
|
Requires-Python: >=3.9 |
|
Description-Content-Type: text/markdown |
|
License-File: LICENSE |
|
Requires-Dist: importlib-metadata>=4.0.0; python_version < "3.8" |
|
Requires-Dist: packaging>=17.1 |
|
Requires-Dist: setuptools |
|
Requires-Dist: typing_extensions |
|
Provides-Extra: typing |
|
Requires-Dist: mypy>=1.0.0; extra == "typing" |
|
Requires-Dist: types-setuptools; extra == "typing" |
|
Requires-Dist: fire; extra == "typing" |
|
Provides-Extra: cli |
|
Requires-Dist: fire; extra == "cli" |
|
Provides-Extra: docs |
|
Requires-Dist: requests>=2.0.0; extra == "docs" |
|
Dynamic: author |
|
Dynamic: author-email |
|
Dynamic: classifier |
|
Dynamic: description |
|
Dynamic: description-content-type |
|
Dynamic: download-url |
|
Dynamic: home-page |
|
Dynamic: keywords |
|
Dynamic: license |
|
Dynamic: license-file |
|
Dynamic: project-url |
|
Dynamic: provides-extra |
|
Dynamic: requires-dist |
|
Dynamic: requires-python |
|
Dynamic: summary |
|
|
|
|
|
|
|
[](https://badge.fury.io/py/lightning-utilities) |
|
[](https://github.com/Lightning-AI/utilities/blob/master/LICENSE) |
|
[](https://pepy.tech/project/lightning-utilities) |
|
[](https://pypi.org/project/lightning-utilities/) |
|
|
|
[](https://github.com/Lightning-AI/utilities/actions/workflows/ci-testing.yml) |
|
[](https://github.com/Lightning-AI/utilities/actions/workflows/ci-use-checks.yaml) |
|
[](https://lit-utilities.readthedocs.io/en/latest/?badge=latest) |
|
[](https://results.pre-commit.ci/latest/github/Lightning-AI/utilities/main) |
|
|
|
__This repository covers the following use-cases:__ |
|
|
|
1. _Reusable GitHub workflows_ |
|
2. _Shared GitHub actions_ |
|
3. _General Python utilities in `lightning_utilities.core`_ |
|
4. _CLI `python -m lightning_utilities.cli --help`_ |
|
|
|
|
|
|
|
__Usage:__ |
|
|
|
```yaml |
|
name: Check schema |
|
|
|
on: [push] |
|
|
|
jobs: |
|
|
|
check-schema: |
|
uses: Lightning-AI/utilities/.github/workflows/check-schema.yml@v0.5.0 |
|
with: |
|
azure-dir: "" |
|
|
|
check-code: |
|
uses: Lightning-AI/utilities/.github/workflows/check-code.yml@main |
|
with: |
|
actions-ref: main |
|
``` |
|
|
|
See usage of other workflows in [.github/workflows/ci-use-checks.yaml](https://github.com/Lightning-AI/utilities/tree/main/.github/workflows/ci-use-checks.yaml). |
|
|
|
|
|
|
|
See available composite actions [.github/actions/](https://github.com/Lightning-AI/utilities/tree/main/.github/actions). |
|
|
|
__Usage:__ |
|
|
|
```yaml |
|
name: Do something with cache |
|
|
|
on: [push] |
|
|
|
jobs: |
|
pytest: |
|
runs-on: ubuntu-24.04 |
|
steps: |
|
- uses: actions/checkout@v3 |
|
- uses: actions/setup-python@v4 |
|
with: |
|
python-version: 3.9 |
|
- uses: Lightning-AI/utilities/.github/actions/cache |
|
with: |
|
python-version: 3.9 |
|
requires: oldest |
|
``` |
|
|
|
|
|
|
|
<details> |
|
<summary>Installation</summary> |
|
From source: |
|
|
|
```bash |
|
pip install https://github.com/Lightning-AI/utilities/archive/refs/heads/main.zip |
|
``` |
|
|
|
From pypi: |
|
|
|
```bash |
|
pip install lightning_utilities |
|
``` |
|
|
|
</details> |
|
|
|
__Usage:__ |
|
|
|
Example for optional imports: |
|
|
|
```python |
|
from lightning_utilities.core.imports import module_available |
|
|
|
if module_available("some_package.something"): |
|
from some_package import something |
|
``` |
|
|
|
|
|
|
|
The package provides common CLI commands. |
|
|
|
<details> |
|
<summary>Installation</summary> |
|
|
|
From pypi: |
|
|
|
```bash |
|
pip install lightning_utilities[cli] |
|
``` |
|
|
|
</details> |
|
|
|
__Usage:__ |
|
|
|
```bash |
|
python -m lightning_utilities.cli [group] [command] |
|
``` |
|
|
|
<details> |
|
<summary>Example for setting min versions</summary> |
|
|
|
```console |
|
$ cat requirements/test.txt |
|
coverage>=5.0 |
|
codecov>=2.1 |
|
pytest>=6.0 |
|
pytest-cov |
|
pytest-timeout |
|
$ python -m lightning_utilities.cli requirements set-oldest |
|
$ cat requirements/test.txt |
|
coverage==5.0 |
|
codecov==2.1 |
|
pytest==6.0 |
|
pytest-cov |
|
pytest-timeout |
|
``` |
|
|
|
</details> |
|
|