mirror of
https://github.com/ets-labs/python-dependency-injector.git
synced 2024-11-22 09:36:48 +03:00
Add makefile with publish command
This commit is contained in:
parent
9c9d52b6b1
commit
741af3e67e
6
Makefile
Normal file
6
Makefile
Normal file
|
@ -0,0 +1,6 @@
|
|||
VERSION:=$(shell python setup.py --version)
|
||||
|
||||
publish:
|
||||
python setup.py sdist upload
|
||||
git tag -a $(VERSION) -m 'version $(VERSION)'
|
||||
git push --tags
|
|
@ -10,6 +10,7 @@ follows `Semantic versioning`_
|
|||
Development version
|
||||
-------------------
|
||||
- Remove ``@inject`` decorator.
|
||||
- Add makefile.
|
||||
|
||||
.. - No features.
|
||||
|
||||
|
|
25
setup.py
25
setup.py
|
@ -1,10 +1,8 @@
|
|||
"""`Dependency injector` setup script."""
|
||||
|
||||
import os
|
||||
import re
|
||||
|
||||
from setuptools import setup
|
||||
from setuptools import Command
|
||||
|
||||
|
||||
# Getting description:
|
||||
|
@ -20,26 +18,6 @@ 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"
|
||||
user_options = []
|
||||
|
||||
def initialize_options(self):
|
||||
"""Init options."""
|
||||
|
||||
def finalize_options(self):
|
||||
"""Finalize options."""
|
||||
|
||||
def run(self):
|
||||
"""Command execution."""
|
||||
self.run_command('sdist')
|
||||
self.run_command('upload')
|
||||
os.system('git tag -a {0} -m \'version {0}\''.format(version))
|
||||
os.system('git push --tags')
|
||||
|
||||
|
||||
setup(name='dependency-injector',
|
||||
version=version,
|
||||
description='Dependency injection microframework for Python',
|
||||
|
@ -58,9 +36,6 @@ setup(name='dependency-injector',
|
|||
platforms=['any'],
|
||||
zip_safe=True,
|
||||
install_requires=requirements,
|
||||
cmdclass={
|
||||
'publish': PublishCommand,
|
||||
},
|
||||
keywords=[
|
||||
'DI',
|
||||
'Dependency injection',
|
||||
|
|
Loading…
Reference in New Issue
Block a user