Skip to content

Commit

Permalink
setup.py pass flake8
Browse files Browse the repository at this point in the history
  • Loading branch information
waketzheng committed Dec 7, 2020
1 parent 5a402ef commit e66063b
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 28 deletions.
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,7 @@ sync:
local-sync:
pipenv run python local-sync.py $(ADCODE_DIR)

.PHONY: sync local-sync
test:
pipenv run python setup.py test

.PHONY: sync local-sync
55 changes: 28 additions & 27 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
# -*- coding: utf-8 -*-
import sys
from pathlib import Path
from setuptools import setup
from setuptools.command.test import test as TestCommand
import os
import sys

import cpca


class PyTest(TestCommand):

def initialize_options(self):
TestCommand.initialize_options(self)
super().initialize_options()
self.pytest_args = []
# try:
# from multiprocessing import cpu_count
Expand All @@ -18,7 +19,7 @@ def initialize_options(self):
# self.pytest_args = ['-n', '1', '--boxed']

def finalize_options(self):
TestCommand.finalize_options(self)
super().finalize_options()
self.test_args = []
self.test_suite = True

Expand All @@ -28,27 +29,24 @@ def run_tests(self):
sys.exit(errno)


def read_rst(f):
return open(f, 'r', encoding='utf-8').read()


README = os.path.join(os.path.dirname(__file__), 'README.rst')
README = Path(__file__).parent / 'README.rst'

requires = [
'pandas',
'pyahocorasick'
]
]


setup(name='cpca',
version=cpca.__version__,
description='Chinese Province, City and Area Recognition Utilities',
long_description=read_rst(README),
author='DQinYuan',
author_email='sa517067@mail.ustc.edu.cn',
url='https://github.com/DQinYuan/chinese_province_city_area_mapper',
license="MIT",
classifiers=[
setup(
name='cpca',
version=cpca.__version__,
description='Chinese Province, City and Area Recognition Utilities',
long_description=README.read_text(),
author='DQinYuan',
author_email='sa517067@mail.ustc.edu.cn',
url='https://github.com/DQinYuan/chinese_province_city_area_mapper',
license="MIT",
classifiers=[
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
Expand All @@ -57,12 +55,15 @@ def read_rst(f):
'Topic :: Text Processing',
'Topic :: Text Processing :: Indexing',
],
keywords='Simplified Chinese,Chinese geographic information,Chinese province city and area recognition and map',
packages=['cpca', 'cpca.resources'],
# 通过python setup.py test可以执行所有的单元测试
cmdclass={'test': PyTest},
package_dir={'cpca': 'cpca', 'cpca.resources': 'cpca/resources'},
package_data={'': ['*.csv']},
include_package_data=True,
install_requires=requires,
keywords=(
'Simplified Chinese,'
'Chinese geographic information,'
'Chinese province city and area recognition and map'),
packages=['cpca', 'cpca.resources'],
# 通过python setup.py test可以执行所有的单元测试
cmdclass={'test': PyTest},
package_dir={'cpca': 'cpca', 'cpca.resources': 'cpca/resources'},
package_data={'': ['*.csv']},
include_package_data=True,
install_requires=requires,
)

0 comments on commit e66063b

Please sign in to comment.