Skip to content
This repository has been archived by the owner on Oct 9, 2023. It is now read-only.

Commit

Permalink
rename about (#225)
Browse files Browse the repository at this point in the history
* rename about

* ...
  • Loading branch information
Borda authored Apr 17, 2021
1 parent 4e68cc0 commit a756e8b
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 24 deletions.
4 changes: 3 additions & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
# main
/README.md @edenlightning @tchaton
# installation
/setup.py @borda @tchaton
/setup.py @borda @tchaton
/__about__.py @borda @tchaton
/__init__.py @borda @tchaton

# CI/CD
/.github/workflows/ @borda @tchaton
Expand Down
10 changes: 5 additions & 5 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@
SPHINX_MOCK_REQUIREMENTS = int(os.environ.get('SPHINX_MOCK_REQUIREMENTS', True))

try:
from flash import info
from flash import __about__ as about
except (ImportError, ModuleNotFoundError):
# alternative https://stackoverflow.com/a/67692/4521646
spec = spec_from_file_location("flash/info.py", os.path.join(_PATH_ROOT, "flash", "info.py"))
info = module_from_spec(spec)
spec.loader.exec_module(info)
spec = spec_from_file_location("flash/__about__.py", os.path.join(_PATH_ROOT, "flash", "__about__.py"))
about = module_from_spec(spec)
spec.loader.exec_module(about)

html_favicon = '_static/images/icon.svg'

Expand Down Expand Up @@ -101,7 +101,7 @@

html_theme_options = {
'pytorch_project': 'https://pytorchlightning.ai',
'canonical_url': info.__docs_url__,
'canonical_url': about.__docs_url__,
"collapse_navigation": False,
"display_version": True,
"logo_only": False,
Expand Down
10 changes: 10 additions & 0 deletions flash/info.py → flash/__about__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,13 @@
But unlike other entry-level frameworks (keras, etc...), Flash users can switch to Lightning trivially when they need
the added flexibility.
"""

__all__ = [
"__author__",
"__author_email__",
"__copyright__",
"__docs__",
"__homepage__",
"__license__",
"__version__",
]
10 changes: 1 addition & 9 deletions flash/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,7 @@
"""Root package info."""
import os

from flash.info import ( # noqa: F401
__author__,
__author_email__,
__copyright__,
__docs__,
__homepage__,
__license__,
__version__,
)
from flash.__about__ import * # noqa: F401 F403

_PACKAGE_ROOT = os.path.dirname(__file__)
_PROJECT_ROOT = os.path.dirname(_PACKAGE_ROOT)
Expand Down
19 changes: 10 additions & 9 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,20 @@
"""

try:
from flash import info, setup_tools
from flash import __about__ as about
from flash import setup_tools
except ImportError:
# alternative https://stackoverflow.com/a/67692/4521646
sys.path.append("flash")
import info
import __about__ as about
import setup_tools

# https://packaging.python.org/guides/single-sourcing-package-version/
# http://blog.ionelmc.ro/2014/05/25/python-packaging/

_PATH_ROOT = os.path.dirname(__file__)

long_description = setup_tools._load_readme_description(_PATH_ROOT, homepage=info.__homepage__, ver=info.__version__)
long_description = setup_tools._load_readme_description(_PATH_ROOT, homepage=about.__homepage__, ver=about.__version__)

# https://packaging.python.org/discussions/install-requires-vs-requirements /
# keep the meta-data here for simplicity in reading this file... it's not obvious
Expand All @@ -36,13 +37,13 @@
# engineer specific practices
setup(
name="lightning-flash",
version=info.__version__,
description=info.__docs__,
author=info.__author__,
author_email=info.__author_email__,
url=info.__homepage__,
version=about.__version__,
description=about.__docs__,
author=about.__author__,
author_email=about.__author_email__,
url=about.__homepage__,
download_url="https://github.com/PyTorchLightning/lightning-flash",
license=info.__license__,
license=about.__license__,
packages=find_packages(exclude=["tests", "docs"]),
long_description=long_description,
long_description_content_type="text/markdown",
Expand Down

0 comments on commit a756e8b

Please sign in to comment.