Add makefile with publish command

This commit is contained in:
Roman Mogilatov 2016-10-30 14:41:33 +02:00
parent 9c9d52b6b1
commit 741af3e67e
3 changed files with 7 additions and 25 deletions

6
Makefile Normal file
View 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

View File

@ -10,6 +10,7 @@ follows `Semantic versioning`_
Development version Development version
------------------- -------------------
- Remove ``@inject`` decorator. - Remove ``@inject`` decorator.
- Add makefile.
.. - No features. .. - No features.

View File

@ -1,10 +1,8 @@
"""`Dependency injector` setup script.""" """`Dependency injector` setup script."""
import os
import re import re
from setuptools import setup from setuptools import setup
from setuptools import Command
# Getting description: # Getting description:
@ -20,26 +18,6 @@ with open('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)
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', setup(name='dependency-injector',
version=version, version=version,
description='Dependency injection microframework for Python', description='Dependency injection microframework for Python',
@ -58,9 +36,6 @@ setup(name='dependency-injector',
platforms=['any'], platforms=['any'],
zip_safe=True, zip_safe=True,
install_requires=requirements, install_requires=requirements,
cmdclass={
'publish': PublishCommand,
},
keywords=[ keywords=[
'DI', 'DI',
'Dependency injection', 'Dependency injection',