-
Notifications
You must be signed in to change notification settings - Fork 353
/
setup.py
46 lines (34 loc) · 1.22 KB
/
setup.py
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
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import os
from setuptools import setup, find_packages
dir_path = os.path.dirname(os.path.realpath(__file__))
with open(os.path.join(dir_path, "src", "pyrobot", "version.py")) as fp:
exec(fp.read())
def read_requirements_file(filename):
req_file_path = "%s/%s" % (dir_path, filename)
with open(req_file_path) as f:
return [line.strip() for line in f]
packages = find_packages("src")
# Ensure that we don't pollute the global namespace.
for p in packages:
assert p == "pyrobot" or p.startswith("pyrobot.")
import sys
if sys.version_info > (3, 0):
# Python 3 code in this block
requirements_file = "requirements_python3.txt"
else:
# Python 2 code in this block
requirements_file = "requirements_python2.txt"
setup(
name="pyrobot",
version=__version__,
author="PyRobot Team",
url="https://github.com/facebookresearch/pyrobot.git",
license="MIT",
packages=packages,
package_data={"pyrobot": ["cfg/*.yaml"],},
package_dir={"": "src"},
install_requires=read_requirements_file(requirements_file),
)