From de0ec195b7bf072b97ed88c2bf30fd5102b7334f Mon Sep 17 00:00:00 2001 From: rocky Date: Fri, 13 May 2016 23:35:31 -0400 Subject: [PATCH] More packaging crap. Did I tell you how much I hate python packaging? fragments.py: track recent change in class decorators. --- MANIFEST.in | 2 +- Makefile | 9 +++++++-- __pkginfo__.py | 2 -- setup.py | 8 ++++---- uncompyle6/semantics/fragments.py | 5 ++++- 5 files changed, 16 insertions(+), 10 deletions(-) diff --git a/MANIFEST.in b/MANIFEST.in index bcd91a25..da606cde 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -7,5 +7,5 @@ include __pkginfo__.py recursive-include uncompyle6 *.py include bin/uncompyle6 include bin/pydisassemble -recursive-include test *.py +recursive-include test *.py *.pyc recursive-include pytest *.py diff --git a/Makefile b/Makefile index de5bc6e3..f7e41b18 100644 --- a/Makefile +++ b/Makefile @@ -44,9 +44,9 @@ clean: clean_pyc $(PYTHON) ./setup.py $@ (cd test && $(MAKE) clean) -#: Create source (tarball) and binary (egg) distribution +#: Create source (tarball) and wheel distribution dist: - $(PYTHON) ./setup.py sdist bdist_egg + $(PYTHON) ./setup.py sdist bdist_wheel #: Remove .pyc files clean_pyc: @@ -73,6 +73,11 @@ bdist_egg: $(PYTHON) ./setup.py bdist_egg +#: Create binary wheel distribution +bdist_wheel: + $(PYTHON) ./setup.py bdist_wheel + + # It is too much work to figure out how to add a new command to distutils # to do the following. I'm sure distutils will someday get there. DISTCLEAN_FILES = build dist *.pyc diff --git a/__pkginfo__.py b/__pkginfo__.py index d64e9d62..b72b8ee8 100644 --- a/__pkginfo__.py +++ b/__pkginfo__.py @@ -40,8 +40,6 @@ install_requires = ['spark-parser >= 1.1.1'] license = 'MIT' mailing_list = 'python-debugger@googlegroups.com' modname = 'uncompyle6' -packages = ['uncompyle6', 'uncompyle6.opcodes', 'uncompyle6.semantics', 'uncompyle6.scanners', - 'uncompyle6.parsers'] py_modules = None short_desc = 'Python byte-code disassembler and source-code converter' web = 'https://github.com/rocky/python-uncompyle6/' diff --git a/setup.py b/setup.py index e7ffe0cf..365a4674 100755 --- a/setup.py +++ b/setup.py @@ -5,10 +5,10 @@ from __pkginfo__ import \ author, author_email, install_requires, \ license, long_description, classifiers, \ - modname, packages, py_modules, entry_points, \ + entry_points, modname, py_modules, \ short_desc, web, zip_safe -from setuptools import setup +from setuptools import setup, find_packages exec(open('uncompyle6/version.py').read()) @@ -21,9 +21,9 @@ setup( install_requires = install_requires, license = license, long_description = long_description, - py_modules = py_modules, name = modname, - packages = packages, + packages = find_packages(), + py_modules = py_modules, test_suite = 'nose.collector', url = web, setup_requires = ['nose>=1.0'], diff --git a/uncompyle6/semantics/fragments.py b/uncompyle6/semantics/fragments.py index 9a1280c4..71076fd3 100644 --- a/uncompyle6/semantics/fragments.py +++ b/uncompyle6/semantics/fragments.py @@ -657,7 +657,10 @@ class FragmentsWalker(pysource.SourceWalker, object): if self.version > 3.0: currentclass = node[1][0].pattr buildclass = node[0] - subclass = buildclass[1][0].attr + if buildclass[1][0] == 'kwargs': + subclass = buildclass[1][1].attr + else: + subclass = buildclass[1][0].attr subclass_info = node[0] else: buildclass = node[0]