refactor setup.py
This commit is contained in:
parent
9fcb3ad4f6
commit
ccaaa55b0e
26
setup.py
26
setup.py
@ -18,7 +18,10 @@ from setuptools import setup, find_packages
|
|||||||
from setuptools.command.sdist import sdist
|
from setuptools.command.sdist import sdist
|
||||||
import os
|
import os
|
||||||
import subprocess
|
import subprocess
|
||||||
from babel.messages import frontend
|
try:
|
||||||
|
from babel.messages import frontend
|
||||||
|
except ImportError:
|
||||||
|
frontend = None
|
||||||
|
|
||||||
from swift import __version__ as version
|
from swift import __version__ as version
|
||||||
|
|
||||||
@ -40,6 +43,19 @@ class local_sdist(sdist):
|
|||||||
|
|
||||||
name = 'swift'
|
name = 'swift'
|
||||||
|
|
||||||
|
|
||||||
|
cmdclass = {'sdist': local_sdist}
|
||||||
|
|
||||||
|
|
||||||
|
if frontend:
|
||||||
|
cmdclass.update({
|
||||||
|
'compile_catalog': frontend.compile_catalog,
|
||||||
|
'extract_messages': frontend.extract_messages,
|
||||||
|
'init_catalog': frontend.init_catalog,
|
||||||
|
'update_catalog': frontend.update_catalog,
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
name=name,
|
name=name,
|
||||||
version=version,
|
version=version,
|
||||||
@ -50,13 +66,7 @@ setup(
|
|||||||
url='https://launchpad.net/swift',
|
url='https://launchpad.net/swift',
|
||||||
packages=find_packages(exclude=['test', 'bin']),
|
packages=find_packages(exclude=['test', 'bin']),
|
||||||
test_suite='nose.collector',
|
test_suite='nose.collector',
|
||||||
cmdclass={
|
cmdclass=cmdclass,
|
||||||
'sdist': local_sdist,
|
|
||||||
'compile_catalog': frontend.compile_catalog,
|
|
||||||
'extract_messages': frontend.extract_messages,
|
|
||||||
'init_catalog': frontend.init_catalog,
|
|
||||||
'update_catalog': frontend.update_catalog,
|
|
||||||
},
|
|
||||||
classifiers=[
|
classifiers=[
|
||||||
'Development Status :: 4 - Beta',
|
'Development Status :: 4 - Beta',
|
||||||
'License :: OSI Approved :: Apache Software License',
|
'License :: OSI Approved :: Apache Software License',
|
||||||
|
Loading…
Reference in New Issue
Block a user