-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
75 lines (57 loc) · 1.82 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
from pathlib import Path
from typing import List
from setuptools import setup, find_packages
required_packages = find_packages(exclude=["test", "examples"])
BASE_NAME = "__required__"
ALL_NAME = "all"
def parse_requirements():
extras = {}
with open("requirements.txt") as f:
lines = f.read().splitlines()
extra_name = BASE_NAME
extra_items: List[str] = []
for line in [line.strip() for line in lines if line != ""]:
if line.startswith("# extra"):
extras[extra_name] = extra_items
extra_items: List[str] = []
tokens = line.split(" ")
extra_name = tokens[2]
elif line.startswith("#"):
pass
elif line.startswith("-"):
pass
else:
extra_items.append(line)
# add last group
extras[extra_name] = extra_items
# extract base packages
install = extras.pop(BASE_NAME)
# create all group
all_reqs = list(extras.values())
extras[ALL_NAME] = []
for reqs in all_reqs:
extras[ALL_NAME] += reqs
return install, extras
install_required, extras_required = parse_requirements()
# read readme
current_dir = Path(__file__).parent
long_description = (current_dir / "README.md").read_text()
setup(
name="volumesh",
version="1.3.0",
packages=required_packages,
entry_points={
"console_scripts": [
"volumesh = volumesh.__main__:main",
],
},
url="https://github.com/cansik/volumesh",
license="MIT License",
author="Florian Bruggisser",
author_email="[email protected]",
description="Utility for creating volumetric mesh container files in glTF format.",
long_description=long_description,
long_description_content_type="text/markdown",
install_requires=install_required,
extras_require=extras_required
)