Skip to content

Commit d65e81e

Browse files
committed
Get the setup.py version from __version__.py
1 parent 2e401b8 commit d65e81e

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

seleniumbase/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from seleniumbase.__version__ import __version__ # noqa
12
from seleniumbase.fixtures.base_case import BaseCase # noqa
23
from seleniumbase.masterqa.master_qa import MasterQA # noqa
34
from seleniumbase.common import decorators # noqa

seleniumbase/__version__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# seleniumbase package
2+
__version__ = "1.49.26"

setup.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@
88
import sys
99

1010

11-
this_directory = os.path.abspath(os.path.dirname(__file__))
11+
this_dir = os.path.abspath(os.path.dirname(__file__))
1212
long_description = None
1313
total_description = None
1414
try:
15-
with open(os.path.join(this_directory, 'README.md'), 'rb') as f:
15+
with open(os.path.join(this_dir, 'README.md'), 'rb') as f:
1616
total_description = f.read().decode('utf-8')
1717
description_lines = total_description.split('\n')
1818
long_description_lines = []
@@ -22,6 +22,11 @@
2222
long_description = "\n".join(long_description_lines)
2323
except IOError:
2424
long_description = 'Reliable Browser Automation & Testing Framework'
25+
about = {}
26+
# Get the package version from the seleniumbase/__version__.py file
27+
with open(os.path.join(
28+
this_dir, 'seleniumbase', '__version__.py'), 'rb') as f:
29+
exec(f.read().decode('utf-8'), about)
2530

2631
if sys.argv[-1] == 'publish':
2732
reply = None
@@ -54,7 +59,7 @@
5459

5560
setup(
5661
name='seleniumbase',
57-
version='1.49.26',
62+
version=about['__version__'],
5863
description='A complete framework for Web-UI testing | seleniumbase.io',
5964
long_description=long_description,
6065
long_description_content_type='text/markdown',

0 commit comments

Comments
 (0)