Commit 9b63ba84 authored by Eric Pellegrini's avatar Eric Pellegrini

added stub files to setuptools process

parent 2b05f079
import glob
import os
from distutils.util import convert_path
from setuptools import find_packages, setup
def find_data(where=".", exclude=None, exclude_directories=None, prefix=""):
if exclude is None:
exclude = []
if exclude_directories is None:
exclude_directories = []
out = {}
stack = [convert_path(where)]
while stack:
where = stack.pop(0)
for name in os.listdir(where):
fn = os.path.join(where, name)
d = os.path.join(prefix,os.path.dirname(fn))
if os.path.isdir(fn):
stack.append(fn)
else:
bad_name = False
for pattern in exclude:
if (fnmatch.fnmatchcase(name, pattern) or fn.lower() == pattern.lower()):
bad_name = True
break
if bad_name:
continue
out.setdefault(d, []).append(fn)
out = [(k,v) for k, v in out.items()]
return out
name = "packme"
# Read the package metadata first
pkginfo = {}
exec(open("src/packme/__pkginfo__.py","r").read(),{},pkginfo)
from setuptools import find_packages, setup
# Set up the sphinx documentation command
cmdclass = {}
command_options = {}
......@@ -28,6 +60,8 @@ with open("README.md","r") as f:
packages = find_packages("src")
data_files = find_data("stubs")
# Copy the scripts
scripts_dir = "scripts"
scripts = glob.glob(os.path.join(scripts_dir,'*'))
......@@ -51,4 +85,5 @@ setup(name = name,
cmdclass = cmdclass,
scripts = scripts,
command_options = command_options,
data_files = data_files
)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment