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

pl-devtools -> lightning_tools #27

Merged
merged 1 commit into from
Sep 2, 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 pl_devtools requirements set-oldest
python -m lightning_tools 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: "pl_devtools"
pkg-name: "lightning_tools"
pytest-args: "--timeout=120"

- name: Upload coverage to Codecov
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci-use-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ jobs:
check-package:
uses: ./.github/workflows/check-package.yml
with:
import-name: "pl_devtools"
pypi-name: "lightning-devtools"
import-name: "lightning_tools"
pypi-name: "lightning-tools"

check-docs:
uses: ./.github/workflows/check-docs.yml
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/pl_devtools *.md
recursive-include src/lightning_tools *.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/pl_devtools -m pytest src/pl_devtools tests -v --flake8
python -m coverage run --source src/lightning_tools -m pytest src/lightning_tools tests -v --flake8
python -m coverage report

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

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

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The repo hasn't been renamed. I assumed this was the desired name

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, lets keep the repo name

Suggested change
[![UnitTests](https://github.com/Lightning-AI/lightning-tools/actions/workflows/ci-testing.yml/badge.svg?event=push)](https://github.com/Lightning-AI/lightning-tools/actions/workflows/ci-testing.yml)
[![UnitTests](https://github.com/Lightning-AI/devtools/actions/workflows/ci-testing.yml/badge.svg?event=push)](https://github.com/Lightning-AI/devtools/actions/workflows/ci-testing.yml)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in #29

[![Apply checks](https://github.com/Lightning-AI/lightning-tools/actions/workflows/ci-use-checks.yml/badge.svg?event=push)](https://github.com/Lightning-AI/lightning-tools/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)
[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/Lightning-AI/lightning-tools/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 `pl_devtools`**
1. **CLI `lightning_tools`**
1. **General Python utilities**

## 1. Reusable workflows
Expand All @@ -23,16 +23,16 @@ on: [push]

jobs:
check-schema:
uses: Lightning-AI/devtools/.github/workflows/check-schema.yml@main
uses: Lightning-AI/lightning-tools/.github/workflows/check-schema.yml@main
with:
azure-dir: ""
```

See usage of other workflows in [.github/workflows/ci_use-checks.yml](https://github.com/Lightning-AI/devtools/tree/main/.github/workflows/ci_use-checks.yml).
See usage of other workflows in [.github/workflows/ci_use-checks.yml](https://github.com/Lightning-AI/lightning-tools/tree/main/.github/workflows/ci_use-checks.yml).

## 2. Reusable composite actions

See available composite actions [.github/actions/](https://github.com/Lightning-AI/devtools/tree/main/.github/actions).
See available composite actions [.github/actions/](https://github.com/Lightning-AI/lightning-tools/tree/main/.github/actions).

__Usage:__

Expand All @@ -49,7 +49,7 @@ jobs:
- uses: actions/setup-python@v4
with:
python-version: 3.9
- uses: Lightning-AI/devtools/.github/actions/cache
- uses: Lightning-AI/lightning-tools/.github/actions/cache
with:
python-version: 3.9
requires: oldest
Expand All @@ -65,21 +65,21 @@ The package provides common CLI commands.
From source:

```bash
pip install https://github.com/Lightning-AI/devtools/archive/refs/heads/main.zip
pip install https://github.com/Lightning-AI/lightning-tools/archive/refs/heads/main.zip
```

From pypi:

```bash
pip install lightning-devtools
pip install lightning_tools
```

</details>

__Usage:__

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

<details>
Expand All @@ -92,7 +92,7 @@ codecov>=2.1
pytest>=6.0
pytest-cov
pytest-timeout
$ python -m pl_devtools requirements set-oldest
$ python -m lightning_tools requirements set-oldest
$ cat requirements/test.txt
coverage==5.0
codecov==2.1
Expand Down
12 changes: 6 additions & 6 deletions docs/source/_templates/theme_variables.jinja
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{%- set external_urls = {
'github': 'https://github.com/Lightning-AI/devtools',
'github_issues': 'https://github.com/Lightning-AI/devtools/issues',
'github': 'https://github.com/Lightning-AI/lightning-tools',
'github_issues': 'https://github.com/Lightning-AI/lightning-tools/issues',
'contributing': 'https://github.com/Lightning-AI/lightning/blob/master/CONTRIBUTING.md',
'governance': 'https://github.com/Lightning-AI/lightning/blob/master/governance.md',
'docs': 'https://dev-toolbox.rtfd.io/en/latest',
'twitter': 'https://twitter.com/PyTorchLightnin',
'discuss': 'https://pytorch-lightning.slack.com',
'home': 'https://lightning-devtools.rtfd.io/en/latest/',
'get_started': 'https://lightning-devtools.readthedocs.io/en/latest/introduction_guide.html',
'features': 'https://lightning-devtools.rtfd.io/en/latest/',
'home': 'https://lightning-tools.rtfd.io/en/latest/',
'get_started': 'https://lightning-tools.readthedocs.io/en/latest/introduction_guide.html',
'features': 'https://lightning-tools.rtfd.io/en/latest/',
'blog': 'https://www.pytorchlightning.ai/blog',
'support': 'https://lightning-devtools.rtfd.io/en/latest/',
'support': 'https://lightning-tools.rtfd.io/en/latest/',
}
-%}
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 pl_devtools
import lightning_tools

_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 = pl_devtools.__copyright__
author = pl_devtools.__author__
copyright = lightning_tools.__copyright__
author = lightning_tools.__author__

# The short X.Y version
version = pl_devtools.__version__
version = lightning_tools.__version__
# The full version, including alpha/beta/rc tags
release = pl_devtools.__version__
release = lightning_tools.__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": pl_devtools.__homepage__,
"canonical_url": pl_devtools.__homepage__,
"pytorch_project": lightning_tools.__homepage__,
"canonical_url": lightning_tools.__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,
pl_devtools.__docs__,
lightning_tools.__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 =
pl_devtools
lightning_tools
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/pl_devtools
files = src/lightning_tools
disallow_untyped_defs = True
ignore_missing_imports = True
10 changes: 5 additions & 5 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="pl_devtools"):
def _load_py_module(fname, pkg="lightning_tools"):
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,13 +25,13 @@ def _load_py_module(fname, pkg="pl_devtools"):
readme = fp.read()

setup(
name="lightning-devtools",
name="lightning_tools",
version=about.__version__,
description=about.__docs__,
author=about.__author__,
author_email=about.__author_email__,
url=about.__homepage__,
download_url="https://github.com/Lightning-AI/devtools",
download_url="https://github.com/Lightning-AI/lightning-tools",
license=about.__license__,
packages=find_packages(where="src"),
package_dir={"": "src"},
Expand All @@ -44,9 +44,9 @@ def _load_py_module(fname, pkg="pl_devtools"):
setup_requires=[],
install_requires=requirements,
project_urls={
"Bug Tracker": "https://github.com/Lightning-AI/devtools/issues",
"Bug Tracker": "https://github.com/Lightning-AI/lightning-tools/issues",
"Documentation": "https://dev-toolbox.rtfd.io/en/latest/", # TODO: Update domain
"Source Code": "https://github.com/Lightning-AI/devtools",
"Source Code": "https://github.com/Lightning-AI/lightning-tools",
},
classifiers=[
"Environment :: Console",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
__author_email__ = "pytorch@lightning.ai"
__license__ = "Apache-2.0"
__copyright__ = f"Copyright (c) 2022-{time.strftime('%Y')}, {__author__}."
__homepage__ = "https://github.com/Lightning-AI/devtools"
__homepage__ = "https://github.com/Lightning-AI/lightning-tools"
__docs__ = "PyTorch Lightning Sample project."
__long_doc__ = """
What is it?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import os

from pl_devtools.__about__ import * # noqa: F401, F403
from lightning_tools.__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 pl_devtools.dependencies import prune_pkgs_in_requirements, replace_oldest_ver
from lightning_tools.dependencies import prune_pkgs_in_requirements, replace_oldest_ver


def main() -> None:
Expand Down
File renamed without changes.
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 pl_devtools.dependencies import prune_pkgs_in_requirements, replace_oldest_ver
from lightning_tools.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 pl_devtools.imports import compare_version, module_available, RequirementCache
from lightning_tools.imports import compare_version, module_available, RequirementCache


def test_module_exists():
Expand Down