mirror of
https://github.com/zoriya/guessit.git
synced 2026-06-06 03:45:07 +00:00
Make python setup.py test works on an new environment
This commit is contained in:
@@ -5,6 +5,7 @@ dist/
|
||||
|
||||
# Python dist
|
||||
*.egg-info/
|
||||
.eggs/
|
||||
|
||||
# Coverage
|
||||
.coverage
|
||||
@@ -15,6 +16,9 @@ dist/
|
||||
# Tox
|
||||
.tox/
|
||||
|
||||
# py.test
|
||||
lastfailed
|
||||
|
||||
# Jetbrain
|
||||
*.iml
|
||||
.idea/
|
||||
|
||||
+1
-1
@@ -1,2 +1,2 @@
|
||||
[pytest]
|
||||
addopts =-s --ignore=setup.py --doctest-modules --doctest-glob='README.rst'
|
||||
addopts =-s --ignore=setup.py --ignore=build --doctest-modules --doctest-glob='README.rst'
|
||||
|
||||
@@ -13,7 +13,9 @@ HISTORY = open(os.path.join(here, 'HISTORY.rst')).read()
|
||||
|
||||
install_requires = ['rebulk>=0.4.1', 'regex', 'babelfish>=0.5.5', 'python-dateutil']
|
||||
|
||||
tests_require = ['pytest', 'pyyaml']
|
||||
setup_requires=['pytest-runner']
|
||||
|
||||
tests_require = ['pytest', 'PyYAML']
|
||||
|
||||
entry_points = {
|
||||
'console_scripts': [
|
||||
@@ -22,22 +24,6 @@ entry_points = {
|
||||
}
|
||||
|
||||
|
||||
class PyTest(TestCommand):
|
||||
user_options = [('pytest-args=', 'a', "Arguments to pass to py.test")]
|
||||
|
||||
def initialize_options(self):
|
||||
TestCommand.initialize_options(self)
|
||||
self.pytest_args = ['--ignore=setup.py', '--doctest-modules']
|
||||
|
||||
def finalize_options(self):
|
||||
TestCommand.finalize_options(self)
|
||||
self.test_args = []
|
||||
|
||||
def run(self):
|
||||
import pytest
|
||||
errno = pytest.main(self.pytest_args)
|
||||
exit(errno)
|
||||
|
||||
exec(open("guessit/__version__.py").read()) # load version without importing guessit
|
||||
|
||||
args = dict(name='guessit',
|
||||
@@ -65,9 +51,9 @@ args = dict(name='guessit',
|
||||
download_url='https://pypi.python.org/packages/source/g/guessit/guessit-%s.tar.gz' % __version__,
|
||||
license='LGPLv3',
|
||||
packages=find_packages(),
|
||||
cmdclass={"test": PyTest},
|
||||
include_package_data=True,
|
||||
install_requires=install_requires,
|
||||
setup_requires=setup_requires,
|
||||
tests_require=tests_require,
|
||||
entry_points=entry_points,
|
||||
test_suite='guessit.test',
|
||||
|
||||
Reference in New Issue
Block a user