Files
tryton/trytond-gis/setup.py
T

93 lines
2.7 KiB
Python
Raw Normal View History

2018-06-26 19:56:17 +02:00
#!/usr/bin/env python3
2018-01-05 17:35:04 +01:00
# This file is part of trytond_gis. The COPYRIGHT file at the top level of
# this repository contains the full copyright notices and license terms.
import io
import os
import re
2021-12-11 17:58:45 +01:00
from setuptools import find_packages, setup
2018-01-05 17:35:04 +01:00
def read(fname):
return io.open(
os.path.join(os.path.dirname(__file__), fname),
'r', encoding='utf-8').read()
2022-10-27 13:24:22 +02:00
def readme():
content = read('README.rst')
content = re.sub(
r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content)
return content
2018-01-05 17:35:04 +01:00
def get_require_version(name):
2022-12-24 13:45:10 +01:00
require = '%s >= %s.%s, < %s.%s'
2018-01-05 17:35:04 +01:00
require %= (name, major_version, minor_version,
major_version, minor_version + 1)
return require
def get_version():
init = read(os.path.join('trytond_gis', '__init__.py'))
return re.search('__version__ = "([0-9.]*)"', init).group(1)
2018-06-26 19:56:17 +02:00
2018-01-05 17:35:04 +01:00
version = get_version()
major_version, minor_version, _ = version.split('.', 2)
major_version = int(major_version)
minor_version = int(minor_version)
name = 'trytond_gis'
2022-12-24 13:45:10 +01:00
if minor_version % 2:
download_url = ''
else:
download_url = 'http://downloads.tryton.org/%s.%s/' % (
major_version, minor_version)
2018-01-05 17:35:04 +01:00
2018-01-05 18:53:40 +01:00
requires = ['geomet', get_require_version('trytond'), 'psycopg2 >= 2.0.14']
2018-01-05 17:35:04 +01:00
setup(name=name,
version=version,
description='Adds Geographic Information System support to trytond',
2022-10-27 13:24:22 +02:00
long_description=readme(),
2018-01-05 17:35:04 +01:00
author='Tryton',
2022-12-24 13:45:10 +01:00
author_email='foundation@tryton.org',
2018-01-05 17:35:04 +01:00
url='http://www.tryton.org/',
download_url=download_url,
2019-04-06 17:38:58 +02:00
project_urls={
"Bug Tracker": 'https://bugs.tryton.org/',
2022-12-24 13:45:10 +01:00
"Documentation": 'https://docs.tryton.org/projects/backend-gis',
2019-04-06 17:38:58 +02:00
"Forum": 'https://www.tryton.org/forum',
2022-12-24 13:45:10 +01:00
"Source Code": 'https://code.tryton.org/tryton',
2019-04-06 17:38:58 +02:00
},
2018-01-05 17:35:04 +01:00
keywords='tryton GIS',
packages=find_packages(),
classifiers=[
'Framework :: Tryton',
'Intended Audience :: Developers',
'License :: OSI Approved :: GNU General Public License (GPL)',
'Operating System :: OS Independent',
2019-04-07 19:50:05 +02:00
'Programming Language :: Python :: 3',
2020-03-19 19:17:44 +01:00
'Programming Language :: Python :: 3.8',
2020-12-19 17:08:48 +01:00
'Programming Language :: Python :: 3.9',
2021-12-18 16:34:37 +01:00
'Programming Language :: Python :: 3.10',
2023-01-27 11:02:47 +01:00
'Programming Language :: Python :: 3.11',
2023-10-22 19:40:55 +02:00
'Programming Language :: Python :: 3.12',
2018-01-05 17:35:04 +01:00
'Topic :: Software Development :: Libraries :: Python Modules'
],
platforms='any',
license='GPL-3',
2023-01-29 20:36:51 +01:00
python_requires='>=3.8',
2018-01-05 17:35:04 +01:00
install_requires=requires,
entry_points={
'trytond.backend': [
'postgis = trytond_gis.postgis',
],
'trytond.tests': [
'test_geographic_fields = trytond_gis.tests',
],
},
zip_safe=False,
)