summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthon van der Neut <anthon@mnt.org>2017-06-24 09:35:40 +0200
committerAnthon van der Neut <anthon@mnt.org>2017-06-24 09:35:40 +0200
commit9b34a2ef6347ccb692a2f7af2f3b84fc23a4665c (patch)
tree16bd572026af108d6f73ae6adc75b2e8a046bcfe
parent76283369392f5af4adb4b118c9263ff6661e15d3 (diff)
downloadruamel.yaml-9b34a2ef6347ccb692a2f7af2f3b84fc23a4665c.tar.gz
fix issue #131: setup.py dependig on wheel0.15.12
-rw-r--r--CHANGES4
-rw-r--r--README.rst4
-rw-r--r--__init__.py4
-rw-r--r--docker-compose.yml2
-rw-r--r--setup.py49
5 files changed, 43 insertions, 20 deletions
diff --git a/CHANGES b/CHANGES
index 8e349ca..18846e9 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,7 @@
+[0, 15, 12]: 2017-06-24
+ - remove fatal dependency of setup.py on wheel package (reported by
+ Cameron Sweeney)
+
[0, 15, 11]: 2017-06-24
- fix for issue 130, regression in nested merge keys (reported by
`David Fee <https://bitbucket.org/dfee/>`_)
diff --git a/README.rst b/README.rst
index 3147b95..63b85bc 100644
--- a/README.rst
+++ b/README.rst
@@ -32,6 +32,10 @@ ChangeLog
.. should insert NEXT: at the beginning of line for next key
+0.15.12 (2017-06-24):
+ - remove fatal dependency of setup.py on wheel package (reported by
+ Cameron Sweeney)
+
0.15.11 (2017-06-24):
- fix for issue 130, regression in nested merge keys (reported by
`David Fee <https://bitbucket.org/dfee/>`_)
diff --git a/__init__.py b/__init__.py
index 23364ef..dbea098 100644
--- a/__init__.py
+++ b/__init__.py
@@ -7,8 +7,8 @@ if False: # MYPY
_package_data = dict(
full_package_name='ruamel.yaml',
- version_info=(0, 15, 11),
- __version__='0.15.11',
+ version_info=(0, 15, 12),
+ __version__='0.15.12',
author='Anthon van der Neut',
author_email='a.van.der.neut@ruamel.eu',
description='ruamel.yaml is a YAML parser/emitter that supports roundtrip preservation of comments, seq/map flow style, and map key order', # NOQA
diff --git a/docker-compose.yml b/docker-compose.yml
index 70e8fe8..c737838 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -8,5 +8,5 @@ services:
container_name: yamlmanylinux1
build: .
volumes:
- - .:/src
- ${PYDISTBASE}/ruamel.yaml:/src/dist
+ - .:/src
diff --git a/setup.py b/setup.py
index 334af24..0ba69be 100644
--- a/setup.py
+++ b/setup.py
@@ -16,7 +16,7 @@ from ast import parse # NOQA
from setuptools import setup, Extension, Distribution # NOQA
from setuptools.command import install_lib # NOQA
from setuptools.command.sdist import sdist as _sdist # NOQA
-from wheel.bdist_wheel import bdist_wheel as _bdist_wheel # NOQA
+
if __name__ != '__main__':
raise NotImplementedError('should never include setup.py')
@@ -236,9 +236,10 @@ class MyInstallLib(install_lib.install_lib):
class MySdist(_sdist):
def initialize_options(self):
_sdist.initialize_options(self)
+ # see pep 527, new uploads should be tar.gz or .zip
+ # fmt = getattr(self, 'tarfmt', None)
# because of unicode_literals
- fmt = getattr(self, 'tarfmt', None)
- self.formats = fmt if fmt else [b'bztar'] if sys.version_info < (3, ) else ['bztar']
+ # self.formats = fmt if fmt else [b'bztar'] if sys.version_info < (3, ) else ['bztar']
dist_base = os.environ.get('PYDISTBASE')
fpn = getattr(getattr(self, 'nsp', self), 'full_package_name', None)
if fpn and dist_base:
@@ -246,14 +247,24 @@ class MySdist(_sdist):
self.dist_dir = os.path.join(dist_base, fpn)
-class MyBdistWheel(_bdist_wheel):
- def initialize_options(self):
- _bdist_wheel.initialize_options(self)
- dist_base = os.environ.get('PYDISTBASE')
- fpn = getattr(getattr(self, 'nsp', self), 'full_package_name', None)
- if fpn and dist_base:
- print('setting distdir {}/{}'.format(dist_base, fpn))
- self.dist_dir = os.path.join(dist_base, fpn)
+# try except so this doesn't bomb when you don't have wheel installed, implies
+# generation of wheels in ./dist
+try:
+ from wheel.bdist_wheel import bdist_wheel as _bdist_wheel # NOQA
+
+ class MyBdistWheel(_bdist_wheel):
+ def initialize_options(self):
+ _bdist_wheel.initialize_options(self)
+ dist_base = os.environ.get('PYDISTBASE')
+ fpn = getattr(getattr(self, 'nsp', self), 'full_package_name', None)
+ if fpn and dist_base:
+ print('setting distdir {}/{}'.format(dist_base, fpn))
+ self.dist_dir = os.path.join(dist_base, fpn)
+
+ _bdist_wheel_available = True
+
+except ModuleNotFoundError:
+ _bdist_wheel_available = False
class InMemoryZipFile(object):
@@ -831,7 +842,15 @@ def main():
MySdist.nsp = nsp
if pkg_data.get('tarfmt'):
MySdist.tarfmt = pkg_data.get('tarfmt')
- MyBdistWheel.nsp = nsp
+
+ cmdclass = dict(
+ install_lib=MyInstallLib,
+ sdist=MySdist,
+ )
+ if _bdist_wheel_available:
+ MyBdistWheel.nsp = nsp
+ cmdclass['bdist_wheel'] = MyBdistWheel
+
kw = dict(
name=nsp.full_package_name,
namespace_packages=nsp.namespace_packages,
@@ -840,11 +859,7 @@ def main():
url=nsp.url,
author=nsp.author,
author_email=nsp.author_email,
- cmdclass=dict(
- install_lib=MyInstallLib,
- sdist=MySdist,
- bdist_wheel=MyBdistWheel,
- ),
+ cmdclass=cmdclass,
package_dir=nsp.package_dir,
entry_points=nsp.entry_points(),
description=nsp.description,