diff --git a/.github/workflows/ci-testing.yml b/.github/workflows/ci-testing.yml index 34751f2795..cbd8fb2aa6 100644 --- a/.github/workflows/ci-testing.yml +++ b/.github/workflows/ci-testing.yml @@ -79,7 +79,8 @@ jobs: - name: Install package & dependencies run: | pip --version - pip install -e '.[test]' -U \ + pip install -e . -U \ + -r requirements/test.txt \ --find-links=${TORCH_URL} ${PIP_EXTRA_FLAG} pip list shell: bash diff --git a/setup.py b/setup.py index 566f2bbc40..b0ee14e897 100755 --- a/setup.py +++ b/setup.py @@ -21,7 +21,7 @@ def _load_py_module(fname, pkg="thunder"): def _load_requirements(path_dir: str, file_name: str = "requirements.txt") -> list: reqs = parse_requirements(open(os.path.join(path_dir, file_name)).readlines()) - return list(map(str, reqs)) + return [r for r in list(map(str, reqs)) if "@" not in r] def _prepare_extras( @@ -43,6 +43,19 @@ def _prepare_extras( return extras +def _load_readme_description(path_dir: str, homepage: str, version: str) -> str: + """Load readme as decribtion.""" + path_readme = os.path.join(path_dir, "README.md") + with open(path_readme, encoding="utf-8") as fp: + text = fp.read() + # https://github.com/Lightning-AI/lightning-thunder/raw/master/docs/source/_static/images/lightning_module/pt_to_pl.png + github_source_url = os.path.join(homepage, "raw", version) + # replace relative repository path to absolute link to the release + # do not replace all "docs" as in the readme we replace some other sources with particular path to docs + text = text.replace("docs/source/_static/", f"{os.path.join(github_source_url, 'docs/source/_static/')}") + return text + + about = _load_py_module("__about__.py") # https://packaging.python.org/discussions/install-requires-vs-requirements / @@ -58,7 +71,9 @@ def _prepare_extras( download_url="https://github.com/Lightning-AI/lightning-thunder", license=about.__license__, packages=find_packages(exclude=["thunder/tests", "docs"]), - long_description=about.__long_doc__, + long_description=_load_readme_description( + path_dir=_PATH_ROOT, homepage=about.__homepage__, version=about.__version__ + ), long_description_content_type="text/markdown", include_package_data=True, zip_safe=False, diff --git a/thunder/__about__.py b/thunder/__about__.py index d9fb64ba1d..15e838ef4f 100644 --- a/thunder/__about__.py +++ b/thunder/__about__.py @@ -1,21 +1,17 @@ -__version__ = "0.0.0dev" +__version__ = "0.1.0" __author__ = "Lightning-AI et al" __author_email__ = "community@lightning.ai" __license__ = "Apache 2.0" __copyright__ = f"2024 {__author__}" __homepage__ = "https://github.com/Lightning-AI/lightning-thunder" __docs__ = "Lightning Thunder project." -# todo: consider loading Readme here... -__long_doc__ = """ -Lightning Thunder is a deep learning compiler for PyTorch. -""" + __all__ = [ "__author__", "__author_email__", "__copyright__", "__docs__", - "__long_doc__", "__homepage__", "__license__", "__version__",