Skip to content

Commit 1273ec2

Browse files
committed
fix(pypi): fix an issue where images are not rendered on pypi page
1 parent f3cadd4 commit 1273ec2

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

setup.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,16 @@
1+
import re
12
import setuptools
23

34
with open("README.md", "r") as fh:
5+
def func(m):
6+
match = m.group()
7+
url = m.group(1)
8+
if url.startswith('resources/'):
9+
return match.replace(url, 'https://raw.githubusercontent.com/NeuroDiffGym/neurodiffeq/master/' + url)
10+
return match
11+
412
long_description = fh.read()
13+
long_description = re.sub(r"!\[.*?\]\((.*?)\)", func, long_description)
514

615
with open("requirements.txt", "r") as fh:
716
requirements = [line.strip() for line in fh.read().split('\n') if line.strip() != '']

0 commit comments

Comments
 (0)