fix logging, add cleanbuild command to setup.py
This commit is contained in:
@@ -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')
|
||||
|
||||
@@ -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
|
||||
}
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user