aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'dev-python/pyout')
-rw-r--r--dev-python/pyout/Manifest2
-rw-r--r--dev-python/pyout/files/pyout-0.7.2-blessed.patch140
-rw-r--r--dev-python/pyout/metadata.xml24
-rw-r--r--dev-python/pyout/pyout-0.7.2-r1.ebuild34
-rw-r--r--dev-python/pyout/pyout-0.7.3.ebuild35
5 files changed, 235 insertions, 0 deletions
diff --git a/dev-python/pyout/Manifest b/dev-python/pyout/Manifest
new file mode 100644
index 000000000..5878b2e20
--- /dev/null
+++ b/dev-python/pyout/Manifest
@@ -0,0 +1,2 @@
+DIST pyout-0.7.2.tar.gz 181753 BLAKE2B 780e536921151f81097e5dee7c74cfa086153f916fc9b9fd684f01008ada34102ba33ee7bdd3dd8cc4ccf89a8d9821ec0aecdbd87bc356abf25c6e4fe32d4c5a SHA512 e7be6f7829f6b09ead64c596cfdecfa45073af0a1da15401702327e141bbfae10e7968ee5e332358aa04bfc7ddf71b7b6caf2d5877aca8514e4ba544d3b1670a
+DIST pyout-0.7.3.tar.gz 45726 BLAKE2B 4c5bc42b835fefd3db5d97db46c086ec2a7ca488a339813937f6e795a5fef699451dd67cd5078737f4f2bc47a36c96e2cb9f0010645fa45ebd288d24b5e0c3ba SHA512 784a7dd5b1eb811073466828f81783f89e3a251e05bc49edf124cdfc916c2447982299c83b087942845b61791481850f8c89379eea920e91d35c8abc2cbeb8ef
diff --git a/dev-python/pyout/files/pyout-0.7.2-blessed.patch b/dev-python/pyout/files/pyout-0.7.2-blessed.patch
new file mode 100644
index 000000000..89e189916
--- /dev/null
+++ b/dev-python/pyout/files/pyout-0.7.2-blessed.patch
@@ -0,0 +1,140 @@
+From 0f7c6d6f2abb304c9c473afb504cb03d17fef036 Mon Sep 17 00:00:00 2001
+From: Horea Christian <chr@chymera.eu>
+Date: Sat, 7 Jan 2023 21:49:32 -0500
+Subject: [PATCH 1/2] Accepting either bless* library
+
+---
+ pyout/field.py | 7 ++++++-
+ pyout/tabular.py | 9 +++++++--
+ pyout/tests/terminal.py | 9 +++++++--
+ pyout/tests/test_interface.py | 7 ++++++-
+ pyout/tests/test_tabular.py | 7 ++++++-
+ 5 files changed, 32 insertions(+), 7 deletions(-)
+
+diff --git a/pyout/field.py b/pyout/field.py
+index 5105081..99c310f 100644
+--- a/pyout/field.py
++++ b/pyout/field.py
+@@ -495,7 +495,12 @@ class TermProcessors(StyleProcessors):
+
+ Parameters
+ ----------
+- term : blessings.Terminal
++ term : blessed.Terminal or blessings.Terminal
++
++ Notes
++ -----
++ * Eventually we may want to retire blessings:
++ https://github.com/pyout/pyout/issues/136
+ """
+
+ def __init__(self, term):
+diff --git a/pyout/tabular.py b/pyout/tabular.py
+index 2a776a1..0d4797a 100644
+--- a/pyout/tabular.py
++++ b/pyout/tabular.py
+@@ -7,7 +7,12 @@
+ from logging import getLogger
+ import os
+
+-from blessings import Terminal
++# Eventually we may want to retire blessings:
++# https://github.com/pyout/pyout/issues/136
++try:
++ from blessed import Terminal
++except ImportError:
++ from blessings import Terminal
+
+ from pyout import interface
+ from pyout.field import TermProcessors
+@@ -16,7 +21,7 @@
+
+
+ class TerminalStream(interface.Stream):
+- """Stream interface implementation using blessings.Terminal.
++ """Stream interface implementation using blessed/blessings.Terminal.
+ """
+
+ def __init__(self, stream=None, interactive=None):
+diff --git a/pyout/tests/terminal.py b/pyout/tests/terminal.py
+index 53aabd7..2d8857c 100644
+--- a/pyout/tests/terminal.py
++++ b/pyout/tests/terminal.py
+@@ -6,12 +6,17 @@
+ from functools import partial
+ import re
+
+-import blessings
++# Eventually we may want to retire blessings:
++# https://github.com/pyout/pyout/issues/136
++try:
++ import blessed as bls
++except ImportError:
++ import blessings as bls
+
+ from pyout.tests.utils import assert_contains
+
+
+-class Terminal(blessings.Terminal):
++class Terminal(bls.Terminal):
+
+ def __init__(self, *args, **kwargs):
+ super(Terminal, self).__init__(
+diff --git a/pyout/tests/test_interface.py b/pyout/tests/test_interface.py
+index 5205ef3..8348323 100644
+--- a/pyout/tests/test_interface.py
++++ b/pyout/tests/test_interface.py
+@@ -1,6 +1,11 @@
+ import pytest
+
+-pytest.importorskip("blessings")
++# Eventually we may want to retire blessings:
++# https://github.com/pyout/pyout/issues/136
++try:
++ pytest.importorskip("blessed")
++except pytest.skip.Exception:
++ pytest.importorskip("blessings")
+
+ import inspect
+
+diff --git a/pyout/tests/test_tabular.py b/pyout/tests/test_tabular.py
+index 2044e92..a1d35e5 100644
+--- a/pyout/tests/test_tabular.py
++++ b/pyout/tests/test_tabular.py
+@@ -1,7 +1,12 @@
+ # -*- coding: utf-8 -*-
+ import pytest
+
+-pytest.importorskip("blessings")
++# Eventually we may want to retire blessings:
++# https://github.com/pyout/pyout/issues/136
++try:
++ pytest.importorskip("blessed")
++except pytest.skip.Exception:
++ pytest.importorskip("blessings")
+
+ from collections import Counter
+ from collections import OrderedDict
+
+From 5f6691c114578217a124d2ac1b24468993178e27 Mon Sep 17 00:00:00 2001
+From: Horea Christian <chr@chymera.eu>
+Date: Sat, 7 Jan 2023 23:48:37 -0500
+Subject: [PATCH 2/2] Preferring blessings
+
+---
+ setup.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/setup.py b/setup.py
+index b376c2e..43005e7 100644
+--- a/setup.py
++++ b/setup.py
+@@ -2,7 +2,7 @@
+
+ requires = {
+ "core": [
+- "blessings; sys_platform != 'win32'",
++ "blessed; sys_platform != 'win32'",
+ "jsonschema>=3.0.0",
+ ],
+ "tests": ["pytest", "pytest-timeout"],
diff --git a/dev-python/pyout/metadata.xml b/dev-python/pyout/metadata.xml
new file mode 100644
index 000000000..712a48169
--- /dev/null
+++ b/dev-python/pyout/metadata.xml
@@ -0,0 +1,24 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>gentoo@chymera.eu</email>
+ <name>Horea Christian</name>
+ </maintainer>
+ <maintainer type="project">
+ <email>sci@gentoo.org</email>
+ <name>Gentoo Science Project</name>
+ </maintainer>
+ <longdescription lang="en">
+ pyout is a Python package that defines an interface for writing
+ structured records as a table in a terminal. It is being developed to
+ replace custom code for displaying tabular data in in ReproMan and
+ DataLad. See the Examples folder for how to get started. A primary
+ goal of the interface is the separation of content from style and
+ presentation.
+ </longdescription>
+ <upstream>
+ <remote-id type="github">pyout/pyout</remote-id>
+ <remote-id type="pypi">pyout</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/dev-python/pyout/pyout-0.7.2-r1.ebuild b/dev-python/pyout/pyout-0.7.2-r1.ebuild
new file mode 100644
index 000000000..7e262b158
--- /dev/null
+++ b/dev-python/pyout/pyout-0.7.2-r1.ebuild
@@ -0,0 +1,34 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{10..11} )
+inherit distutils-r1
+
+DESCRIPTION="Terminal styling for structured data"
+HOMEPAGE="https://github.com/pyout/pyout"
+SRC_URI="https://github.com/pyout/pyout/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz"
+
+SLOT="0"
+LICENSE="MIT"
+KEYWORDS="~amd64 ~x86"
+
+RDEPEND="
+ dev-python/jsonschema[${PYTHON_USEDEP}]
+ dev-python/blessed[${PYTHON_USEDEP}]
+"
+DEPEND="
+ test? (
+ dev-python/pytest-timeout[${PYTHON_USEDEP}]
+ )
+"
+
+distutils_enable_tests pytest
+
+PATCHES=( "${FILESDIR}/${P}-blessed.patch" )
+
+python_prepare_all() {
+ sed -i -e '/pytest-runner/d' setup.py || die
+ distutils-r1_python_prepare_all
+}
diff --git a/dev-python/pyout/pyout-0.7.3.ebuild b/dev-python/pyout/pyout-0.7.3.ebuild
new file mode 100644
index 000000000..7246139ee
--- /dev/null
+++ b/dev-python/pyout/pyout-0.7.3.ebuild
@@ -0,0 +1,35 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DISTUTILS_USE_PEP517=setuptools
+PYTHON_COMPAT=( python3_{10..12} )
+inherit distutils-r1 pypi
+
+DESCRIPTION="Terminal styling for structured data"
+HOMEPAGE="https://github.com/pyout/pyout"
+#SRC_URI="https://github.com/pyout/pyout/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz"
+
+SLOT="0"
+LICENSE="MIT"
+KEYWORDS="~amd64 ~x86"
+
+RDEPEND="
+ dev-python/jsonschema[${PYTHON_USEDEP}]
+ dev-python/blessed[${PYTHON_USEDEP}]
+"
+DEPEND="
+ test? (
+ dev-python/pytest-timeout[${PYTHON_USEDEP}]
+ )
+"
+
+distutils_enable_tests pytest
+
+#PATCHES=( "${FILESDIR}/${PN}-0.7.2-blessed.patch" )
+
+python_prepare_all() {
+ sed -i -e '/pytest-runner/d' setup.py || die
+ distutils-r1_python_prepare_all
+}