File tree Expand file tree Collapse file tree 3 files changed +14
-27
lines changed Expand file tree Collapse file tree 3 files changed +14
-27
lines changed Original file line number Diff line number Diff line change 4747# |version| and |release|, also used in various other places throughout the
4848# built documents.
4949#
50- import pytestqt
50+ import re
51+ with open ('../pytestqt/__init__.py' ) as f :
52+ m = re .search ("version = '(.*)'" , f .read ())
53+ assert m is not None
54+ version = m .group (1 )
5155# The short X.Y version.
52- version = pytestqt .version
5356# The full version, including alpha/beta/rc tags.
54- release = pytestqt . version
57+ release = version
5558
5659# The language for content autogenerated by Sphinx. Refer to documentation
5760# for a list of supported languages.
Original file line number Diff line number Diff line change @@ -26,4 +26,5 @@ def test_hello(qtbot):
2626
2727'''
2828
29- version = __version__ = '1.4.0'
29+ version = '1.4.0'
30+ __version__ = version
Original file line number Diff line number Diff line change 1- import sys
1+ import re
22
33from setuptools import setup
4- from setuptools .command .test import test as TestCommand
54
6- import pytestqt
75
8-
9- class PyTest (TestCommand ):
10- """
11- Overrides setup "test" command, taken from here:
12- http://pytest.org/latest/goodpractises.html
13- """
14-
15- def finalize_options (self ):
16- TestCommand .finalize_options (self )
17- self .test_args = []
18- self .test_suite = True
19-
20- def run_tests (self ):
21- # import here, cause outside the eggs aren't loaded
22- import pytest
23-
24- errno = pytest .main ([])
25- sys .exit (errno )
6+ with open ('pytestqt/__init__.py' ) as f :
7+ m = re .search ("version = '(.*)'" , f .read ())
8+ assert m is not None
9+ version = m .group (1 )
2610
2711
2812setup (
2913 name = "pytest-qt" ,
30- version = pytestqt . version ,
14+ version = version ,
3115 packages = ['pytestqt' ],
3216 entry_points = {
3317 'pytest11' : ['pytest-qt = pytestqt.plugin' ],
@@ -56,5 +40,4 @@ def run_tests(self):
5640 'Topic :: Software Development :: User Interfaces' ,
5741 ],
5842 tests_requires = ['pytest' ],
59- cmdclass = {'test' : PyTest },
6043)
You can’t perform that action at this time.
0 commit comments