Date: Sat, 5 Jul 2014 19:03:51 +0200 (CEST) From: Melvyn Sopacua <melvyn@magemana.nl> To: FreeBSD-gnats-submit@freebsd.org Cc: python@FreeBSD.org Subject: [PATCH] devel/py-setuptools: fix bytecompiled files Message-ID: <20140705170351.CB1B44AB53B@fire.magemana.nl>
next in thread | raw e-mail | index | archive | help
>Submitter-Id: current-users >Originator: Melvyn Sopacua >Organization: >Confidential: no >Synopsis: [PATCH] devel/py-setuptools: fix bytecompiled files >Severity: serious >Priority: medium >Category: ports >Class: sw-bug >Release: FreeBSD 9.2-RELEASE-p8 amd64 >Environment: System: FreeBSD fire.magemana.nl 9.2-RELEASE-p8 FreeBSD 9.2-RELEASE-p8 #4 r267444: Sun Jun 15 21:33:00 CEST 2014 melvyn@fire.magemana.nl:/usr/obj/usr/src/sys/TRANSIP amd64 >Description: Fixes files that are added to PLIST when using DISTUTILS_AUTOPLIST and the package is a namespace_package. Details and upstream PR: <https://bitbucket.org/pypa/setuptools/pull-request/72/fix-exclude-list-on-python-32/diff> Note: the port mentioned in the PR needs a oneliner fix to begin with. >Fix: --- fix-py-setuptools-namespace-packages.patch begins here --- diff -r 63528a5e5d19 -r a745a5a3e96d devel/py-setuptools/Makefile --- a/devel/py-setuptools/Makefile Sat Jul 05 09:54:36 2014 +0200 +++ b/devel/py-setuptools/Makefile Sat Jul 05 18:49:39 2014 +0200 @@ -2,6 +2,7 @@ PORTNAME= setuptools PORTVERSION= 5.1 +PORTREVISION= 1 CATEGORIES= devel python MASTER_SITES= CHEESESHOP PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} diff -r 63528a5e5d19 -r a745a5a3e96d devel/py-setuptools/files/patch-setuptools_command_install_lib.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/devel/py-setuptools/files/patch-setuptools_command_install_lib.py Sat Jul 05 18:49:39 2014 +0200 @@ -0,0 +1,35 @@ +--- setuptools/command/install_lib.py.orig Mon Jun 30 13:30:09 2014 +0200 ++++ setuptools/command/install_lib.py Sat Jul 05 17:43:39 2014 +0200 +@@ -1,5 +1,5 @@ + import distutils.command.install_lib as orig +-import os ++import os, imp + + class install_lib(orig.install_lib): + """Don't add compiled flags to filenames of non-Python files""" +@@ -16,12 +16,24 @@ + nsp = self.distribution.namespace_packages + svem = (nsp and self.get_finalized_command('install') + .single_version_externally_managed) ++ exclude_names = ['__init__.py', '__init__.pyc', '__init__.pyo'] ++ if hasattr(imp, 'get_tag') : ++ exclude_names.extend(( ++ os.path.join( ++ '__pycache__', ++ '__init__.' + imp.get_tag() + '.pyc' ++ ), ++ os.path.join( ++ '__pycache__', ++ '__init__.' + imp.get_tag() + '.pyo' ++ ), ++ )) + if svem: + for pkg in nsp: + parts = pkg.split('.') + while parts: + pkgdir = os.path.join(self.install_dir, *parts) +- for f in '__init__.py', '__init__.pyc', '__init__.pyo': ++ for f in exclude_names : + exclude[os.path.join(pkgdir,f)] = 1 + parts.pop() + return exclude --- fix-py-setuptools-namespace-packages.patch ends here ---
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20140705170351.CB1B44AB53B>