Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lightning_tools -> lightning_utilities #30

Merged
merged 1 commit into from
Sep 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
if: matrix.requires == 'oldest'
run: |
pip install -e .
python -m lightning_tools requirements set-oldest
python -m lightning_utilities requirements set-oldest

- uses: ./.github/actions/cache
with:
Expand All @@ -48,7 +48,7 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
pytorch-version: ${{ matrix.pytorch-version }}
pkg-name: "lightning_tools"
pkg-name: "lightning_utilities"
pytest-args: "--timeout=120"

- name: Upload coverage to Codecov
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-use-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
check-package:
uses: ./.github/workflows/check-package.yml
with:
import-name: "lightning_tools"
import-name: "lightning_utilities"
pypi-name: "lightning-tools"

check-docs:
Expand Down
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ recursive-exclude __pycache__ *.py[cod] *.orig

# Include the README and CHANGELOG
include *.md
recursive-include src/lightning_tools *.md
recursive-include src/lightning_utilities *.md

# Include the license file
include LICENSE
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ test:
# use this to run tests
rm -rf _ckpt_*
rm -rf ./lightning_logs
python -m coverage run --source src/lightning_tools -m pytest src/lightning_tools tests -v --flake8
python -m coverage run --source src/lightning_utilities -m pytest src/lightning_utilities tests -v --flake8
python -m coverage report

# specific file
# python -m coverage run --source src/lightning_tools -m pytest --flake8 --durations=0 -v -k
# python -m coverage run --source src/lightning_utilities -m pytest --flake8 --durations=0 -v -k

docs: clean
pip install -e . -q -r requirements/docs.txt
Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# Devtools
# Lightning Utilities

[![UnitTests](https://github.com/Lightning-AI/utilities/actions/workflows/ci-testing.yml/badge.svg?event=push)](https://github.com/Lightning-AI/utilities/actions/workflows/ci-testing.yml)
[![Apply checks](https://github.com/Lightning-AI/utilities/actions/workflows/ci-use-checks.yml/badge.svg?event=push)](https://github.com/Lightning-AI/utilities/actions/workflows/ci-use-checks.yml)
[![Documentation Status](https://readthedocs.org/projects/lightning_tools/badge/?version=latest)](https://lightning-tools.readthedocs.io/en/latest/?badge=latest)
[![Documentation Status](https://readthedocs.org/projects/lightning_utilities/badge/?version=latest)](https://lightning-tools.readthedocs.io/en/latest/?badge=latest)
[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/Lightning-AI/utilities/main.svg?badge_token=mqheL1-cTn-280Vx4cJUdg)](https://results.pre-commit.ci/latest/github/Lightning-AI/devtools/main?badge_token=mqheL1-cTn-280Vx4cJUdg)

__This repository covers the following use-cases:__

1. **GitHub workflows**
1. **GitHub actions**
1. **CLI `lightning_tools`**
1. **General Python utilities**
1. **CLI `lightning_utilities.dev`**
1. **General Python utilities in `lightning_utilities.core`**

## 1. Reusable workflows

Expand Down Expand Up @@ -71,15 +71,15 @@ pip install https://github.com/Lightning-AI/utilities/archive/refs/heads/main.zi
From pypi:

```bash
pip install lightning_tools
pip install lightning_utilities
```

</details>

__Usage:__

```bash
python -m lightning_tools [group] [command]
python -m lightning_utilities [group] [command]
```

<details>
Expand All @@ -92,7 +92,7 @@ codecov>=2.1
pytest>=6.0
pytest-cov
pytest-timeout
$ python -m lightning_tools requirements set-oldest
$ python -m lightning_utilities requirements set-oldest
$ cat requirements/test.txt
coverage==5.0
codecov==2.1
Expand Down
16 changes: 8 additions & 8 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

import pt_lightning_sphinx_theme

import lightning_tools
import lightning_utilities

_PATH_HERE = os.path.abspath(os.path.dirname(__file__))
_PATH_ROOT = os.path.realpath(os.path.join(_PATH_HERE, "..", ".."))
Expand All @@ -28,13 +28,13 @@

# this name shall match the project name in Github as it is used for linking to code
project = "Lightning-Dev-Tools"
copyright = lightning_tools.__copyright__
author = lightning_tools.__author__
copyright = lightning_utilities.__copyright__
author = lightning_utilities.__author__

# The short X.Y version
version = lightning_tools.__version__
version = lightning_utilities.__version__
# The full version, including alpha/beta/rc tags
release = lightning_tools.__version__
release = lightning_utilities.__version__

# Options for the linkcode extension
# ----------------------------------
Expand Down Expand Up @@ -162,8 +162,8 @@ def _convert_markdown(path_in: str, path_out: str) -> None:
# documentation.

html_theme_options = {
"pytorch_project": lightning_tools.__homepage__,
"canonical_url": lightning_tools.__homepage__,
"pytorch_project": lightning_utilities.__homepage__,
"canonical_url": lightning_utilities.__homepage__,
"collapse_navigation": False,
"display_version": True,
"logo_only": False,
Expand Down Expand Up @@ -229,7 +229,7 @@ def _convert_markdown(path_in: str, path_out: str) -> None:
project + " Documentation",
author,
project,
lightning_tools.__docs__,
lightning_utilities.__docs__,
"Miscellaneous",
),
]
Expand Down
4 changes: 2 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ description_file = README.md

[isort]
known_first_party =
lightning_tools
lightning_utilities
tests
line_length = 120
order_by_type = False
Expand All @@ -53,6 +53,6 @@ include_trailing_comma = True
# Typing tests is low priority, but enabling type checking on the
# untyped test functions (using `--check-untyped-defs`) is still
# high-value because it helps test the typing.
files = src/lightning_tools
files = src/lightning_utilities
disallow_untyped_defs = True
ignore_missing_imports = True
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
_PATH_REQUIRE = os.path.join(_PATH_ROOT, "requirements")


def _load_py_module(fname, pkg="lightning_tools"):
def _load_py_module(fname, pkg="lightning_utilities"):
spec = spec_from_file_location(os.path.join(pkg, fname), os.path.join(_PATH_SOURCE, pkg, fname))
py = module_from_spec(spec)
spec.loader.exec_module(py)
Expand All @@ -25,7 +25,7 @@ def _load_py_module(fname, pkg="lightning_tools"):
readme = fp.read()

setup(
name="lightning_tools",
name="lightning_utilities",
version=about.__version__,
description=about.__docs__,
author=about.__author__,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import os

from lightning_tools.__about__ import * # noqa: F401, F403
from lightning_utilities.__about__ import * # noqa: F401, F403

_PACKAGE_ROOT = os.path.dirname(__file__)
_PROJECT_ROOT = os.path.dirname(_PACKAGE_ROOT)
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import fire

from lightning_tools.dependencies import prune_pkgs_in_requirements, replace_oldest_ver
from lightning_utilities.dependencies import prune_pkgs_in_requirements, replace_oldest_ver


def main() -> None:
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion tests/unittests/test_dependencies.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from pathlib import Path

from lightning_tools.dependencies import prune_pkgs_in_requirements, replace_oldest_ver
from lightning_utilities.dependencies import prune_pkgs_in_requirements, replace_oldest_ver

_PATH_ROOT = Path(__file__).parent.parent.parent

Expand Down
2 changes: 1 addition & 1 deletion tests/unittests/test_imports.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import operator

from lightning_tools.imports import compare_version, module_available, RequirementCache
from lightning_utilities.imports import compare_version, module_available, RequirementCache


def test_module_exists():
Expand Down