|
@@ -9,6 +9,8 @@ import shlex
|
|
import subprocess
|
|
import subprocess
|
|
import sys
|
|
import sys
|
|
|
|
|
|
|
|
+import github2pypi
|
|
|
|
+
|
|
|
|
|
|
PY3 = sys.version_info[0] == 3
|
|
PY3 = sys.version_info[0] == 3
|
|
PY2 = sys.version_info[0] == 2
|
|
PY2 = sys.version_info[0] == 2
|
|
@@ -94,50 +96,10 @@ if sys.argv[1] == 'release':
|
|
sys.exit(0)
|
|
sys.exit(0)
|
|
|
|
|
|
|
|
|
|
-def get_long_description():
|
|
|
|
- f = open('README.md')
|
|
|
|
-
|
|
|
|
- lines = []
|
|
|
|
- for line in f:
|
|
|
|
-
|
|
|
|
- def repl(match):
|
|
|
|
- if not match:
|
|
|
|
- return
|
|
|
|
-
|
|
|
|
- url = match.group(1)
|
|
|
|
- if url.startswith('http'):
|
|
|
|
- return match.group(0)
|
|
|
|
-
|
|
|
|
- url_new = (
|
|
|
|
- 'https://github.com/wkentaro/labelme/blob/master/{}'
|
|
|
|
- .format(url)
|
|
|
|
- )
|
|
|
|
- if re.match(r'.*[\.jpg|\.png]$', url_new):
|
|
|
|
- url_new += '?raw=true'
|
|
|
|
-
|
|
|
|
- start0, end0 = match.regs[0]
|
|
|
|
- start, end = match.regs[1]
|
|
|
|
- start -= start0
|
|
|
|
- end -= start0
|
|
|
|
-
|
|
|
|
- res = match.group(0)
|
|
|
|
- res = res[:start] + url_new + res[end:]
|
|
|
|
- return res
|
|
|
|
-
|
|
|
|
- patterns = [
|
|
|
|
- r'!\[.*?\]\((.*?)\)',
|
|
|
|
- r'<img.*?src="(.*?)".*?/>',
|
|
|
|
- r'\[.*?\]\((.*?)\)',
|
|
|
|
- r'<a.*?href="(.*?)".*?>',
|
|
|
|
- ]
|
|
|
|
- for pattern in patterns:
|
|
|
|
- line = re.sub(pattern, repl, line)
|
|
|
|
-
|
|
|
|
- lines.append(line)
|
|
|
|
-
|
|
|
|
- f.close()
|
|
|
|
-
|
|
|
|
- return ''.join(lines)
|
|
|
|
|
|
+with open('README.md') as f:
|
|
|
|
+ long_description = github2pypi.replace_url(
|
|
|
|
+ slug='wkentaro/imgviz', content=f.read()
|
|
|
|
+ )
|
|
|
|
|
|
|
|
|
|
setup(
|
|
setup(
|
|
@@ -145,7 +107,7 @@ setup(
|
|
version=version,
|
|
version=version,
|
|
packages=find_packages(),
|
|
packages=find_packages(),
|
|
description='Image Polygonal Annotation with Python',
|
|
description='Image Polygonal Annotation with Python',
|
|
- long_description=get_long_description(),
|
|
|
|
|
|
+ long_description=long_description,
|
|
long_description_content_type='text/markdown',
|
|
long_description_content_type='text/markdown',
|
|
author='Kentaro Wada',
|
|
author='Kentaro Wada',
|
|
author_email='www.kentaro.wada@gmail.com',
|
|
author_email='www.kentaro.wada@gmail.com',
|