-
Notifications
You must be signed in to change notification settings - Fork 25
/
setup.py
88 lines (82 loc) · 2.94 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
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
87
88
#! /usr/bin/python2
# -*- coding: utf-8; -*-
#
# (c) 2013 booya (http://booya.at)
#
# This file is part of the OpenGlider project.
#
# OpenGlider is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# OpenGlider is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with OpenGlider. If not, see <http://www.gnu.org/licenses/>.
from distutils.core import setup
import os
packages, package_data = [], {}
# This is all copied 1:1 from django-project as i dont know any better way to do this
def fullsplit(splitpath, result=None):
"""
Split a pathname into components (the opposite of os.path.join)
in a platform-neutral way.
"""
if result is None:
result = []
head, tail = os.path.split(splitpath)
if head == '':
return [tail] + result
if head == splitpath:
return result
return fullsplit(head, [tail] + result)
root_dir = os.path.dirname(__file__)
if root_dir != '':
os.chdir(root_dir)
og_dirs = ['openglider', 'freecad']
for directory in og_dirs:
for dirpath, dirnames, filenames in os.walk(directory):
# Ignore PEP 3147 cache dirs and those whose names start with '.'
dirnames[:] = [d for d in dirnames if not d.startswith('.') and d != '__pycache__']
parts = fullsplit(dirpath)
package_name = '.'.join(parts)
if '__init__.py' in filenames:
packages.append(package_name)
elif filenames:
relative_path = []
while '.'.join(parts) not in packages:
relative_path.append(parts.pop())
relative_path.reverse()
if relative_path:
path = os.path.join(*relative_path)
else:
path = ""
package_files = package_data.setdefault('.'.join(parts), [])
package_files.extend([os.path.join(path, f) for f in filenames])
print(package_data, packages)
setup(
name='OpenGlider',
version="0.05", #openglider.__version__,
description="tool for glider design",
packages=packages,
package_data=package_data,
license='GPL-v3',
# long_description=open('README.md').read(),
install_requires=["svgwrite",
"numpy",
"scipy",
"ezdxf",
"ezodf",
"lxml", # missing in ezodf:q;
"pyexcel-ods",
"meshpy"
],
author='Booya',
url='www.openglider.org',
download_url="https://github.com/hiaselhans/OpenGlider/tarball/0.01dev0",
include_package_data=True
)