Skip to content

Commit 0c779ea

Browse files
committed
global: renaming core to ext and pytest-runner
* Updates package structure with pytest-runner and renames core to ext. Signed-off-by: Jiri Kuncar <[email protected]>
1 parent 502447a commit 0c779ea

File tree

7 files changed

+13
-41
lines changed

7 files changed

+13
-41
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,6 @@ docs/_build/
5555

5656
# PyBuilder
5757
target/
58+
59+
# Tests
60+
tests/test.db

docs/api.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
API Docs
2626
========
2727

28-
.. automodule:: invenio_db.core
28+
.. automodule:: invenio_db.ext
2929
:members:
3030
:undoc-members:
3131

invenio_db/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ class User(db.Model):
8888

8989
from __future__ import absolute_import, print_function
9090

91-
from .core import InvenioDB
91+
from .ext import InvenioDB
9292
from .shared import db
9393
from .version import __version__
9494

File renamed without changes.

run-tests.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,5 @@ pydocstyle invenio_db && \
2626
isort -rc -c -df **/*.py && \
2727
check-manifest --ignore ".travis-*" && \
2828
sphinx-build -qnNW docs docs/_build/html && \
29-
python setup.py test -a'-vv' && \
29+
python setup.py test && \
3030
sphinx-build -qnNW -b doctest docs docs/_build/doctest

setup.cfg

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# -*- coding: utf-8 -*-
22
#
33
# This file is part of Invenio.
4-
# Copyright (C) 2015 CERN.
4+
# Copyright (C) 2015, 2016 CERN.
55
#
66
# Invenio is free software; you can redistribute it
77
# and/or modify it under the terms of the GNU General Public License as
@@ -23,6 +23,9 @@
2323
# as an Intergovernmental Organization or submit itself to any jurisdiction.
2424

2525

26+
[aliases]
27+
test = pytest
28+
2629
[build_sphinx]
2730
source-dir = docs/
2831
build-dir = docs/_build

setup.py

+3-37
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,14 @@
2828
import sys
2929

3030
from setuptools import find_packages, setup
31-
from setuptools.command.test import test as TestCommand
3231

3332
readme = open('README.rst').read()
3433
history = open('CHANGES.rst').read()
3534

3635
tests_require = [
3736
'check-manifest>=0.25',
3837
'coverage>=4.0',
39-
'isort>=4.0.0',
38+
'isort>=4.2.2',
4039
'mock>=1.3.0',
4140
'pydocstyle>=1.0.0',
4241
'pytest-cache>=1.0',
@@ -67,6 +66,7 @@
6766

6867
setup_requires = [
6968
'Babel>=1.3',
69+
'pytest-runner>=2.6.2',
7070
]
7171

7272
install_requires = [
@@ -79,39 +79,6 @@
7979
packages = find_packages()
8080

8181

82-
class PyTest(TestCommand):
83-
"""PyTest Test."""
84-
85-
user_options = [('pytest-args=', 'a', "Arguments to pass to py.test")]
86-
87-
def initialize_options(self):
88-
"""Init pytest."""
89-
TestCommand.initialize_options(self)
90-
self.pytest_args = []
91-
try:
92-
from ConfigParser import ConfigParser
93-
except ImportError:
94-
from configparser import ConfigParser
95-
config = ConfigParser()
96-
config.read('pytest.ini')
97-
self.pytest_args = config.get('pytest', 'addopts').split(' ')
98-
99-
def finalize_options(self):
100-
"""Finalize pytest."""
101-
TestCommand.finalize_options(self)
102-
if hasattr(self, '_test_args'):
103-
self.test_suite = ''
104-
else:
105-
self.test_args = []
106-
self.test_suite = True
107-
108-
def run_tests(self):
109-
"""Run tests."""
110-
# import here, cause outside the eggs aren't loaded
111-
import pytest
112-
errno = pytest.main(self.pytest_args)
113-
sys.exit(errno)
114-
11582
# Get the version string. Cannot be done with import!
11683
g = {}
11784
with open(os.path.join('invenio_db', 'version.py'), 'rt') as fp:
@@ -123,7 +90,7 @@ def run_tests(self):
12390
version=version,
12491
description=__doc__,
12592
long_description=readme + '\n\n' + history,
126-
keywords='invenio',
93+
keywords='invenio database',
12794
license='GPLv2',
12895
author='Invenio Collaboration',
12996
author_email='[email protected]',
@@ -160,5 +127,4 @@ def run_tests(self):
160127
'Programming Language :: Python :: 3.5',
161128
'Development Status :: 1 - Planning',
162129
],
163-
cmdclass={'test': PyTest},
164130
)

0 commit comments

Comments
 (0)