2015-01-04 16:54:25 +03:00
|
|
|
"""
|
|
|
|
`Objects` setup script.
|
|
|
|
"""
|
|
|
|
|
2015-04-03 16:11:05 +03:00
|
|
|
import os
|
2015-01-04 16:54:25 +03:00
|
|
|
from setuptools import setup
|
2015-04-03 16:11:05 +03:00
|
|
|
from setuptools import Command
|
2015-01-04 16:54:25 +03:00
|
|
|
|
|
|
|
|
2015-04-14 20:18:25 +03:00
|
|
|
SHORT_DESCRIPTION = 'Dependency injector for Python projects'
|
2015-04-03 01:01:05 +03:00
|
|
|
|
|
|
|
|
2015-01-04 16:54:25 +03:00
|
|
|
# Getting description.
|
2015-04-03 00:31:26 +03:00
|
|
|
with open('README.rst') as readme_file:
|
|
|
|
description = readme_file.read()
|
2015-01-05 12:11:21 +03:00
|
|
|
|
2015-04-03 16:11:05 +03:00
|
|
|
# Removing duplicated short description.
|
|
|
|
description = description.replace(SHORT_DESCRIPTION, '')
|
2015-04-03 01:01:05 +03:00
|
|
|
|
2015-01-04 16:54:25 +03:00
|
|
|
|
|
|
|
# Getting requirements.
|
|
|
|
with open('requirements.txt') as version:
|
|
|
|
requirements = version.readlines()
|
|
|
|
|
|
|
|
|
|
|
|
# Getting version.
|
|
|
|
with open('VERSION') as version:
|
|
|
|
version = version.read().strip()
|
|
|
|
|
|
|
|
|
2015-04-03 16:11:05 +03:00
|
|
|
class PublishCommand(Command):
|
|
|
|
|
|
|
|
"""Setuptools `publish` command."""
|
|
|
|
|
|
|
|
description = "Publish current distribution to PyPi and create tag"
|
2015-04-03 16:18:37 +03:00
|
|
|
user_options = []
|
2015-04-03 16:11:05 +03:00
|
|
|
|
|
|
|
def initialize_options(self):
|
|
|
|
"""Init options."""
|
|
|
|
|
|
|
|
def finalize_options(self):
|
|
|
|
"""Finalize options."""
|
|
|
|
|
|
|
|
def run(self):
|
|
|
|
"""Command execution."""
|
2015-04-03 16:18:37 +03:00
|
|
|
self.run_command('sdist')
|
|
|
|
self.run_command('upload')
|
2015-04-03 16:11:05 +03:00
|
|
|
os.system('git tag -a {0} -m \'version {0}\''.format(version))
|
|
|
|
os.system('git push --tags')
|
|
|
|
setup(name='Objects',
|
|
|
|
version=version,
|
|
|
|
description=SHORT_DESCRIPTION,
|
|
|
|
long_description=description,
|
|
|
|
author='Roman Mogilatov',
|
|
|
|
author_email='rmogilatov@gmail.com',
|
|
|
|
maintainer='Roman Mogilatov',
|
|
|
|
maintainer_email='rmogilatov@gmail.com',
|
|
|
|
url='https://github.com/rmk135/objects',
|
|
|
|
license='BSD New',
|
|
|
|
packages=['objects'],
|
|
|
|
zip_safe=True,
|
|
|
|
install_requires=requirements,
|
|
|
|
cmdclass={
|
|
|
|
'publish': PublishCommand,
|
|
|
|
},
|
2015-04-03 16:21:42 +03:00
|
|
|
keywords=[
|
|
|
|
'Dependency management',
|
|
|
|
'Dependency injection',
|
|
|
|
'Dependency injection container',
|
2015-04-14 20:18:25 +03:00
|
|
|
'Dependency injector',
|
2015-04-03 16:21:42 +03:00
|
|
|
'DI',
|
|
|
|
'DIC',
|
|
|
|
'Inversion of Control',
|
|
|
|
'Inversion of Control container',
|
|
|
|
'IoC',
|
|
|
|
'IoC container',
|
|
|
|
],
|
2015-04-03 16:11:05 +03:00
|
|
|
classifiers=[
|
|
|
|
'Development Status :: 3 - Alpha',
|
|
|
|
'Intended Audience :: Developers',
|
|
|
|
'License :: OSI Approved :: BSD License',
|
|
|
|
'Operating System :: OS Independent',
|
|
|
|
'Programming Language :: Python',
|
|
|
|
'Programming Language :: Python :: 2',
|
|
|
|
'Programming Language :: Python :: 2.6',
|
|
|
|
'Programming Language :: Python :: 2.7',
|
|
|
|
'Programming Language :: Python :: 3',
|
|
|
|
'Programming Language :: Python :: 3.2',
|
|
|
|
'Programming Language :: Python :: 3.3',
|
|
|
|
'Programming Language :: Python :: 3.4',
|
|
|
|
'Programming Language :: Python :: Implementation :: CPython',
|
|
|
|
'Programming Language :: Python :: Implementation :: PyPy',
|
|
|
|
'Topic :: Software Development',
|
|
|
|
'Topic :: Software Development :: Libraries',
|
|
|
|
'Topic :: Software Development :: Libraries :: Python Modules',
|
|
|
|
])
|