2016-03-14 05:26:59 -05:00
|
|
|
#########################################################################
|
|
|
|
#
|
|
|
|
# pgAdmin 4 - PostgreSQL Tools
|
|
|
|
#
|
2020-01-02 08:43:50 -06:00
|
|
|
# Copyright (C) 2013 - 2020, The pgAdmin Development Team
|
2016-03-14 05:26:59 -05:00
|
|
|
# This software is released under the PostgreSQL Licence
|
|
|
|
#
|
|
|
|
##########################################################################
|
|
|
|
|
2020-04-30 02:21:58 -05:00
|
|
|
import builtins
|
2019-03-20 06:17:51 -05:00
|
|
|
import os
|
2016-03-14 05:26:59 -05:00
|
|
|
import sys
|
2020-04-30 02:21:58 -05:00
|
|
|
from codecs import open
|
|
|
|
from importlib.machinery import SourceFileLoader
|
2016-03-14 05:26:59 -05:00
|
|
|
|
|
|
|
from setuptools import setup
|
|
|
|
|
2020-04-30 02:21:58 -05:00
|
|
|
|
|
|
|
# Load a source file
|
|
|
|
def load_source(name, path):
|
|
|
|
if not os.path.exists(path):
|
|
|
|
print("ERROR: Could not find %s" % path)
|
|
|
|
sys.exit(1)
|
|
|
|
|
|
|
|
return SourceFileLoader(name, path).load_module()
|
|
|
|
|
2017-08-25 06:17:47 -05:00
|
|
|
|
|
|
|
# Ensure the global server mode is set.
|
|
|
|
builtins.SERVER_MODE = None
|
|
|
|
|
2016-03-14 05:26:59 -05:00
|
|
|
# Get the requirements list for the current version of Python
|
2019-03-20 06:17:51 -05:00
|
|
|
req_file = '../requirements.txt'
|
2016-03-14 05:26:59 -05:00
|
|
|
|
2020-04-30 02:21:58 -05:00
|
|
|
with open(req_file, 'r') as req_lines:
|
2020-11-26 00:13:08 -06:00
|
|
|
all_requires = req_lines.read().splitlines()
|
2016-03-14 05:26:59 -05:00
|
|
|
|
2020-11-26 00:13:08 -06:00
|
|
|
requires = []
|
|
|
|
extras_require = {}
|
2017-02-26 04:01:23 -06:00
|
|
|
# Remove any requirements with environment specifiers. These
|
|
|
|
# must be explicitly listed in extras_require below.
|
2020-11-26 00:13:08 -06:00
|
|
|
for index, req in enumerate(all_requires):
|
2019-03-20 06:17:51 -05:00
|
|
|
if ";" in req or req.startswith("#") or req == "":
|
2020-11-26 00:13:08 -06:00
|
|
|
# Add the pkgs to extras_require
|
|
|
|
if ";" in req:
|
|
|
|
pkg, env_spec = req.split(";")
|
|
|
|
extras_require[env_spec] = extras_require.get(env_spec, [])
|
|
|
|
extras_require[env_spec].append(pkg)
|
2019-04-11 04:08:44 -05:00
|
|
|
continue
|
|
|
|
|
|
|
|
# Ensure the Wheel will use psycopg2-binary, not the source distro
|
|
|
|
if 'psycopg2' in req:
|
2020-11-26 00:13:08 -06:00
|
|
|
req = req.replace('psycopg2', 'psycopg2-binary')
|
|
|
|
|
|
|
|
requires.append(req)
|
2019-03-20 06:17:51 -05:00
|
|
|
|
2020-04-30 02:21:58 -05:00
|
|
|
# Get the version
|
|
|
|
config = load_source('APP_VERSION', '../web/config.py')
|
2016-03-14 05:26:59 -05:00
|
|
|
|
|
|
|
setup(
|
|
|
|
name='pgadmin4',
|
|
|
|
|
2020-04-30 02:21:58 -05:00
|
|
|
version=config.APP_VERSION,
|
2016-03-14 05:26:59 -05:00
|
|
|
|
|
|
|
description='PostgreSQL Tools',
|
2019-03-20 06:17:51 -05:00
|
|
|
long_description='Administration and management tools for '
|
|
|
|
'the PostgreSQL database.',
|
2016-03-14 05:26:59 -05:00
|
|
|
|
2016-05-21 12:54:12 -05:00
|
|
|
url='https://www.pgadmin.org/',
|
2016-03-14 05:26:59 -05:00
|
|
|
|
|
|
|
author='The pgAdmin Development Team',
|
|
|
|
author_email='pgadmin-hackers@postgresql.org',
|
|
|
|
|
|
|
|
license='PostgreSQL Licence',
|
|
|
|
|
|
|
|
# See https://pypi.python.org/pypi?%3Aaction=list_classifiers
|
|
|
|
classifiers=[
|
2019-03-20 06:17:51 -05:00
|
|
|
'Development Status :: 5 - Production/Stable',
|
|
|
|
|
|
|
|
# Supported programming languages
|
|
|
|
'Programming Language :: Python :: 3.4',
|
|
|
|
'Programming Language :: Python :: 3.5',
|
|
|
|
'Programming Language :: Python :: 3.6',
|
2020-04-24 10:20:25 -05:00
|
|
|
'Programming Language :: Python :: 3.7',
|
|
|
|
'Programming Language :: Python :: 3.8'
|
2019-03-20 06:17:51 -05:00
|
|
|
],
|
2016-03-14 05:26:59 -05:00
|
|
|
|
|
|
|
keywords='pgadmin4,postgresql,postgres',
|
|
|
|
|
2019-03-20 06:17:51 -05:00
|
|
|
packages=["pgadmin4"],
|
2016-03-14 05:26:59 -05:00
|
|
|
|
|
|
|
include_package_data=True,
|
|
|
|
|
2020-04-30 02:21:58 -05:00
|
|
|
install_requires=requires,
|
2016-03-14 05:26:59 -05:00
|
|
|
|
2020-11-26 00:13:08 -06:00
|
|
|
extras_require=extras_require,
|
|
|
|
|
2019-02-12 08:04:45 -06:00
|
|
|
entry_points={
|
2020-05-04 09:28:44 -05:00
|
|
|
'console_scripts': ['pgadmin4=pgadmin4.pgAdmin4:main'],
|
2019-02-12 08:04:45 -06:00
|
|
|
},
|
2016-03-14 05:26:59 -05:00
|
|
|
|
|
|
|
)
|