-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsetup.py
executable file
·96 lines (91 loc) · 3.14 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
89
90
91
92
93
94
95
96
#!/usr/bin/env python
"""
Setup script
"""
import os
import os.path
import re
from distutils.core import setup
def find_package_data(basedir):
"""Identify data files to package together"""
pkgdata = {}
pkgdir = {}
EXCLUDE_FROM_DATA = (".py", ".pyc", ".pyo")
for directory, _, files in os.walk(basedir):
package = ".".join(directory.split(os.sep))
if "__init__.py" in files:
# Record real packages and their directories
pkgdata[package] = [
f for f in files if not f.endswith(EXCLUDE_FROM_DATA)
]
pkgdir[package] = directory
else:
# Find parent package
while package not in pkgdata and package:
package = ".".join(package.split(".")[:-1])
# Add data files relative to their parent package
reldir = os.path.relpath(directory, pkgdir[package])
pkgdata[package].extend(
os.path.join(reldir, f)
for f in files
if not f.endswith(EXCLUDE_FROM_DATA)
)
return pkgdata
with open("debian/changelog", encoding="utf-8") as f:
res = re.search(r"\((\d.*)\)", f.readline())
version = res.group(1)
setup(
name="DistroTracker",
version=version,
description="Synoptic view of all packages of a Debian-based distribution",
author="Distro Tracker Developers",
author_email="[email protected]",
url="https://wiki.debian.org/qa.debian.org/distro-tracker",
packages=[
".".join(directory.split(os.sep))
for directory, _, files in os.walk("distro_tracker")
if "__init__.py" in files
],
package_data=find_package_data("distro_tracker"),
classifiers=[
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Information Technology",
"Intended Audience :: Developers",
(
"License :: OSI Approved :: "
"GNU General Public License v2 or later (GPLv2+)"
),
"Operating System :: POSIX :: Linux",
"Environment :: Web Environment",
"Programming Language :: Python :: 3",
"Framework :: Django",
"Topic :: Software Development",
],
)
setup(
name="DjangoEmailAccounts",
version=version,
description="User registration app for Django",
author="Distro Tracker Developers",
author_email="[email protected]",
url="https://wiki.debian.org/qa.debian.org/distro-tracker",
packages=[
".".join(directory.split(os.sep))
for directory, _, files in os.walk("django_email_accounts")
if "__init__.py" in files
],
package_data=find_package_data("django_email_accounts"),
classifiers=[
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Information Technology",
"Intended Audience :: Developers",
(
"License :: OSI Approved :: "
"GNU General Public License v2 or later (GPLv2+)"
),
"Operating System :: POSIX :: Linux",
"Environment :: Web Environment",
"Programming Language :: Python :: 3",
"Framework :: Django",
],
)