public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Alessandro Barbieri" <lssndrbarbieri@gmail.com>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/proj/guru:dev commit in: dev-python/hunter/
Date: Sun, 29 Mar 2020 09:29:08 +0000 (UTC)	[thread overview]
Message-ID: <1585474143.853d6212365a0203373062f8b7e97290e551fa15.Alessandro-Barbieri@gentoo> (raw)

commit:     853d6212365a0203373062f8b7e97290e551fa15
Author:     Alessandro Barbieri <lssndrbarbieri <AT> gmail <DOT> com>
AuthorDate: Sun Mar 29 09:19:07 2020 +0000
Commit:     Alessandro Barbieri <lssndrbarbieri <AT> gmail <DOT> com>
CommitDate: Sun Mar 29 09:29:03 2020 +0000
URL:        https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=853d6212

dev-python/hunter: new package

Package-Manager: Portage-2.3.96, Repoman-2.3.22
Signed-off-by: Alessandro Barbieri <lssndrbarbieri <AT> gmail.com>

 dev-python/hunter/Manifest            |  1 +
 dev-python/hunter/hunter-3.1.3.ebuild | 40 +++++++++++++++++++
 dev-python/hunter/metadata.xml        | 73 +++++++++++++++++++++++++++++++++++
 3 files changed, 114 insertions(+)

diff --git a/dev-python/hunter/Manifest b/dev-python/hunter/Manifest
new file mode 100644
index 0000000..18d2364
--- /dev/null
+++ b/dev-python/hunter/Manifest
@@ -0,0 +1 @@
+DIST hunter-3.1.3.tar.gz 422149 BLAKE2B 2834b3daa6be461b78d468aa331a587a476b7109f5ff9c70b27bb51b26f6a390d2074425f4d98ddc692d4e11f1ee14a77f5066650e82687ebaa586051afab4c8 SHA512 ea9cc935240526d2942568073cecfb2bef32d7caedd0b370850b208a56c652bf356ba0e5675281946419aafd966cbff148490f6f4439d0d808335a3e831adbf7

diff --git a/dev-python/hunter/hunter-3.1.3.ebuild b/dev-python/hunter/hunter-3.1.3.ebuild
new file mode 100644
index 0000000..ed9012f
--- /dev/null
+++ b/dev-python/hunter/hunter-3.1.3.ebuild
@@ -0,0 +1,40 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+PYTHON_COMPAT=( python3_6 )
+
+inherit distutils-r1
+
+DESCRIPTION="Hunter is a flexible code tracing toolkit"
+HOMEPAGE="
+	https://github.com/ionelmc/python-hunter
+	https://pypi.org/project/hunter
+"
+SRC_URI="https://github.com/ionelmc/python-${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="BSD-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+RDEPEND="
+	dev-python/colorama[${PYTHON_USEDEP}]
+"
+DEPEND="
+	${RDEPEND}
+	test? (
+		dev-python/aspectlib[${PYTHON_USEDEP}]
+		dev-python/manhole[${PYTHON_USEDEP}]
+		dev-python/process-tests[${PYTHON_USEDEP}]
+		dev-python/pytest-benchmark[${PYTHON_USEDEP}]
+		dev-python/pytest-travis-fold[${PYTHON_USEDEP}]
+	)
+"
+BDEPEND="
+	dev-python/cython[${PYTHON_USEDEP}]
+	>=dev-python/setuptools_scm-3.3.1[${PYTHON_USEDEP}]
+"
+
+distutils_enable_tests pytest
+distutils_enable_sphinx docs ">=dev-python/sphinx-py3doc-enhanced-theme-2.3.2"

diff --git a/dev-python/hunter/metadata.xml b/dev-python/hunter/metadata.xml
new file mode 100644
index 0000000..0fd2af6
--- /dev/null
+++ b/dev-python/hunter/metadata.xml
@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+
+<pkgmetadata>
+  <maintainer type="person">
+    <email>lssndrbarbieri@gmail.com</email>
+    <name>Alessandro Barbieri</name>
+  </maintainer>
+  <longdescription>
+Hunter is a flexible code tracing toolkit, not for measuring coverage, but for debugging, logging, inspection and other nefarious purposes. It has a simple Python API, a convenient terminal API and a CLI tool to attach to processes.
+Design notes
+
+Hunter doesn't do everything. As a design goal of this library some things are made intentionally austere and verbose (to avoid complexity, confusion and inconsistency). This has few consequences:
+
+    There are Operators but there's no negation operator. Instead you're expected to negate a Query object, eg: ~Q(module='re').
+    There are no specialized operators or filters - all filters behave exactly the same. For example:
+        No filter for packages. You're expected to filter by module with an operator.
+        No filter for arguments, return values or variables. You're expected to write your own filter function and deal with the problems of poking into objects.
+    Layering is minimal. There's are some helpers that do some argument processing and conversions to save you some typing but that's about it.
+    The library doesn't try to hide the mechanics of tracing in Python - it's 1:1 regarding what Python sends to a trace function if you'd be using sys.settrace.
+    Doesn't have any storage. You are expected to redirect output to a file.
+
+You should look at it like it's a tool to help you understand and debug big applications, or a framework ridding you of the boring parts of settrace, not something that helps you learn Python.
+FAQ
+Why not Smiley?
+
+There's some obvious overlap with smiley but there are few fundamental differences:
+
+    Complexity. Smiley is simply over-engineered:
+        It uses IPC and a SQL database.
+        It has a webserver. Lots of dependencies.
+        It uses threads. Side-effects and subtle bugs are introduced in your code.
+        It records everything. Tries to dump any variable. Often fails and stops working.
+
+    Why do you need all that just to debug some stuff in a terminal? Simply put, it's a nice idea but the design choices work against you when you're already neck-deep into debugging your own code. In my experience Smiley has been very buggy and unreliable. Your mileage may vary of course.
+
+    Tracing long running code. This will make Smiley record lots of data, making it unusable.
+
+    Now because Smiley records everything, you'd think it's better suited for short programs. But alas, if your program runs quickly then it's pointless to record the execution. You can just run it again.
+
+    It seems there's only one situation where it's reasonable to use Smiley: tracing io-bound apps remotely. Those apps don't execute lots of code, they just wait on network so Smiley's storage won't blow out of proportion and tracing overhead might be acceptable.
+
+    Use-cases. It seems to me Smiley's purpose is not really debugging code, but more of a "non interactive monitoring" tool.
+
+In contrast, Hunter is very simple:
+
+    Few dependencies.
+
+    Low overhead (tracing/filtering code has an optional Cython extension).
+
+    No storage. This simplifies lots of things.
+
+    The only cost is that you might need to run the code multiple times to get the filtering/actions right. This means Hunter is not really suited for "post-mortem" debugging. If you can't reproduce the problem anymore then Hunter won't be of much help.
+
+Why not pytrace?
+
+Pytrace is another tracer tool. It seems quite similar to Smiley - it uses a sqlite database for the events, threads and IPC, thus it's reasonable to expect the same kind of problems.
+Why not PySnooper or snoop?
+
+snoop is a refined version of PySnooper. Both are more suited to tracing small programs or functions as the output is more verbose and less suited to the needs of tracing a big application where Hunter provides more flexible setup, filtering capabilities, speed and brevity.
+Why not coverage?
+
+For purposes of debugging coverage is a great tool but only as far as "debugging by looking at what code is (not) run". Checking branch coverage is good but it will only get you as far.
+
+From the other perspective, you'd be wondering if you could use Hunter to measure coverage-like things. You could do it but for that purpose Hunter is very "rough": it has no builtin storage. You'd have to implement your own storage. You can do it but it wouldn't give you any advantage over making your own tracer if you don't need to "pre-filter" whatever you're recording.
+
+In other words, filtering events is the main selling point of Hunter - it's fast (cython implementation) and the query API is flexible enough.
+  </longdescription>
+  <upstream>
+    <remote-id type="github">python-hyper/hyper-h2</remote-id>
+    <remote-id type="pypi">h2</remote-id>
+  </upstream>
+</pkgmetadata>


             reply	other threads:[~2020-03-29  9:29 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-29  9:29 Alessandro Barbieri [this message]
  -- strict thread matches above, loose matches on Subject: below --
2020-03-29 13:21 [gentoo-commits] repo/proj/guru:dev commit in: dev-python/hunter/ Andrew Ammerlaan
2020-04-01 20:55 Alessandro Barbieri
2020-04-02 23:04 Alessandro Barbieri
2020-06-09 16:37 [gentoo-commits] repo/proj/guru:master " Andrew Ammerlaan
2020-06-09 14:00 ` [gentoo-commits] repo/proj/guru:dev " Andrew Ammerlaan
2020-09-24 13:01 [gentoo-commits] repo/proj/guru:master " Andrew Ammerlaan
2020-09-24 12:17 ` [gentoo-commits] repo/proj/guru:dev " Andrew Ammerlaan
2020-12-04  5:54 Theo Anderson
2021-05-03 23:33 Anna Vyalkova
2021-05-25 10:37 Anna Vyalkova
2021-06-14  2:27 Alessandro Barbieri
2021-06-14 23:09 Alessandro Barbieri
2021-06-17 16:01 Alessandro Barbieri
2021-06-27 23:25 Alessandro Barbieri
2021-06-28 13:34 Alessandro Barbieri
2021-08-14  2:00 Anna Vyalkova
2021-08-14  2:00 Anna Vyalkova
2022-03-18  9:49 Alessandro Barbieri
2022-06-04 13:13 Alessandro Barbieri
2022-06-05  7:51 Anna Vyalkova
2022-06-05 10:19 Anna Vyalkova
2022-09-26 10:05 Andrew Ammerlaan
2022-11-03  7:37 Anna Vyalkova
2022-11-04 15:06 Anna Vyalkova
2022-11-26 16:41 Anna Vyalkova
2023-03-04 12:06 Anna Vyalkova
2023-04-26 19:46 Anna Vyalkova
2023-04-28 18:20 Anna Vyalkova
2023-04-29  6:23 Anna Vyalkova
2023-05-02 16:54 Anna Vyalkova
2024-04-15  9:26 Julien Roy
2024-05-25 13:01 [gentoo-commits] repo/proj/guru:master " Julien Roy
2024-05-25 12:41 ` [gentoo-commits] repo/proj/guru:dev " Julien Roy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1585474143.853d6212365a0203373062f8b7e97290e551fa15.Alessandro-Barbieri@gentoo \
    --to=lssndrbarbieri@gmail.com \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox