@@ -21,7 +21,7 @@ def _load_py_module(fname, pkg="thunder"):
21
21
22
22
def _load_requirements (path_dir : str , file_name : str = "requirements.txt" ) -> list :
23
23
reqs = parse_requirements (open (os .path .join (path_dir , file_name )).readlines ())
24
- return list (map (str , reqs ))
24
+ return [ r for r in list (map (str , reqs )) if "@" not in r ]
25
25
26
26
27
27
def _prepare_extras (
@@ -43,6 +43,19 @@ def _prepare_extras(
43
43
return extras
44
44
45
45
46
+ def _load_readme_description (path_dir : str , homepage : str , version : str ) -> str :
47
+ """Load readme as decribtion."""
48
+ path_readme = os .path .join (path_dir , "README.md" )
49
+ with open (path_readme , encoding = "utf-8" ) as fp :
50
+ text = fp .read ()
51
+ # https://github.com/Lightning-AI/lightning-thunder/raw/master/docs/source/_static/images/lightning_module/pt_to_pl.png
52
+ github_source_url = os .path .join (homepage , "raw" , version )
53
+ # replace relative repository path to absolute link to the release
54
+ # do not replace all "docs" as in the readme we replace some other sources with particular path to docs
55
+ text = text .replace ("docs/source/_static/" , f"{ os .path .join (github_source_url , 'docs/source/_static/' )} " )
56
+ return text
57
+
58
+
46
59
about = _load_py_module ("__about__.py" )
47
60
48
61
# https://packaging.python.org/discussions/install-requires-vs-requirements /
@@ -58,7 +71,9 @@ def _prepare_extras(
58
71
download_url = "https://github.com/Lightning-AI/lightning-thunder" ,
59
72
license = about .__license__ ,
60
73
packages = find_packages (exclude = ["thunder/tests" , "docs" ]),
61
- long_description = about .__long_doc__ ,
74
+ long_description = _load_readme_description (
75
+ path_dir = _PATH_ROOT , homepage = about .__homepage__ , version = about .__version__
76
+ ),
62
77
long_description_content_type = "text/markdown" ,
63
78
include_package_data = True ,
64
79
zip_safe = False ,
0 commit comments