forked from Loop3D/map2loop-2-legacy
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
60 lines (51 loc) · 1.67 KB
/
setup.py
File metadata and controls
60 lines (51 loc) · 1.67 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
import os
import sys
import setuptools
from setuptools.command.develop import develop
import subprocess
import platform
head, tail = os.path.split(sys.argv[0])
class CondaDependencies(develop):
def run(self):
try:
deplist_path = os.path.join(head, "dependencies.txt")
deps = []
with open(deplist_path, 'r') as f:
for line in f:
deps.append(line.strip())
_platform = platform.platform()
if _platform.startswith("Windows"):
_shell = True
else: # Linux or Mac
_shell = False
command = 'conda install -c conda-forge -c loop3d -y python=3.7'.split() + \
deps
print(command)
subprocess.run(command, shell=_shell)
except Exception as e:
self.error('Could not install dependencies using conda!')
develop.run(self)
long_description = ""
readme_file = os.path.join(head, "README.md")
with open(readme_file, "r") as fh:
long_description = fh.read()
setuptools.setup(
name="map2loop",
version="1.1.3",
author="The Loop Organisation",
author_email="[email protected]",
description="Generate 3D model data from 2D maps.",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/Loop3D/map2loop-2",
packages=setuptools.find_packages(),
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
],
cmdclass={
'develop': CondaDependencies,
},
python_requires='>=3.6',
)