This repository has been archived by the owner on Sep 2, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
68 lines (53 loc) · 1.72 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
# coding=utf-8
import os
import shutil
from distutils.command.install import INSTALL_SCHEMES
from setuptools import find_packages, setup, Command
from setuptools.command.build_py import build_py
__author__ = "Gareth Coles"
class BuildZipsCommand(Command):
"""
A custom command to build a zip of config files needed for initial installs
"""
description = "Build zip of bundled config files"
def run(self):
if os.path.exists("config.zip"):
print("Removing old 'config.zip'")
os.remove("config.zip")
shutil.make_archive("config", "zip", "config")
print("config/ -> config.zip")
def initialize_options(self):
pass
def finalize_options(self):
pass
class BuildPyCommand(build_py):
"""
Custom build command that calls the zip-building command
"""
def run(self):
self.run_command("build_zip")
build_py.run(self)
for scheme in INSTALL_SCHEMES.values():
scheme["data"] = scheme["purelib"]
setup(
cmdclass={
"build_zip": BuildZipsCommand,
"build_py": BuildPyCommand
},
name='Ultros',
version='0.0.1',
author='Gareth Coles, Sean Gordon',
author_email='Gareth Coles <gdude2002@gmail.com>',
packages=find_packages('src'),
package_dir={'': 'src'},
url='http://pypi.python.org/pypi/Ultros/',
license='LICENSE.txt',
description='The only squid that connects communities!',
long_description=open('README.txt').read(),
install_requires=open(
"requirements.txt"
).read().replace("\r", "").split("\n"),
extras_require={"uvloop": "uvloop"},
namespace_packages=["ultros", "ultros.networks", "ultros.plugins"],
data_files=[("", ["config.zip"])]
)