-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsetup.py
More file actions
executable file
·38 lines (32 loc) · 1.01 KB
/
setup.py
File metadata and controls
executable file
·38 lines (32 loc) · 1.01 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
#!pyvenv/bin/python
from setuptools import find_packages, setup
import os
import distutils.cmd
class CleanCommand(distutils.cmd.Command):
"""
Our custom command to clean out junk files.
"""
description = "Cleans out junk files we don't want in the repo"
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
cmd_list = dict(
DS_Store="find . -name .DS_Store -print0 | xargs -0 rm -f;",
pyc="find . -name '*.pyc' -exec rm -rf {} \;",
egg="find . -name '*.egg-info' -exec rm -rf {} \;",
cache="find ./src -name '__pycache__' -exec rm -rf {} \;",
doc="rm -rf docs/doc/* docs/coverage/* \;",
)
for key, cmd in cmd_list.items():
os.system(cmd)
# Most of the config is read from setup.cfg
setup(
packages=find_packages(where="src", exclude=("test",)),
package_dir={"": "src"},
cmdclass={
'clean': CleanCommand,
},
)