Move version number inside dependency_injector package

This commit is contained in:
Roman Mogilatov 2015-10-23 15:20:25 +03:00
parent 9a9861e4b0
commit 3fac75cb79
6 changed files with 27 additions and 10 deletions

View File

@ -1 +0,0 @@
0.9.5

View File

@ -39,6 +39,9 @@ from .utils import ensure_is_catalog_bundle
from .errors import Error from .errors import Error
VERSION = '0.10.0'
__all__ = ( __all__ = (
# Catalogs # Catalogs
'AbstractCatalog', 'AbstractCatalog',
@ -82,4 +85,7 @@ __all__ = (
# Errors # Errors
'Error', 'Error',
# Version
'VERSION'
) )

View File

@ -13,6 +13,7 @@
# serve to show the default. # serve to show the default.
import os import os
import re
# If extensions (or modules to document with autodoc) are in another directory, # If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the # add these directories to sys.path here. If the directory is relative to the
@ -53,9 +54,9 @@ author = u'Roman Mogilatov'
# built documents. # built documents.
# #
# The short X.Y version. # The short X.Y version.
# Getting version. # Getting version:
with open('../VERSION') as version: with open('../dependency_injector/__init__.py') as init_file:
version = version.read().strip() version = re.search('VERSION = \'(.*?)\'', init_file.read()).group(1)
# The full version, including alpha/beta/rc tags. # The full version, including alpha/beta/rc tags.
release = version release = version

View File

@ -25,6 +25,7 @@ Development version
``di.Callable`` injections (including args and kwargs). ``di.Callable`` injections (including args and kwargs).
- Add optimization for ``di.Injection.value`` property that will compute - Add optimization for ``di.Injection.value`` property that will compute
type of injection once, instead of doing this on every call. type of injection once, instead of doing this on every call.
- Add ``di.VERSION`` constant for verification of currently installed version.
- Add support of Python 3.5. - Add support of Python 3.5.
- Add support of six 1.10.0. - Add support of six 1.10.0.
- Add minor refactorings and code style fixes. - Add minor refactorings and code style fixes.

View File

@ -23,6 +23,15 @@ Sources can be cloned from GitHub_:
Also all *Dependency Injector* releases can be downloaded from Also all *Dependency Injector* releases can be downloaded from
`GitHub releases page`_. `GitHub releases page`_.
Verification of currently installed version could be done using ``di.VERSION``
constant:
.. code-block:: bash
>>> import dependency_injector as di
>>> di.VERSION
'0.10.0'
.. _PyPi: https://pypi.python.org/pypi/dependency_injector .. _PyPi: https://pypi.python.org/pypi/dependency_injector
.. _GitHub: https://github.com/rmk135/dependency_injector .. _GitHub: https://github.com/rmk135/dependency_injector
.. _GitHub releases page: https://github.com/rmk135/dependency_injector/releases .. _GitHub releases page: https://github.com/rmk135/dependency_injector/releases

View File

@ -1,30 +1,31 @@
"""`Dependency injector` setup script.""" """`Dependency injector` setup script."""
import os import os
import re
from setuptools import setup from setuptools import setup
from setuptools import Command from setuptools import Command
SHORT_DESCRIPTION = 'Dependency injection framework for Python projects' SHORT_DESCRIPTION = 'Dependency injection framework for Python projects'
# Getting description. # Getting description:
with open('README.rst') as readme_file: with open('README.rst') as readme_file:
description = readme_file.read() description = readme_file.read()
# Removing duplicated short description. # Removing duplicated short description.
description = description.replace(SHORT_DESCRIPTION, '') description = description.replace(SHORT_DESCRIPTION, '')
# Getting requirements. # Getting requirements:
with open('requirements.txt') as version: with open('requirements.txt') as version:
requirements = version.readlines() requirements = version.readlines()
# Getting version. # Getting version:
with open('VERSION') as version: with open('dependency_injector/__init__.py') as init_file:
version = version.read().strip() version = re.search('VERSION = \'(.*?)\'', init_file.read()).group(1)
class PublishCommand(Command): class PublishCommand(Command):
"""Setuptools `publish` command.""" """Setuptools `publish` command."""
description = "Publish current distribution to PyPi and create tag" description = "Publish current distribution to PyPi and create tag"