diff --git a/docs/conf.py b/docs/conf.py index 3e2d3af9..018f77c3 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -57,7 +57,7 @@ author = u'ETS Labs' # The short X.Y version. # Getting version: with open('../src/dependency_injector/__init__.py') as init_file: - version = re.search('VERSION = \'(.*?)\'', init_file.read()).group(1) + version = re.search('__version__ = \'(.*?)\'', init_file.read()).group(1) # The full version, including alpha/beta/rc tags. release = version diff --git a/docs/main/changelog.rst b/docs/main/changelog.rst index fbd34f81..7949cd36 100644 --- a/docs/main/changelog.rst +++ b/docs/main/changelog.rst @@ -11,6 +11,10 @@ Development version ------------------- - No features. +3.2.2 +----- +- Change name of version variable to follow PEP8: ``VERSION`` -> ``__version__``. + 3.2.1 ----- - Update ``services`` miniapp example. diff --git a/docs/main/installation.rst b/docs/main/installation.rst index abfff964..b3956207 100644 --- a/docs/main/installation.rst +++ b/docs/main/installation.rst @@ -12,7 +12,7 @@ framework can be installed from PyPi_: pip install dependency_injector # Installing particular version: - pip install dependency-injector==3.0.0 + pip install dependency-injector==3.2.2 .. note:: Some components of *Dependency Injector* are implemented as C extension types. @@ -33,9 +33,9 @@ Verification of currently installed version could be done using .. code-block:: bash - >>> from dependency_injector import VERSION - >>> VERSION - '3.0.0' + >>> import dependency_injector + >>> dependency_injector.__version__ + '3.2.2' .. _PyPi: https://pypi.python.org/pypi/dependency_injector .. _GitHub: https://github.com/ets-labs/python-dependency-injector diff --git a/setup.py b/setup.py index bdb74e3f..cc4b1450 100644 --- a/setup.py +++ b/setup.py @@ -14,12 +14,12 @@ with open('README.rst') as readme_file: description = readme_file.read() # Getting requirements: -with open('requirements.txt') as version: - requirements = version.readlines() +with open('requirements.txt') as requirements_file: + requirements = requirements_file.readlines() # Getting version: with open('src/dependency_injector/__init__.py') as init_file: - version = re.search('VERSION = \'(.*?)\'', init_file.read()).group(1) + version = re.search('__version__ = \'(.*?)\'', init_file.read()).group(1) # Adding debug options: if os.environ.get('DEPENDENCY_INJECTOR_DEBUG_MODE') == '1': diff --git a/src/dependency_injector/__init__.py b/src/dependency_injector/__init__.py index d6a44fb8..7b62bf08 100644 --- a/src/dependency_injector/__init__.py +++ b/src/dependency_injector/__init__.py @@ -1,6 +1,6 @@ """Dependency injector top-level package.""" -VERSION = '3.2.1' +__version__ = '3.2.2' """Version number that follows semantic versioning. :type: str diff --git a/tests/unit/test_common.py b/tests/unit/test_common.py index dfa915d3..3947da4c 100644 --- a/tests/unit/test_common.py +++ b/tests/unit/test_common.py @@ -2,10 +2,10 @@ import unittest2 as unittest -from dependency_injector import VERSION +from dependency_injector import __version__ class VersionTest(unittest.TestCase): def test_version_follows_semantic_versioning(self): - self.assertEquals(len(VERSION.split('.')), 3) + self.assertEquals(len(__version__.split('.')), 3)