fix logging, add cleanbuild command to setup.py

This commit is contained in:
Tom Kralidis
2019-03-05 11:42:08 +00:00
parent 2518d4b0a8
commit 1df6ea69c4
2 changed files with 46 additions and 2 deletions
+1 -1
View File
@@ -77,7 +77,7 @@ class CSVProvider(BaseProvider):
LOGGER.debug('Serializing DictReader')
data_ = csv.DictReader(ff)
if resulttype == 'hits':
LOGGER('Returning hits only')
LOGGER.debug('Returning hits only')
feature_collection['numberMatched'] = len(list(data_))
return feature_collection
LOGGER.debug('Slicing CSV rows')
+45 -1
View File
@@ -31,9 +31,49 @@ import io
import os
import re
from setuptools import Command, find_packages, setup
import shutil
import sys
class PyCleanBuild(Command):
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
remove_files = [
'debian/files',
'debian/python-pygeoapi.debhelper.log',
'debian/python-pygeoapi.postinst.debhelper',
'debian/python-pygeoapi.prerm.debhelper',
'debian/python-pygeoapi.substvars'
]
remove_dirs = [
'debian/python-pygeoapi'
]
for file_ in remove_files:
try:
os.remove(file_)
except OSError:
pass
for dir_ in remove_dirs:
try:
shutil.rmtree(dir_)
except OSError:
pass
for file_ in os.listdir('..'):
if file_.endswith(('.deb', '.build', '.changes')):
os.remove('../{}'.format(file_))
class PyTest(Command):
user_options = []
@@ -134,5 +174,9 @@ setup(
'Programming Language :: Python',
'Topic :: Scientific/Engineering :: GIS'
],
cmdclass={'test': PyTest, 'coverage': PyTest}
cmdclass={
'test': PyTest,
'coverage': PyCoverage,
'cleanbuild': PyCleanBuild
}
)