Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setup.py pass flake8 #73

Merged
merged 1 commit into from
Dec 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,
)