Commit 4075d74a authored by Cyril Roelandt's avatar Cyril Roelandt

Make the "wheel" package optional for users who do not need to build a wheel.

parent 5b855ebe
......@@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file.
Based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
## [Unreleased]
### Fixed
- The "wheel" package is no longer required when not building a wheel
## [0.10] - 2019-07-21
### Added
- A man page is now available
......
......@@ -7,7 +7,13 @@ import subprocess
from setuptools import setup
from setuptools.command.sdist import sdist
from wheel.bdist_wheel import bdist_wheel
try:
from wheel.bdist_wheel import bdist_wheel
has_wheel = True
except ImportError:
import distutils.cmd
import sys
has_wheel = False
def generate_manpage():
......@@ -38,10 +44,24 @@ class SdistCommand(sdist):
sdist.run(self)
class BdistwheelCommand(bdist_wheel):
def run(self):
generate_manpage()
bdist_wheel.run(self)
if has_wheel:
class BdistwheelCommand(bdist_wheel):
def run(self):
generate_manpage()
bdist_wheel.run(self)
else:
class BdistwheelCommand(distutils.cmd.Command):
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
sys.exit('You need to install the "wheel" package to run '
'bdist_wheel')
setup(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment