From 0526d6962fd1684324d4d3b02ffa5e173f1b0e59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mochol=C3=AD?= Date: Fri, 2 Sep 2022 22:26:37 +0200 Subject: [PATCH] lightning_tools -> lightning_utilities --- .github/workflows/ci-testing.yml | 4 ++-- .github/workflows/ci-use-checks.yml | 2 +- MANIFEST.in | 2 +- Makefile | 4 ++-- README.md | 14 +++++++------- docs/source/conf.py | 16 ++++++++-------- setup.cfg | 4 ++-- setup.py | 4 ++-- .../__about__.py | 0 .../__init__.py | 2 +- .../__main__.py | 2 +- .../dependencies.py | 0 .../imports.py | 0 tests/unittests/test_dependencies.py | 2 +- tests/unittests/test_imports.py | 2 +- 15 files changed, 29 insertions(+), 29 deletions(-) rename src/{lightning_tools => lightning_utilities}/__about__.py (100%) rename src/{lightning_tools => lightning_utilities}/__init__.py (66%) rename src/{lightning_tools => lightning_utilities}/__main__.py (74%) rename src/{lightning_tools => lightning_utilities}/dependencies.py (100%) rename src/{lightning_tools => lightning_utilities}/imports.py (100%) diff --git a/.github/workflows/ci-testing.yml b/.github/workflows/ci-testing.yml index d77fb41a..2df1f2f2 100644 --- a/.github/workflows/ci-testing.yml +++ b/.github/workflows/ci-testing.yml @@ -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: @@ -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 diff --git a/.github/workflows/ci-use-checks.yml b/.github/workflows/ci-use-checks.yml index 5f6e8084..b85d5368 100644 --- a/.github/workflows/ci-use-checks.yml +++ b/.github/workflows/ci-use-checks.yml @@ -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: diff --git a/MANIFEST.in b/MANIFEST.in index e56448a5..2d28fd3a 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -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 diff --git a/Makefile b/Makefile index 161b4275..68caca32 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/README.md b/README.md index bf3dfcda..f4e048b8 100644 --- a/README.md +++ b/README.md @@ -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 @@ -71,7 +71,7 @@ pip install https://github.com/Lightning-AI/utilities/archive/refs/heads/main.zi From pypi: ```bash -pip install lightning_tools +pip install lightning_utilities ``` @@ -79,7 +79,7 @@ pip install lightning_tools __Usage:__ ```bash -python -m lightning_tools [group] [command] +python -m lightning_utilities [group] [command] ```
@@ -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 diff --git a/docs/source/conf.py b/docs/source/conf.py index afa01ea3..33fa950b 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -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, "..", "..")) @@ -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 # ---------------------------------- @@ -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, @@ -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", ), ] diff --git a/setup.cfg b/setup.cfg index 2074dc81..d010c5bb 100644 --- a/setup.cfg +++ b/setup.cfg @@ -41,7 +41,7 @@ description_file = README.md [isort] known_first_party = - lightning_tools + lightning_utilities tests line_length = 120 order_by_type = False @@ -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 diff --git a/setup.py b/setup.py index 1c88c03f..2cfebe68 100755 --- a/setup.py +++ b/setup.py @@ -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) @@ -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__, diff --git a/src/lightning_tools/__about__.py b/src/lightning_utilities/__about__.py similarity index 100% rename from src/lightning_tools/__about__.py rename to src/lightning_utilities/__about__.py diff --git a/src/lightning_tools/__init__.py b/src/lightning_utilities/__init__.py similarity index 66% rename from src/lightning_tools/__init__.py rename to src/lightning_utilities/__init__.py index f3be2f68..971a499a 100644 --- a/src/lightning_tools/__init__.py +++ b/src/lightning_utilities/__init__.py @@ -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) diff --git a/src/lightning_tools/__main__.py b/src/lightning_utilities/__main__.py similarity index 74% rename from src/lightning_tools/__main__.py rename to src/lightning_utilities/__main__.py index 09e0556b..7c73b118 100644 --- a/src/lightning_tools/__main__.py +++ b/src/lightning_utilities/__main__.py @@ -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: diff --git a/src/lightning_tools/dependencies.py b/src/lightning_utilities/dependencies.py similarity index 100% rename from src/lightning_tools/dependencies.py rename to src/lightning_utilities/dependencies.py diff --git a/src/lightning_tools/imports.py b/src/lightning_utilities/imports.py similarity index 100% rename from src/lightning_tools/imports.py rename to src/lightning_utilities/imports.py diff --git a/tests/unittests/test_dependencies.py b/tests/unittests/test_dependencies.py index 8eb3bdf9..0e24bcd7 100644 --- a/tests/unittests/test_dependencies.py +++ b/tests/unittests/test_dependencies.py @@ -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 diff --git a/tests/unittests/test_imports.py b/tests/unittests/test_imports.py index 6934cf77..a62ff969 100644 --- a/tests/unittests/test_imports.py +++ b/tests/unittests/test_imports.py @@ -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():