mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-15 16:20:08 +02:00
icecream: new recipe. (#8830)
This commit is contained in:
78
dev-python/icecream/icecream-2.1.3.recipe
Normal file
78
dev-python/icecream/icecream-2.1.3.recipe
Normal file
@@ -0,0 +1,78 @@
|
||||
SUMMARY="Never use print() to debug again"
|
||||
DESCRIPTION="Do you ever use print() or log() to debug your code? Of course you do. IceCream, \
|
||||
or ic for short, makes print debugging a little sweeter.
|
||||
|
||||
ic() is like print(), but better:
|
||||
|
||||
* It prints both expressions/variable names and their values.
|
||||
* It's 60% faster to type.
|
||||
* Data structures are pretty printed.
|
||||
* Output is syntax highlighted.
|
||||
* It optionally includes program context: filename, line number, and parent function."
|
||||
HOMEPAGE="https://github.com/gruns/icecream"
|
||||
COPYRIGHT="2018 Ansgar Grunseid"
|
||||
LICENSE="MIT"
|
||||
REVISION="1"
|
||||
SOURCE_URI="https://pypi.io/packages/source/i/$portName/$portName-$portVersion.tar.gz"
|
||||
CHECKSUM_SHA256="0aa4a7c3374ec36153a1d08f81e3080e83d8ac1eefd97d2f4fe9544e8f9b49de"
|
||||
PATCHES="icecream-$portVersion.patchset"
|
||||
|
||||
ARCHITECTURES="any"
|
||||
|
||||
PROVIDES="
|
||||
$portName = $portVersion
|
||||
"
|
||||
REQUIRES="
|
||||
haiku
|
||||
"
|
||||
|
||||
PYTHON_PACKAGES=(python39 python310)
|
||||
PYTHON_VERSIONS=(3.9 3.10)
|
||||
for i in "${!PYTHON_PACKAGES[@]}"; do
|
||||
pythonPackage=${PYTHON_PACKAGES[i]}
|
||||
pythonVersion=${PYTHON_VERSIONS[$i]}
|
||||
|
||||
eval "PROVIDES_$pythonPackage=\"
|
||||
${portName}_$pythonPackage = $portVersion
|
||||
\""
|
||||
eval "REQUIRES_$pythonPackage=\"
|
||||
asttokens_$pythonPackage
|
||||
executing_$pythonPackage
|
||||
pygments_$pythonPackage
|
||||
cmd:python$pythonVersion
|
||||
\""
|
||||
BUILD_REQUIRES+="
|
||||
build_$pythonPackage
|
||||
installer_$pythonPackage
|
||||
setuptools_$pythonPackage
|
||||
wheel_$pythonPackage
|
||||
"
|
||||
BUILD_PREREQUIRES+="
|
||||
cmd:python$pythonVersion
|
||||
"
|
||||
TEST_REQUIRES+="
|
||||
icecream_$pythonPackage
|
||||
nose_$pythonPackage
|
||||
"
|
||||
done
|
||||
|
||||
INSTALL()
|
||||
{
|
||||
for i in "${!PYTHON_PACKAGES[@]}"; do
|
||||
python=python${PYTHON_VERSIONS[$i]}
|
||||
|
||||
$python -m build --wheel --skip-dependency-check --no-isolation
|
||||
$python -m installer -p $prefix dist/*.whl
|
||||
|
||||
packageEntries ${PYTHON_PACKAGES[i]} \
|
||||
$prefix/lib/python*
|
||||
done
|
||||
}
|
||||
|
||||
TEST()
|
||||
{
|
||||
for i in "${!PYTHON_VERSIONS[@]}"; do
|
||||
pythonVersion=${PYTHON_VERSIONS[$i]}
|
||||
nosetests --exe
|
||||
done
|
||||
}
|
||||
34
dev-python/icecream/patches/icecream-2.1.3.patchset
Normal file
34
dev-python/icecream/patches/icecream-2.1.3.patchset
Normal file
@@ -0,0 +1,34 @@
|
||||
From 3121461f75fe0ef1aed4c25644d854812d8e74f3 Mon Sep 17 00:00:00 2001
|
||||
From: Oscar Lesta <oscar.lesta@gmail.com>
|
||||
Date: Thu, 8 Jun 2023 17:01:32 -0300
|
||||
Subject: Drop colorama dependency.
|
||||
|
||||
|
||||
diff --git a/icecream/icecream.py b/icecream/icecream.py
|
||||
index 410921f..fce2380 100755
|
||||
--- a/icecream/icecream.py
|
||||
+++ b/icecream/icecream.py
|
||||
@@ -23,7 +23,7 @@ from contextlib import contextmanager
|
||||
from os.path import basename, realpath
|
||||
from textwrap import dedent
|
||||
|
||||
-import colorama
|
||||
+#import colorama
|
||||
import executing
|
||||
from pygments import highlight
|
||||
# See https://gist.github.com/XVilka/8346728 for color support in various
|
||||
@@ -60,9 +60,9 @@ def colorize(s):
|
||||
def supportTerminalColorsInWindows():
|
||||
# Filter and replace ANSI escape sequences on Windows with equivalent Win32
|
||||
# API calls. This code does nothing on non-Windows systems.
|
||||
- colorama.init()
|
||||
+# colorama.init()
|
||||
yield
|
||||
- colorama.deinit()
|
||||
+# colorama.deinit()
|
||||
|
||||
|
||||
def stderrPrint(*args):
|
||||
--
|
||||
2.37.3
|
||||
|
||||
Reference in New Issue
Block a user