Hello community, here is the log from the commit of package python-py3status for openSUSE:Factory checked in at 2018-08-24 17:10:24 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-py3status (Old) and /work/SRC/openSUSE:Factory/.python-py3status.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-py3status" Fri Aug 24 17:10:24 2018 rev:2 rq:630855 version:3.12 Changes: -------- --- /work/SRC/openSUSE:Factory/python-py3status/python-py3status.changes 2018-03-24 16:16:10.417781262 +0100 +++ /work/SRC/openSUSE:Factory/.python-py3status.new/python-py3status.changes 2018-08-24 17:10:38.066537096 +0200 @@ -1,0 +2,8 @@ +Wed Aug 22 09:09:57 UTC 2018 - tchva...@suse.com + +- Version update to 3.12: + * For the list of changes please see CHANGELOG file +- Enable tests +- Add patch fast-entrypoints.patch to fix setup.py + +------------------------------------------------------------------- Old: ---- py3status-3.7.tar.gz New: ---- fast-entrypoints.patch py3status-3.12.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-py3status.spec ++++++ --- /var/tmp/diff_new_pack.gjCEBw/_old 2018-08-24 17:10:38.702537853 +0200 +++ /var/tmp/diff_new_pack.gjCEBw/_new 2018-08-24 17:10:38.706537858 +0200 @@ -18,24 +18,25 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-py3status -Version: 3.7 +Version: 3.12 Release: 0 Summary: Extensible i3status wrapper written in python License: BSD-3-Clause Group: Development/Languages/Python -Url: https://github.com/ultrabug/py3status +URL: https://github.com/ultrabug/py3status Source: https://files.pythonhosted.org/packages/source/p/py3status/py3status-%{version}.tar.gz -BuildRequires: %{python_module devel} +Patch0: fast-entrypoints.patch +BuildRequires: %{python_module gevent >= 1.1} +BuildRequires: %{python_module pytest} BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros +Recommends: python-gevent >= 1.1 +BuildArch: noarch %ifpython3 Provides: py3status = %{version} Obsoletes: py3status < %{version} %endif -BuildRoot: %{_tmppath}/%{name}-%{version}-build -BuildArch: noarch - %python_subpackages %description @@ -50,6 +51,7 @@ %prep %setup -q -n py3status-%{version} +%patch0 -p1 %build %python_build @@ -60,6 +62,10 @@ %python_clone -a %{buildroot}%{_bindir}/py3-cmd %python_expand %fdupes %{buildroot}%{$python_sitelib} +%check +export LANG=en_US.UTF8 +%python_expand PYTHONPATH=%{buildroot}%{$python_sitelib} py.test-%{$python_bin_suffix} tests/ + %post %python_install_alternative py3status %python_install_alternative py3-cmd @@ -69,7 +75,6 @@ %python_uninstall_alternative py3-cmd %files %{python_files} -%defattr(-,root,root,-) %license LICENSE %doc README.rst CHANGELOG %python_alternative %{_bindir}/py3status ++++++ fast-entrypoints.patch ++++++ >From 8a48e01cb68b514b532f56037e4f5a6c19662de5 Mon Sep 17 00:00:00 2001 From: lasers <las...@users.noreply.github.com> Date: Sun, 8 Jul 2018 12:48:59 -0500 Subject: [PATCH] setup: add fast-entry_points --- MANIFEST.in | 1 + fastentrypoints.py | 112 +++++++++++++++++++++++++++++++++++++++++++++ setup.py | 56 ++--------------------- 3 files changed, 116 insertions(+), 53 deletions(-) create mode 100644 fastentrypoints.py diff --git a/MANIFEST.in b/MANIFEST.in index 16f013394d..a3cfa8819c 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -5,3 +5,4 @@ recursive-include doc *.rst *.md *.txt *.py include CHANGELOG include LICENSE include README.rst +include fastentrypoints.py diff --git a/fastentrypoints.py b/fastentrypoints.py new file mode 100644 index 0000000000..9707f74a3f --- /dev/null +++ b/fastentrypoints.py @@ -0,0 +1,112 @@ +# noqa: D300,D400 +# Copyright (c) 2016, Aaron Christianson +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS +# IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +# PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED +# TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +''' +Monkey patch setuptools to write faster console_scripts with this format: + + import sys + from mymodule import entry_function + sys.exit(entry_function()) + +This is better. + +(c) 2016, Aaron Christianson +http://github.com/ninjaaron/fast-entry_points +''' +from setuptools.command import easy_install +import re +TEMPLATE = '''\ +# -*- coding: utf-8 -*- +# EASY-INSTALL-ENTRY-SCRIPT: '{3}','{4}','{5}' +__requires__ = '{3}' +import re +import sys + +from {0} import {1} + +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0]) + sys.exit({2}())''' + + +@classmethod +def get_args(cls, dist, header=None): # noqa: D205,D400 + """ + Yield write_script() argument tuples for a distribution's + console_scripts and gui_scripts entry points. + """ + if header is None: + # pylint: disable=E1101 + header = cls.get_header() + spec = str(dist.as_requirement()) + for type_ in 'console', 'gui': + group = type_ + '_scripts' + for name, ep in dist.get_entry_map(group).items(): + # ensure_safe_name + if re.search(r'[\\/]', name): + raise ValueError("Path separators not allowed in script names") + script_text = TEMPLATE.format( + ep.module_name, ep.attrs[0], '.'.join(ep.attrs), + spec, group, name) + # pylint: disable=E1101 + args = cls._get_script_args(type_, name, header, script_text) + for res in args: + yield res + + +# pylint: disable=E1101 +easy_install.ScriptWriter.get_args = get_args + + +def main(): + import os + import re + import shutil + import sys + dests = sys.argv[1:] or ['.'] + filename = re.sub('\.pyc$', '.py', __file__) + + for dst in dests: + shutil.copy(filename, dst) + manifest_path = os.path.join(dst, 'MANIFEST.in') + setup_path = os.path.join(dst, 'setup.py') + + # Insert the include statement to MANIFEST.in if not present + with open(manifest_path, 'a+') as manifest: + manifest.seek(0) + manifest_content = manifest.read() + if 'include fastentrypoints.py' not in manifest_content: + manifest.write(('\n' if manifest_content else '') + + 'include fastentrypoints.py') + + # Insert the import statement to setup.py if not present + with open(setup_path, 'a+') as setup: + setup.seek(0) + setup_content = setup.read() + if 'import fastentrypoints' not in setup_content: + setup.seek(0) + setup.truncate() + setup.write('import fastentrypoints\n' + setup_content) diff --git a/setup.py b/setup.py index 9ceae3f0a2..bfa2b986ae 100755 --- a/setup.py +++ b/setup.py @@ -2,64 +2,18 @@ py3status """ +from setuptools import find_packages, setup +import fastentrypoints # noqa f401 import os import sys -from setuptools import find_packages, setup -from setuptools.command.develop import develop -from setuptools.command.install import install -from setuptools.command.easy_install import _to_ascii, ScriptWriter module_path = os.path.join( os.path.dirname(os.path.realpath(__file__)), 'py3status') sys.path.insert(0, module_path) -from version import version # noqa +from version import version # noqa e402 sys.path.remove(module_path) -# setuptools causes scripts to run slowly see -# https://github.com/pypa/setuptools/issues/510 -# We can make py3-cmd run much faster when installed via -# python setup install/develop -PY3_CMD_SCRIPT_TEXT = u"""{} -# -*- coding: utf-8 -*- -import re -import sys - -from py3status.command import send_command - -if __name__ == '__main__': - sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0]) - sys.exit(send_command()) -""" - - -def install_py3_cmd(installer): - """Attempt to overwrite /bin/py3-cmd with efficient version""" - py_cmd = ScriptWriter.get_header() - script_text = PY3_CMD_SCRIPT_TEXT.format(py_cmd) - try: - installer.write_script('py3-cmd', _to_ascii(script_text), 'b') - except AttributeError: - # building wheel etc - pass - - -class PostDevelopCommand(develop): - """Post-installation for develop""" - - def run(self): - develop.run(self) - install_py3_cmd(self) - - -class PostInstallCommand(install): - """Post-installation for install""" - - def run(self): - install.run(self) - install_py3_cmd(self) - - # Utility function to read the README file. # Used for the long_description. It's nice, because now 1) we have a top level # README file and 2) it's easier to type in the README file than to put a raw @@ -83,10 +37,6 @@ def read(fname): packages=find_packages(), include_package_data=True, install_requires=[], - cmdclass={ - 'develop': PostDevelopCommand, - 'install': PostInstallCommand, - }, entry_points={ 'console_scripts': [ 'py3status = py3status:main', ++++++ py3status-3.7.tar.gz -> py3status-3.12.tar.gz ++++++ ++++ 15987 lines of diff (skipped)