Skip to content

Commit

Permalink
Build a wheel.
Browse files Browse the repository at this point in the history
  • Loading branch information
mblayman committed Jul 18, 2015
1 parent aa58274 commit 5ca9ac9
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
6 changes: 6 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[bdist_wheel]
universal = 1

[compile_catalog]
domain = handroll
directory = handroll/locale
Expand All @@ -6,3 +9,6 @@ directory = handroll/locale
input_dirs = handroll
output_file = handroll/locale/handroll.pot
copyright_holder = Matt Layman

[metadata]
license-file = LICENSE
19 changes: 18 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,24 @@
"""

from setuptools import find_packages, setup
from setuptools.command.build_py import build_py
from setuptools.command.sdist import sdist
import sys

__version__ = '1.6'


class BuildPy(build_py):
"""Custom ``build_py`` command to always build mo files for wheels."""

def run(self):
# Babel fails hard on Python 3. Let Python 2 make the mo files.
if sys.version_info < (3, 0, 0):
self.run_command('compile_catalog')
# build_py is an old style class so super cannot be used.
build_py.run(self)


class Sdist(sdist):
"""Custom ``sdist`` command to ensure that mo files are always created."""

Expand Down Expand Up @@ -54,6 +66,8 @@ def run(self):
'requests',
'Sphinx',
'tox',
'twine',
'wheel',
])

setup(
Expand Down Expand Up @@ -113,5 +127,8 @@ def run(self):
'ReStructuredText',
'Textile',
],
cmdclass={'sdist': Sdist},
cmdclass={
'build_py': BuildPy,
'sdist': Sdist,
},
)

0 comments on commit 5ca9ac9

Please sign in to comment.