Initial changes to support the new Django 1.6 project structure
This commit is contained in:
104
setup.py
Normal file
104
setup.py
Normal file
@@ -0,0 +1,104 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import os
|
||||
import sys
|
||||
|
||||
try:
|
||||
from setuptools import setup
|
||||
except ImportError:
|
||||
from distutils.core import setup
|
||||
|
||||
import mayan
|
||||
|
||||
PACKAGE_NAME = 'mayan'
|
||||
PACKAGE_DIR = 'mayan'
|
||||
|
||||
if sys.argv[-1] == 'publish':
|
||||
os.system('python setup.py sdist upload')
|
||||
sys.exit()
|
||||
|
||||
|
||||
def fullsplit(path, result=None):
|
||||
"""
|
||||
Split a pathname into components (the opposite of os.path.join) in a
|
||||
platform-neutral way.
|
||||
"""
|
||||
if result is None:
|
||||
result = []
|
||||
head, tail = os.path.split(path)
|
||||
if head == '':
|
||||
return [tail] + result
|
||||
if head == path:
|
||||
return result
|
||||
return fullsplit(head, [tail] + result)
|
||||
|
||||
|
||||
def find_packages(directory):
|
||||
# Compile the list of packages available, because distutils doesn't have
|
||||
# an easy way to do this.
|
||||
packages, data_files = [], []
|
||||
root_dir = os.path.dirname(__file__)
|
||||
if root_dir != '':
|
||||
os.chdir(root_dir)
|
||||
|
||||
for dirpath, dirnames, filenames in os.walk(directory):
|
||||
# Ignore dirnames that start with '.'
|
||||
if os.path.basename(dirpath).startswith('.'):
|
||||
continue
|
||||
if '__init__.py' in filenames:
|
||||
packages.append('.'.join(fullsplit(dirpath)))
|
||||
elif filenames:
|
||||
data_files.append([dirpath, [os.path.join(dirpath, f) for f in filenames]])
|
||||
return packages
|
||||
|
||||
|
||||
def get_requirements():
|
||||
with open(os.path.join(PACKAGE_DIR, 'requirements/common.txt')) as f:
|
||||
requires = [requirement.replace('==', '>=') for requirement in f.readlines()]
|
||||
return requires
|
||||
|
||||
|
||||
with open('README.rst') as f:
|
||||
readme = f.read()
|
||||
with open('HISTORY.rst') as f:
|
||||
history = f.read()
|
||||
with open('LICENSE') as f:
|
||||
license = f.read()
|
||||
with open('AUTHORS.rst') as f:
|
||||
authors = f.read()
|
||||
|
||||
|
||||
|
||||
setup(
|
||||
author='Roberto Rosario',
|
||||
author_email='rrosario@ogp.pr.gov',
|
||||
classifiers=[
|
||||
'Development Status :: 5 - Production/Stable',
|
||||
'Environment :: Web Environment',
|
||||
'Framework :: Django',
|
||||
'Intended Audience :: Education',
|
||||
'Intended Audience :: Developers',
|
||||
'Intended Audience :: Information Technology',
|
||||
'License :: OSI Approved :: GNU General Public License v3 (GPLv3)',
|
||||
'Natural Language :: English',
|
||||
'Programming Language :: Python',
|
||||
'Programming Language :: Python',
|
||||
'Programming Language :: Python :: 2.6',
|
||||
'Programming Language :: Python :: 2.7',
|
||||
'Topic :: Internet :: WWW/HTTP',
|
||||
'Topic :: Internet :: WWW/HTTP :: WSGI :: Application',
|
||||
'Topic :: Communications :: File Sharing',
|
||||
],
|
||||
description='A Python based open data API engine.',
|
||||
include_package_data=True,
|
||||
install_requires=get_requirements(),
|
||||
license=license,
|
||||
long_description=readme + '\n\n' + history + '\n\n' + authors,
|
||||
name=PACKAGE_NAME,
|
||||
packages=find_packages(PACKAGE_DIR),
|
||||
platforms=['any'],
|
||||
scripts=['mayan/bin/mayan-admin.py'],
|
||||
url='https://github.com/mayan-edms/mayan-edms',
|
||||
version=mayan.__version__,
|
||||
zip_safe=False,
|
||||
)
|
||||
Reference in New Issue
Block a user