mirror of
				https://github.com/ets-labs/python-dependency-injector.git
				synced 2025-11-04 09:57:37 +03:00 
			
		
		
		
	Move version number inside dependency_injector package
This commit is contained in:
		
							parent
							
								
									9a9861e4b0
								
							
						
					
					
						commit
						3fac75cb79
					
				| 
						 | 
				
			
			@ -39,6 +39,9 @@ from .utils import ensure_is_catalog_bundle
 | 
			
		|||
from .errors import Error
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
VERSION = '0.10.0'
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
__all__ = (
 | 
			
		||||
    # Catalogs
 | 
			
		||||
    'AbstractCatalog',
 | 
			
		||||
| 
						 | 
				
			
			@ -82,4 +85,7 @@ __all__ = (
 | 
			
		|||
 | 
			
		||||
    # Errors
 | 
			
		||||
    'Error',
 | 
			
		||||
 | 
			
		||||
    # Version
 | 
			
		||||
    'VERSION'
 | 
			
		||||
)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -13,6 +13,7 @@
 | 
			
		|||
# serve to show the default.
 | 
			
		||||
 | 
			
		||||
import os
 | 
			
		||||
import re
 | 
			
		||||
 | 
			
		||||
# 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
 | 
			
		||||
| 
						 | 
				
			
			@ -53,9 +54,9 @@ author = u'Roman Mogilatov'
 | 
			
		|||
# built documents.
 | 
			
		||||
#
 | 
			
		||||
# The short X.Y version.
 | 
			
		||||
# Getting version.
 | 
			
		||||
with open('../VERSION') as version:
 | 
			
		||||
    version = version.read().strip()
 | 
			
		||||
# Getting version:
 | 
			
		||||
with open('../dependency_injector/__init__.py') as init_file:
 | 
			
		||||
    version = re.search('VERSION = \'(.*?)\'', init_file.read()).group(1)
 | 
			
		||||
 | 
			
		||||
# The full version, including alpha/beta/rc tags.
 | 
			
		||||
release = version
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -25,6 +25,7 @@ Development version
 | 
			
		|||
  ``di.Callable`` injections (including args and kwargs).
 | 
			
		||||
- Add optimization for ``di.Injection.value`` property that will compute 
 | 
			
		||||
  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 six 1.10.0.
 | 
			
		||||
- Add minor refactorings and code style fixes.
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -23,6 +23,15 @@ Sources can be cloned from GitHub_:
 | 
			
		|||
Also all *Dependency Injector* releases can be downloaded from 
 | 
			
		||||
`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
 | 
			
		||||
.. _GitHub: https://github.com/rmk135/dependency_injector
 | 
			
		||||
.. _GitHub releases page: https://github.com/rmk135/dependency_injector/releases
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										13
									
								
								setup.py
									
									
									
									
									
								
							
							
						
						
									
										13
									
								
								setup.py
									
									
									
									
									
								
							| 
						 | 
				
			
			@ -1,30 +1,31 @@
 | 
			
		|||
"""`Dependency injector` setup script."""
 | 
			
		||||
 | 
			
		||||
import os
 | 
			
		||||
import re
 | 
			
		||||
 | 
			
		||||
from setuptools import setup
 | 
			
		||||
from setuptools import Command
 | 
			
		||||
 | 
			
		||||
SHORT_DESCRIPTION = 'Dependency injection framework for Python projects'
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Getting description.
 | 
			
		||||
# Getting description:
 | 
			
		||||
with open('README.rst') as readme_file:
 | 
			
		||||
    description = readme_file.read()
 | 
			
		||||
 | 
			
		||||
    # Removing duplicated short description.
 | 
			
		||||
    description = description.replace(SHORT_DESCRIPTION, '')
 | 
			
		||||
 | 
			
		||||
# Getting requirements.
 | 
			
		||||
# Getting requirements:
 | 
			
		||||
with open('requirements.txt') as version:
 | 
			
		||||
    requirements = version.readlines()
 | 
			
		||||
 | 
			
		||||
# Getting version.
 | 
			
		||||
with open('VERSION') as version:
 | 
			
		||||
    version = version.read().strip()
 | 
			
		||||
# Getting version:
 | 
			
		||||
with open('dependency_injector/__init__.py') as init_file:
 | 
			
		||||
    version = re.search('VERSION = \'(.*?)\'', init_file.read()).group(1)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
class PublishCommand(Command):
 | 
			
		||||
 | 
			
		||||
    """Setuptools `publish` command."""
 | 
			
		||||
 | 
			
		||||
    description = "Publish current distribution to PyPi and create tag"
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue
	
	Block a user