-
Notifications
You must be signed in to change notification settings - Fork 81
Expand file tree
/
Copy pathsetup.py
More file actions
86 lines (72 loc) · 2.72 KB
/
setup.py
File metadata and controls
86 lines (72 loc) · 2.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
import io
import os
import re
import sys
import setuptools
ROOT_DIR = os.path.dirname(__file__)
SUPPORTED_PYTHON_VERSIONS = [(3, 8), (3, 9), (3, 10), (3, 11), (3, 12)]
if tuple(sys.version_info[:2]) not in SUPPORTED_PYTHON_VERSIONS:
msg = (
f'Detected Python version {".".join(map(str, sys.version_info[:2]))}, which is not supported. '
f'Only Python {", ".join(".".join(map(str, v)) for v in SUPPORTED_PYTHON_VERSIONS)} are supported.'
)
raise RuntimeError(msg)
def parse_readme(readme: str) -> str:
"""Parse the README.md file to be pypi compatible."""
# Replace the footnotes.
readme = readme.replace('<!-- Footnote -->', '#')
footnote_re = re.compile(r'\[\^([0-9]+)\]')
readme = footnote_re.sub(r'<sup>[\1]</sup>', readme)
# Remove the dark mode switcher
mode_re = re.compile(
r'<picture>[\n ]*<source media=.*>[\n ]*<img(.*)>[\n ]*</picture>',
re.MULTILINE,
)
readme = mode_re.sub(r'<img\1>', readme)
return readme
long_description = ''
readme_filepath = 'README.md'
if os.path.exists(readme_filepath):
long_description = io.open(readme_filepath, 'r', encoding='utf-8').read()
long_description = parse_readme(long_description)
with open('requirements/core_requirements.txt', 'r') as f:
install_requires = f.read().splitlines()
with open('requirements/model_requirements.txt', 'r') as f:
model_requires = f.read().splitlines()
with open('requirements/isaac_requirements.txt', 'r') as f:
isaac_requires = f.read().splitlines()
with open('requirements/habitat_requirements.txt', 'r') as f:
habitat_requires = f.read().splitlines()
with open('requirements/internvla_n1.txt', 'r') as f:
n1_requires = f.read().splitlines()
setuptools.setup(
name='internnav',
version='0.3.1',
packages=setuptools.find_packages(),
author='Intern Robotics',
author_email='embodiedai@pjlab.org.cn',
license='Apache 2.0',
description='InternNav: A benchmark evaluation framework for navigation tasks',
long_description=long_description,
long_description_content_type='text/markdown',
python_requires='>=3.8, <=3.12',
classifiers=[
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Operating System :: OS Independent',
],
install_requires=install_requires,
include_package_data=True,
extras_require={
# envs
"isaac": isaac_requires,
"habitat": habitat_requires,
# models
"internvla_n1": n1_requires,
"baseline": model_requires,
"model": model_requires,
},
)