2010-06-12 16:55:24 +02:00
|
|
|
#!/usr/bin/env python
|
2014-12-03 16:05:10 +01:00
|
|
|
# This file is part of Tryton. The COPYRIGHT file at the top level of
|
|
|
|
|
# this repository contains the full copyright notices and license terms.
|
2010-06-12 16:55:24 +02:00
|
|
|
from setuptools import setup, find_packages
|
2010-11-11 17:57:54 +01:00
|
|
|
import os
|
2016-02-19 23:16:43 +01:00
|
|
|
import re
|
|
|
|
|
import io
|
2010-06-12 16:55:24 +02:00
|
|
|
|
2012-04-03 20:09:39 +02:00
|
|
|
|
2010-11-11 17:57:54 +01:00
|
|
|
def read(fname):
|
2016-02-19 23:16:43 +01:00
|
|
|
return io.open(
|
|
|
|
|
os.path.join(os.path.dirname(__file__), fname),
|
|
|
|
|
'r', encoding='utf-8').read()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def get_version():
|
|
|
|
|
init = read(os.path.join('proteus', '__init__.py'))
|
|
|
|
|
return re.search('__version__ = "([0-9.]*)"', init).group(1)
|
2010-11-11 17:57:54 +01:00
|
|
|
|
2014-03-08 13:00:40 +01:00
|
|
|
|
|
|
|
|
def get_require_version(name):
|
|
|
|
|
if minor_version % 2:
|
|
|
|
|
require = '%s >= %s.%s.dev0, < %s.%s'
|
|
|
|
|
else:
|
|
|
|
|
require = '%s >= %s.%s, < %s.%s'
|
|
|
|
|
require %= (name, major_version, minor_version,
|
|
|
|
|
major_version, minor_version + 1)
|
|
|
|
|
return require
|
|
|
|
|
|
|
|
|
|
name = 'proteus'
|
2016-02-19 23:16:43 +01:00
|
|
|
version = get_version()
|
2014-03-08 13:00:40 +01:00
|
|
|
major_version, minor_version, _ = version.split('.', 2)
|
|
|
|
|
major_version = int(major_version)
|
|
|
|
|
minor_version = int(minor_version)
|
|
|
|
|
|
|
|
|
|
download_url = 'http://downloads.tryton.org/%s.%s/' % (
|
|
|
|
|
major_version, minor_version)
|
|
|
|
|
if minor_version % 2:
|
|
|
|
|
version = '%s.%s.dev0' % (major_version, minor_version)
|
|
|
|
|
download_url = 'hg+http://hg.tryton.org/%s#egg=%s-%s' % (
|
|
|
|
|
name, name, version)
|
|
|
|
|
|
2015-01-18 22:25:43 +01:00
|
|
|
dependency_links = []
|
|
|
|
|
if minor_version % 2:
|
|
|
|
|
# Add development index for testing with trytond
|
|
|
|
|
dependency_links.append('https://trydevpi.tryton.org/')
|
2014-03-08 13:00:40 +01:00
|
|
|
|
|
|
|
|
setup(name=name,
|
|
|
|
|
version=version,
|
2010-06-12 16:55:24 +02:00
|
|
|
description='Library to access Tryton server as a client',
|
2010-11-11 17:57:54 +01:00
|
|
|
long_description=read('README'),
|
2013-02-27 22:58:22 +01:00
|
|
|
author='Tryton',
|
2014-03-08 13:00:40 +01:00
|
|
|
author_email='issue_tracker@tryton.org',
|
2010-06-12 16:55:24 +02:00
|
|
|
url='http://www.tryton.org/',
|
2014-03-08 13:00:40 +01:00
|
|
|
download_url=download_url,
|
|
|
|
|
keywords='tryton library cli',
|
2010-06-12 16:55:24 +02:00
|
|
|
packages=find_packages(),
|
|
|
|
|
classifiers=[
|
|
|
|
|
'Development Status :: 5 - Production/Stable',
|
|
|
|
|
'Environment :: Plugins',
|
2012-08-28 22:19:57 +01:00
|
|
|
'Framework :: Tryton',
|
2010-06-12 16:55:24 +02:00
|
|
|
'Intended Audience :: Developers',
|
|
|
|
|
'Intended Audience :: Financial and Insurance Industry',
|
|
|
|
|
'Intended Audience :: Legal Industry',
|
2013-02-27 22:56:31 +01:00
|
|
|
'License :: OSI Approved :: '
|
|
|
|
|
'GNU Library or Lesser General Public License (LGPL)',
|
2010-06-12 16:55:24 +02:00
|
|
|
'Operating System :: OS Independent',
|
2011-07-12 00:22:00 +02:00
|
|
|
'Programming Language :: Python :: 2.7',
|
2016-02-19 23:16:43 +01:00
|
|
|
'Programming Language :: Python :: 3.3',
|
|
|
|
|
'Programming Language :: Python :: 3.4',
|
|
|
|
|
'Programming Language :: Python :: 3.5',
|
2015-03-15 15:53:37 +01:00
|
|
|
'Programming Language :: Python :: Implementation :: CPython',
|
|
|
|
|
'Programming Language :: Python :: Implementation :: PyPy',
|
2010-06-12 16:55:24 +02:00
|
|
|
'Topic :: Office/Business',
|
2013-02-27 22:56:31 +01:00
|
|
|
],
|
2014-03-08 13:00:40 +01:00
|
|
|
platforms='any',
|
2011-05-19 19:50:57 +02:00
|
|
|
license='LGPL-3',
|
2012-03-05 10:19:20 +01:00
|
|
|
install_requires=[
|
|
|
|
|
"python-dateutil",
|
|
|
|
|
],
|
2010-06-12 16:55:24 +02:00
|
|
|
extras_require={
|
2014-03-08 13:00:40 +01:00
|
|
|
'trytond': [get_require_version('trytond')],
|
2011-11-15 11:25:22 +01:00
|
|
|
'simplejson': ['simplejson'],
|
2012-01-04 19:54:58 +01:00
|
|
|
'cdecimal': ['cdecimal'],
|
2013-02-27 22:56:31 +01:00
|
|
|
},
|
2015-01-18 22:25:43 +01:00
|
|
|
dependency_links=dependency_links,
|
2014-03-08 13:00:40 +01:00
|
|
|
zip_safe=True,
|
2010-06-12 16:55:24 +02:00
|
|
|
test_suite='proteus.tests',
|
2015-06-01 23:53:18 +02:00
|
|
|
tests_require=[get_require_version('trytond'),
|
|
|
|
|
get_require_version('trytond_party')],
|
2016-02-19 23:16:43 +01:00
|
|
|
use_2to3=True,
|
2013-02-27 22:56:31 +01:00
|
|
|
)
|