Skip to content

Instantly share code, notes, and snippets.

@mjbogusz
Created August 29, 2018 23:53
Show Gist options
  • Select an option

  • Save mjbogusz/5765db5f710529074d89472c87058ec7 to your computer and use it in GitHub Desktop.

Select an option

Save mjbogusz/5765db5f710529074d89472c87058ec7 to your computer and use it in GitHub Desktop.
py3status 3.12 python 3.7 fix
--- src/py3status-3.12/setup.py 2018-08-09 08:03:15.000000000 +0200
+++ src/py3status-3.12/setupnew.py 2018-08-30 01:48:06.579451985 +0200
@@ -5,9 +5,6 @@
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')
@@ -16,50 +13,6 @@
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 +36,6 @@
packages=find_packages(),
include_package_data=True,
install_requires=[],
- cmdclass={
- 'develop': PostDevelopCommand,
- 'install': PostInstallCommand,
- },
entry_points={
'console_scripts': [
'py3status = py3status:main',
@@ -105,5 +54,6 @@
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
+ 'Programming Language :: Python :: 3.7',
'Topic :: Software Development :: Libraries :: Python Modules',
], )
# Maintainer: Alexis "Horgix" Chotard <[email protected]>
# Contributor: carstene1ns <arch carsten-teibes de> - http://git.io/ctPKG
pkgname=py3status
pkgver=3.12
pkgrel=1
pkgdesc="An extensible i3status replacement/wrapper written in python"
url="http://www.ultrabug.fr/tag/py3status/"
arch=('any')
license=('custom: Simplified BSD')
depends=('python' 'python-setuptools' 'i3status')
optdepends=('i3status: for some of the functionality'
'acpi: for some of the battery related modules'
'pacman-contrib: for the arch_updates module')
source=(
$pkgname-$pkgver.tar.gz::"https://github.com/ultrabug/py3status/archive/$pkgver.tar.gz"
fix_to_ascii.patch
)
sha256sums=(
'c85e10116be2c62ba0916c3cc2e2af75e7fb3c1c714f0690dbdadfcb3871c51f'
SKIP
)
prepare() {
cd $pkgname-$pkgver
patch -p0 -i "$srcdir/fix_to_ascii.patch" setup.py
}
package() {
cd $pkgname-$pkgver
python setup.py install --root="$pkgdir/" --optimize=1
# doc
install -d "$pkgdir"/usr/share/doc/$pkgname
install -m644 doc/* README.rst CHANGELOG "$pkgdir"/usr/share/doc/$pkgname
# license
install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment