Apply codestyle checks to all Python code.

This commit is contained in:
Dave Page
2019-03-20 11:17:51 +00:00
parent 6a8367beb9
commit bb1e908b54
7 changed files with 129 additions and 112 deletions

View File

@@ -7,8 +7,8 @@
#
##########################################################################
import os
import sys
import imp
from setuptools import setup
from codecs import open
@@ -24,7 +24,7 @@ builtins.SERVER_MODE = None
"""This script helps to generate PIP packages"""
# Get the requirements list for the current version of Python
req_file='../requirements.txt'
req_file = '../requirements.txt'
with open(req_file, 'r') as reqf:
if sys.version_info[0] >= 3:
@@ -34,12 +34,31 @@ with open(req_file, 'r') as reqf:
# Remove any requirements with environment specifiers. These
# must be explicitly listed in extras_require below.
for req in required:
if ";" in req:
for index, req in enumerate(required):
if ";" in req or req.startswith("#") or req == "":
required.remove(req)
# Get the app version
modl = imp.load_source('APP_VERSION', '../web/config.py')
if sys.version_info[:2] >= (3, 3):
from importlib.machinery import SourceFileLoader
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()
else:
import imp
def load_source(name, path):
if not os.path.exists(path):
print("ERROR: Could not find %s" % path)
sys.exit(1)
return imp.load_source(name, path)
modl = load_source('APP_VERSION', '../web/config.py')
setup(
name='pgadmin4',
@@ -47,38 +66,32 @@ setup(
version=modl.APP_VERSION,
description='PostgreSQL Tools',
long_description='Administration and management tools for the PostgreSQL database.',
long_description='Administration and management tools for '
'the PostgreSQL database.',
url='https://www.pgadmin.org/',
# Author details
author='The pgAdmin Development Team',
author_email='pgadmin-hackers@postgresql.org',
# Choose your license
license='PostgreSQL Licence',
# See https://pypi.python.org/pypi?%3Aaction=list_classifiers
classifiers=[
# 3 - Alpha
# 4 - Beta
# 5 - Production/Stable
'Development Status :: 5 - Production/Stable',
'Development Status :: 5 - Production/Stable',
# Supported programming languages
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6'
],
# Supported programming languages
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7'
],
keywords='pgadmin4,postgresql,postgres',
# Specify package names here.
packages=["pgadmin4",],
packages=["pgadmin4"],
# To include additional files within the package
include_package_data=True,
install_requires=required,
@@ -89,13 +102,6 @@ setup(
],
},
# Specify data files to be included.
##package_data="",
# To package data files outside package directory.
##data_files=,
# 'scripts' keyword is used to provide executable scripts. It provides cross-platform support.
entry_points={
'console_scripts': ['pgadmin4=pgadmin4.pgAdmin4.__init__:main'],
},