forked from newfies-dialer/newfies-dialer
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
23 additions
and
246 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,58 +8,22 @@ | |
# License, v. 2.0. If a copy of the MPL was not distributed with this file, | ||
# You can obtain one at http://mozilla.org/MPL/2.0/. | ||
# | ||
# Copyright (C) 2011-2012 Star2Billing S.L. | ||
# Copyright (C) 2011-2013 Star2Billing S.L. | ||
# | ||
# The Initial Developer of the Original Code is | ||
# Arezqui Belaid <[email protected]> | ||
# | ||
|
||
import os | ||
from setuptools import setup, find_packages | ||
from setuptools.dist import Distribution | ||
import pkg_resources | ||
import sys | ||
import os | ||
import re | ||
from newfies import VERSION | ||
|
||
add_django_dependency = True | ||
try: | ||
pkg_resources.get_distribution('Django') | ||
add_django_dependency = False | ||
except pkg_resources.DistributionNotFound: | ||
try: | ||
import django | ||
if django.VERSION[0] >= 1 and django.VERSION[1] >= 2 \ | ||
and django.VERSION[2] >= 0: | ||
add_django_dependency = False | ||
except ImportError: | ||
pass | ||
import newfies | ||
|
||
Distribution({'setup_requires': add_django_dependency | ||
and ['Django >=1.3.0'] or []}) | ||
|
||
COMMANDS = {} | ||
try: | ||
from sphinx.setup_command import BuildDoc | ||
COMMANDS['build_sphinx'] = BuildDoc | ||
except ImportError: | ||
pass | ||
try: | ||
from sphinx_pypi_upload import UploadDoc | ||
COMMANDS['upload_sphinx'] = UploadDoc | ||
except ImportError: | ||
pass | ||
def read(fname): | ||
return open(os.path.join(os.path.dirname(__file__), fname)).read() | ||
|
||
# Compile the list of packages available, because distutils doesn't have | ||
# an easy way to do this. | ||
|
||
(packages, data_files, temp_data_files, addons_data_files) = ([], [], | ||
[], []) | ||
(docs_data_files, resources_data_files) = ([], []) | ||
|
||
root_dir = os.path.dirname(__file__) | ||
if root_dir: | ||
os.chdir(root_dir) | ||
README = read('README.rst') | ||
|
||
|
||
def parse_requirements(file_name): | ||
|
@@ -68,65 +32,48 @@ def parse_requirements(file_name): | |
if re.match(r'(\s*#)|(\s*$)', line): | ||
continue | ||
if re.match(r'\s*-e\s+', line): | ||
requirements.append(re.sub(r'\s*-e\s+.*#egg=(.*)$', r'\1', | ||
line)) | ||
requirements.append(re.sub(r'\s*-e\s+.*#egg=(.*)$', r'\1', line)) | ||
elif re.match(r'(\s*git)|(\s*hg)', line): | ||
pass | ||
else: | ||
requirements.append(line) | ||
return requirements | ||
|
||
|
||
def parse_dependency_links(file_name, install_flag=False): | ||
def parse_dependency_links(file_name): | ||
dependency_links = [] | ||
for line in open(file_name, 'r').read().split('\n'): | ||
if re.match(r'\s*-e\s+', line): | ||
dependency_links.append(re.sub(r'\s*-e\s+', '', line)) | ||
if re.match(r'(\s*git)|(\s*hg)', line): | ||
if install_flag == True: | ||
line_arr = line.split('/') | ||
line_arr_length = len(line.split('/')) | ||
pck_name = line_arr[line_arr_length - 1].split('.git') | ||
if len(pck_name) == 2: | ||
os.system('pip install -f %s %s' % (pck_name[0], | ||
line)) | ||
if len(pck_name) == 1: | ||
os.system('pip install -f %s %s' % (pck_name, line)) | ||
return dependency_links | ||
if re.match(r'\s*-[ef]\s+', line): | ||
dependency_links.append(re.sub(r'\s*-[ef]\s+', '', line)) | ||
|
||
return dependency_links | ||
|
||
install_flag = False | ||
if sys.argv[1] == 'install': | ||
install_flag = True | ||
|
||
setup( | ||
name='newfies-dialer', | ||
version="-".join(map(str, VERSION[0:3])) + "".join(VERSION[3:]), | ||
version=newfies.__version__, | ||
description='Newfies is a Bulk Dialer and Voice Broadcasting application ' | ||
'dedicated to provide information via phone technology.', | ||
long_description=open('README.rst').read(), | ||
long_description=read('README.rst'), | ||
author='Belaid Arezqui', | ||
author_email='[email protected]', | ||
url='http://www.newfies-dialer.org/', | ||
download_url='https://github.com/Star2Billing/newfies-dialer' | ||
'/tarball/master', | ||
packages=find_packages(), | ||
include_package_data=True, | ||
zip_safe=False, | ||
package_dir={'newfies': 'newfies'}, | ||
packages=find_packages(), | ||
package_data={}, | ||
install_requires=parse_requirements('install/requirements/all-requirements.txt'), | ||
dependency_links=parse_dependency_links('install/requirements/all-requirements.txt'), | ||
license='MPL 2.0 License', | ||
classifiers=[ | ||
'Development Status :: 1 - Beta', | ||
'Development Status :: 5 - Production/Stable', | ||
'Environment :: Web Environment', | ||
'Framework :: Django', | ||
'Intended Audience :: Developers, Users', | ||
'License :: OSI Approved :: MPL 2.0 License', | ||
'Operating System :: OS Independent', | ||
'Programming Language :: Python, Javascript, HTML', | ||
'Topic :: Voice Broadcast Software', | ||
], | ||
zip_safe=False, | ||
install_requires=parse_requirements('install/requirements/django-requirements.txt'), | ||
dependency_links=parse_dependency_links('install/requirements/basic-requirements.txt', | ||
install_flag), | ||
setup_requires=['Django >= 1.4.1', 'Sphinx >= 0.4.2'], | ||
cmdclass=COMMANDS, | ||
) | ||
'Topic :: Software Development' | ||
], | ||
) |