forked from PabloCastellano/bormeparser
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
72 lines (62 loc) · 2.22 KB
/
setup.py
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
from glob import glob
from setuptools import setup, find_packages
sys.path.insert(0, 'bormeparser')
from version import __version__, __license__
sys.path.remove('bormeparser')
def get_install_requires():
"""
parse requirements.txt, ignore links, exclude comments
"""
requirements = []
for requirements_file in ('requirements/base.txt',):
for line in open(requirements_file).readlines():
line = line.rstrip()
# skip to next iteration if comment or empty line
if any([line.startswith('#'), line == '', line.startswith('http'), line.startswith('git'), line == '-r base.txt']):
continue
# add line to requirements
requirements.append(line)
return requirements
if sys.version_info[0] == 3:
long_description = open('README.md', encoding='utf-8').read()
else:
long_description = open('README.md').read()
if sys.argv[-1] == 'publish':
os.system("python setup.py sdist bdist_wheel upload -s")
print("You probably want to also tag the version now:")
print(" git tag -s -a v{version}".format(version=__version__))
print(" git push --tags")
sys.exit()
try:
os.symlink('../examples', 'bormeparser/examples')
except FileExistsError:
pass
setup(
name='bormeparser',
packages=find_packages(exclude=['*.tests']),
package_data={
"bormeparser": glob("examples/*")
},
version=__version__,
description="bormeparser is a Python library for parsing BORME files",
long_description=long_description,
author='Pablo Castellano',
author_email='[email protected]',
url='https://github.com/PabloCastellano/bormeparser/',
download_url='https://github.com/PabloCastellano/bormeparser/archive/master.zip',
keywords=['BORME', 'transparency', 'opendata', 'Spain', 'Registro mercantil', 'Boletín Oficial del Registro Mercantil'],
classifiers=[
'Programming Language :: Python :: 3',
],
license=__license__,
data_files=[('', ['LICENSE.txt'])],
include_package_data=True,
zip_safe=False,
install_requires=get_install_requires(),
test_suite="bormeparser.tests"
)
os.unlink('bormeparser/examples')