mirror of https://github.com/flaggo/pydu.git
fix install error on Windows
This commit is contained in:
parent
2362bae8a0
commit
4b5a307dd2
|
@ -0,0 +1 @@
|
|||
include requirements-dev.txt
|
|
@ -2,7 +2,7 @@
|
|||
Useful data structures, utils for Python.
|
||||
"""
|
||||
|
||||
__version__ = '0.1.0'
|
||||
__version__ = '0.1.1'
|
||||
|
||||
|
||||
# Set logging handler to avoid "No handler found" warnings.
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
pytest
|
||||
pytest>=2.8.0
|
||||
pytest-xdist
|
||||
coveralls
|
||||
HTTPretty==0.8.14
|
||||
HTTPretty==0.8.14
|
||||
|
|
|
@ -1,2 +1,5 @@
|
|||
[aliases]
|
||||
test=pytest
|
||||
[bdist_wheel]
|
||||
universal = 1
|
||||
|
||||
[metadata]
|
||||
license_file = LICENSE.txt
|
||||
|
|
35
setup.py
35
setup.py
|
@ -1,5 +1,37 @@
|
|||
import sys
|
||||
from pydu import __version__
|
||||
from setuptools import setup, find_packages
|
||||
from setuptools.command.test import test as TestCommand
|
||||
|
||||
|
||||
class PyTest(TestCommand):
|
||||
user_options = [('pytest-args=', 'a', "Arguments to pass into py.test")]
|
||||
|
||||
def initialize_options(self):
|
||||
TestCommand.initialize_options(self)
|
||||
try:
|
||||
from multiprocessing import cpu_count
|
||||
self.pytest_args = ['-n', str(cpu_count()), '--boxed']
|
||||
except (ImportError, NotImplementedError):
|
||||
self.pytest_args = ['-n', '1', '--boxed']
|
||||
|
||||
def finalize_options(self):
|
||||
TestCommand.finalize_options(self)
|
||||
self.test_args = []
|
||||
self.test_suite = True
|
||||
|
||||
def run_tests(self):
|
||||
import pytest
|
||||
|
||||
errno = pytest.main(self.pytest_args)
|
||||
sys.exit(errno)
|
||||
|
||||
|
||||
test_requirements = []
|
||||
for line in open('requirements-dev.txt'):
|
||||
requirement = line.strip()
|
||||
if requirement:
|
||||
test_requirements.append(requirement)
|
||||
|
||||
|
||||
setup(
|
||||
|
@ -11,7 +43,8 @@ setup(
|
|||
author_email='wangbinxin001@126.com',
|
||||
license='MIT License',
|
||||
url="https://github.com/Prodesire/pydu",
|
||||
setup_requires=['pytest-runner'],
|
||||
cmdclass={'test': PyTest},
|
||||
tests_require=test_requirements,
|
||||
packages=find_packages(),
|
||||
classifiers=[
|
||||
'Operating System :: OS Independent',
|
||||
|
|
Loading…
Reference in New Issue