Skip to content

Commit

Permalink
Update image links for ivy-core in PyPI (#11219)
Browse files Browse the repository at this point in the history
* Update image links for ivy-core in PyPI

* revert version increment, wait for 1.2 release
  • Loading branch information
xoiga123 authored Mar 2, 2023
1 parent 59e2599 commit 384f44c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1 +1 @@
include requirements.txt
include requirements/requirements.txt
12 changes: 9 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,15 @@ def _replace_logos_html(txt):
# html-containing chunks
chunks = txt.split(".. raw:: html")

# light-dark logo
chunks[0] = _remove_dark_logo(chunks[0])

# backend logos
backends_chunk = chunks[2]
bc = backends_chunk.split("\n\n")
img_str = (
".. image:: https://github.com/unifyai/unifyai.github.io/blob/master/img/externally_linked/logos/supported/frameworks.png?raw=true\n" # noqa
" :width: 100%"
" :width: 100%\n"
" :class: dark-light"
)
backends_chunk = "\n\n".join(bc[0:1] + [img_str] + bc[2:])
Expand All @@ -44,11 +47,15 @@ def _replace_logos_html(txt):
[
".. raw:: html".join(chunks[0:2]),
backends_chunk,
".. raw:: html".join(chunks[2:]),
".. raw:: html".join(chunks[3:]),
]
)


def _remove_dark_logo(txt):
return txt.split("\n\n")[0]


def _is_html(line):
line_squashed = line.replace(" ", "")
if not line_squashed:
Expand Down Expand Up @@ -77,7 +84,6 @@ def read_description(path):
lines = _replace_logos_html(text).split("\n")
lines = [line for line in lines if not (_is_html(line) or _is_raw_block(line))]
long_description = "\n".join(lines)

with open("ivy/_version.py") as f:
exec(f.read(), __version__)

Expand Down

0 comments on commit 384f44c

Please sign in to comment.