Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 97 lines (82 sloc) 3.115 kb
826898c @areski import project
areski authored
1 from setuptools import setup
2 import os
c1e185d @areski update setup.py + add CHANGES
areski authored
3 import codecs
826898c @areski import project
areski authored
4 import sys
5 import re
c1e185d @areski update setup.py + add CHANGES
areski authored
6 from country_dialcode import __version__ as version
7
8
9 def read(*parts):
10 return codecs.open(os.path.join(os.path.dirname(__file__), *parts)).read()
826898c @areski import project
areski authored
11
12
717ae39 @shrenik updated setup file
shrenik authored
13 # Compile the list of packages available, because distutils doesn't have
14 # an easy way to do this.
15 packages, data_files, temp_data_files, addons_data_files = [], [], [], []
16 docs_data_files, resources_data_files = [], []
17
826898c @areski import project
areski authored
18 root_dir = os.path.dirname(__file__)
19 if root_dir:
20 os.chdir(root_dir)
21
22
23 def parse_requirements(file_name):
24 requirements = []
25 for line in open(file_name, 'r').read().split('\n'):
26 if re.match(r'(\s*#)|(\s*$)', line):
27 continue
28 if re.match(r'\s*-e\s+', line):
29 requirements.append(re.sub(r'\s*-e\s+.*#egg=(.*)$', r'\1', line))
30 elif re.match(r'(\s*git)|(\s*hg)', line):
31 pass
32 else:
33 requirements.append(line)
34 return requirements
35
36
37 def parse_dependency_links(file_name, install_flag=False):
38 dependency_links = []
39 for line in open(file_name, 'r').read().split('\n'):
40 if re.match(r'\s*-e\s+', line):
41 dependency_links.append(re.sub(r'\s*-e\s+', '', line))
42 if re.match(r'(\s*git)|(\s*hg)', line):
c6b1f64 @areski flake fixes
areski authored
43 if install_flag:
826898c @areski import project
areski authored
44 line_arr = line.split('/')
45 line_arr_length = len(line.split('/'))
46 pck_name = line_arr[line_arr_length - 1].split('.git')
47 if len(pck_name) == 2:
48 os.system('pip install -f %s %s' % (pck_name[0], line))
49 if len(pck_name) == 1:
50 os.system('pip install -f %s %s' % (pck_name, line))
51 return dependency_links
52
53
717ae39 @shrenik updated setup file
shrenik authored
54 install_flag = False
826898c @areski import project
areski authored
55 if sys.argv[1] == "install":
56 install_flag = True
57
c1e185d @areski update setup.py + add CHANGES
areski authored
58 version = '0.4.0'
826898c @areski import project
areski authored
59
812babd @areski add manual loader for the fixture
areski authored
60
826898c @areski import project
areski authored
61 setup(
62 name='django-country-dialcode',
63 version=version,
c1e185d @areski update setup.py + add CHANGES
areski authored
64 description='Django Application providing Dialcode and Countries code',
65 long_description=read('README.rst'),
826898c @areski import project
areski authored
66 author='Belaid Arezqui',
67 author_email='areski@gmail.com',
68 url='http://github.com/Star2Billing/django-country-dialcode',
812babd @areski add manual loader for the fixture
areski authored
69 packages=[
70 "country_dialcode",
71 "country_dialcode.management",
72 "country_dialcode.management.commands",
73 ],
74 package_data={
75 "": [
76 "fixtures/*",
77 ]
78 },
717ae39 @shrenik updated setup file
shrenik authored
79 include_package_data=True,
826898c @areski import project
areski authored
80 download_url='https://github.com/Star2Billing/django-country-dialcode/tarball/master',
9846dd7 @areski update model don't load it on install
areski authored
81 zip_safe=False,
826898c @areski import project
areski authored
82 entry_points={'django.apps': 'country_dialcode = country_dialcode'},
9846dd7 @areski update model don't load it on install
areski authored
83 install_requires=parse_requirements('requirements.txt'),
b0c7538 @areski update setup.py
areski authored
84 dependency_links=parse_dependency_links('requirements.txt', install_flag),
826898c @areski import project
areski authored
85 license='MIT License',
86 classifiers=[
87 'Development Status :: 4 - Beta',
88 'Environment :: Web Environment',
89 'Framework :: Django',
90 'Intended Audience :: Developers',
91 'License :: OSI Approved :: MIT License',
92 'Operating System :: OS Independent',
93 'Programming Language :: Python',
94 'Topic :: Software Development :: Libraries :: Python Modules'
95 ],
96 )
Something went wrong with that request. Please try again.