Skip to content

Commit

Permalink
move __version__ to __init__.py so we don't have to modify the mock.p…
Browse files Browse the repository at this point in the history
…y from cpython.
  • Loading branch information
cjw296 committed Jan 13, 2020
1 parent b935baf commit 28e6ddd
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
7 changes: 6 additions & 1 deletion mock/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
from __future__ import absolute_import
import mock.mock as _mock
from mock.mock import *
__all__ = _mock.__all__

__version__ = '4.0.0b1'
version_info = tuple(int(p) for p in __version__.split('.'))


__all__ = ('__version__', 'version_info') + _mock.__all__
4 changes: 0 additions & 4 deletions mock/mock.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@
from __future__ import absolute_import

__all__ = (
'__version__',
'version_info',
'Mock',
'MagicMock',
'patch',
Expand Down Expand Up @@ -69,8 +67,6 @@
import six
from six import wraps

__version__ = '3.0.5'
version_info = tuple(int(p) for p in __version__.split('.'))

import mock

Expand Down
2 changes: 1 addition & 1 deletion release.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def news_to_changelog(version):


def update_version(new_version):
path = join('mock', 'mock.py')
path = join('mock', '__init__.py')
with open(path) as source:
text = source.read()

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@

setuptools.setup(
version=re.search("__version__ = '([^']+)'",
open(join('mock', 'mock.py')).read()).group(1),
open(join('mock', '__init__.py')).read()).group(1),
long_description=open('README.rst').read(),
)

0 comments on commit 28e6ddd

Please sign in to comment.