From nobody Wed Sep 11 05:54:59 2024 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X3VCR6qKvz5WGpp; Wed, 11 Sep 2024 05:54:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4X3VCR48n3z4rKp; Wed, 11 Sep 2024 05:54:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726034099; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Nq6VGyNKwNMIggJssbV0kruKiavL6fQnd3vRmUG+NNo=; b=xpq0z5RiuPis5HT6DWNd4KOp6BdK+vxcEdMnQes4Tzsc8kMB8aKo8QS2YSgSFu+YwK7XkH 65J905vKu2hPoDaGf0fXMG0HXejX315B6OCdRjXwEndGkoSueyYwX3jD1kWFvceCr8UoCr MzzqmmZ+5hY/vrmDy2F4yPjBbmIKoP175wXEf5Om3GbYad02ZTG/S+G5Ulaa3n6ES5GSEU 3QMpfG6ToVFqLIcZ+xc7lhTEDp2F15/Tk3AniZ+kxTTojs85XBtpssn4+jotdHYDUPLDUh /12a3+fE17IFi5iFxok8euNNBVnHISoVDAEpoLjhAaCqQ27BCcCfa1z+PMVwoQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726034099; a=rsa-sha256; cv=none; b=xAncrgBfyuMaDk0sr+KmGddanBHxM1r/kQ56Qlt54Ms3aIOXZduhD25YeVFKHbMtmbQ3et 7aY8oJiKo9dUnSIqfV73OyAf9YsaEsNtQvrDLc13WSfkXBLP4IoY68KXwonGCzR4DIPCBX JQCSlNq8bAWFRy+QjJTr8yc/FEii8iisWoGDiWm7HiOdT1Ijh0DKgZ8ARjaev6GcOru3v6 0WgXUsVSlOSn4WNlpaEt92NAJp8dlfpLQej8Bn2tSP1dNrXv+SkcqUwi8bzE2sEE23A81T zhGsveJ31Obhcqal2cuap1IrXOTVUC5mXqTTZ/S8qJsjkduncCm3oGMBtIMVYQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726034099; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Nq6VGyNKwNMIggJssbV0kruKiavL6fQnd3vRmUG+NNo=; b=IVJ8aFZ8gYJZCsgSExjt9NAouCH3MxwVmkb7zv8QmZ/+Mx+TZcMSIA9tUV3WXrhxBJBsV4 tyJzCBd5Q8DoPGnrpm2zv+/pOmuQ1Ls/jmgN/eNJy5j7r6eEOEX7ueFEwU2FWgMcrjweiA wO6sEXzefJp2LCfFrKC0xuuSTts7xPpd1/oNZwnMiLzlOl7UeLaC2vloGkmiXqWEiZI+an GGFcMcWdkxZ/BdcsecNa0LrXQok2ldMjBuRs22V1OIypzgV26H8A3uUL/7sQwOPucWgWut ZTePSxjLT6ZARGAeRrUQEq5CT21XILFSZ1VurPwyzuIpWQC+E5rLvMf/A0M/Mw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X3VCR3TM4zJ4b; Wed, 11 Sep 2024 05:54:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48B5sxGH015622; Wed, 11 Sep 2024 05:54:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48B5sx97015619; Wed, 11 Sep 2024 05:54:59 GMT (envelope-from git) Date: Wed, 11 Sep 2024 05:54:59 GMT Message-Id: <202409110554.48B5sx97015619@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Dave Cottlehuber Subject: git: 96919cce2620 - main - misc/py-aider-chat: update to 0.55.0 List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-ports-main@freebsd.org Sender: owner-dev-commits-ports-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dch X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 96919cce2620f92d943fcad10180d006c3e8bfd5 Auto-Submitted: auto-generated The branch main has been updated by dch: URL: https://cgit.FreeBSD.org/ports/commit/?id=96919cce2620f92d943fcad10180d006c3e8bfd5 commit 96919cce2620f92d943fcad10180d006c3e8bfd5 Author: Dave Cottlehuber AuthorDate: 2024-09-11 05:53:32 +0000 Commit: Dave Cottlehuber CommitDate: 2024-09-11 05:54:25 +0000 misc/py-aider-chat: update to 0.55.0 Sponsored by: Skunkwerks, GmbH --- misc/py-aider-chat/Makefile | 11 ++- misc/py-aider-chat/distinfo | 6 +- misc/py-aider-chat/files/patch-aider_commands.py | 25 +++++++ misc/py-aider-chat/files/patch-aider_scrape.py | 91 ++++++++++++++++++++---- misc/py-aider-chat/files/patch-pyproject.toml | 11 +++ misc/py-aider-chat/files/patch-setup.py | 11 --- 6 files changed, 126 insertions(+), 29 deletions(-) diff --git a/misc/py-aider-chat/Makefile b/misc/py-aider-chat/Makefile index bdc939f240d8..94871a2e9859 100644 --- a/misc/py-aider-chat/Makefile +++ b/misc/py-aider-chat/Makefile @@ -1,5 +1,5 @@ PORTNAME= aider_chat -DISTVERSION= 0.45.0 +DISTVERSION= 0.55.0 CATEGORIES= misc python MASTER_SITES= PYPI PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} @@ -12,7 +12,9 @@ WWW= https://aider.chat/ LICENSE= APACHE20 LICENSE_FILE= ${WRKSRC}/LICENSE.txt -BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}setuptools>=0:devel/py-setuptools@${PY_FLAVOR} +BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}setuptools-scm>0:devel/py-setuptools-scm@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}setuptools>=0:devel/py-setuptools@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}wheel>=0:devel/py-wheel@${PY_FLAVOR} RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}arrow>0:devel/py-arrow@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}backoff>0:devel/py-backoff@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}beautifulsoup>=0:www/py-beautifulsoup@${PY_FLAVOR} \ @@ -26,6 +28,7 @@ RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}arrow>0:devel/py-arrow@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}greenlet>=0:devel/py-greenlet@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}grep-ast>0:textproc/py-grep-ast@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}huggingface-hub>0:misc/py-huggingface-hub@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}json5>0:devel/py-json5@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}jsonschema>=0:devel/py-jsonschema@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}litellm>=1.24.5:misc/py-litellm@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}networkx>0:math/py-networkx@${PY_FLAVOR} \ @@ -33,9 +36,11 @@ RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}arrow>0:devel/py-arrow@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}openai>=1.0.0:misc/py-openai@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}packaging>=0:devel/py-packaging@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}pathspec>0:devel/py-pathspec@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}pexpect>=4.9.0:misc/py-pexpect@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}pillow>0:graphics/py-pillow@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}prompt-toolkit>0:devel/py-prompt-toolkit@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}pypandoc>=0:textproc/py-pypandoc@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}pyperclip>=1.7.0:devel/py-pyperclip@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}pyyaml-include>=1.2:devel/py-pyyaml-include@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}rich>0:textproc/py-rich@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}scipy>0:science/py-scipy@${PY_FLAVOR} \ @@ -50,7 +55,7 @@ RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}arrow>0:devel/py-arrow@${PY_FLAVOR} \ # google-generativeai is not a popular aider dependency USES= python shebangfix -USE_PYTHON= autoplist concurrent distutils +USE_PYTHON= autoplist concurrent pep517 NO_ARCH= yes diff --git a/misc/py-aider-chat/distinfo b/misc/py-aider-chat/distinfo index e764ae7be70f..212de797711d 100644 --- a/misc/py-aider-chat/distinfo +++ b/misc/py-aider-chat/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1722097913 -SHA256 (aider_chat-0.45.0.tar.gz) = 47afeb18a342dd5d33aa1b034ca04120b7a599f55c127365297bc097ee565b6b -SIZE (aider_chat-0.45.0.tar.gz) = 135453 +TIMESTAMP = 1725874773 +SHA256 (aider_chat-0.55.0.tar.gz) = 926aee4a58db65be3aef90871ef8154aa7279e404cf6f87ab74d3f3cc7380703 +SIZE (aider_chat-0.55.0.tar.gz) = 38770341 diff --git a/misc/py-aider-chat/files/patch-aider_commands.py b/misc/py-aider-chat/files/patch-aider_commands.py new file mode 100644 index 000000000000..e10a23a450fe --- /dev/null +++ b/misc/py-aider-chat/files/patch-aider_commands.py @@ -0,0 +1,25 @@ +--- aider/commands.py.orig 2024-09-09 10:14:11 UTC ++++ aider/commands.py +@@ -15,7 +15,7 @@ from aider.run_cmd import run_cmd + from aider.llm import litellm + from aider.repo import ANY_GIT_ERROR + from aider.run_cmd import run_cmd +-from aider.scrape import Scraper, install_playwright ++from aider.scrape import Scraper + from aider.utils import is_image_file + + from .dump import dump # noqa: F401 +@@ -145,12 +145,8 @@ class Commands: + + self.io.tool_output(f"Scraping {url}...") + if not self.scraper: +- res = install_playwright(self.io) +- if not res: +- self.io.tool_warning("Unable to initialize playwright.") +- + self.scraper = Scraper( +- print_error=self.io.tool_error, playwright_available=res, verify_ssl=self.verify_ssl ++ print_error=self.io.tool_error, playwright_available=False, verify_ssl=self.verify_ssl + ) + + content = self.scraper.scrape(url) or "" diff --git a/misc/py-aider-chat/files/patch-aider_scrape.py b/misc/py-aider-chat/files/patch-aider_scrape.py index f590cbbf2c49..969ff29d15f8 100644 --- a/misc/py-aider-chat/files/patch-aider_scrape.py +++ b/misc/py-aider-chat/files/patch-aider_scrape.py @@ -1,17 +1,17 @@ ---- aider/scrape.py.orig 2024-07-27 19:09:04 UTC +--- aider/scrape.py.orig 2024-09-09 10:28:04 UTC +++ aider/scrape.py -@@ -15,56 +15,9 @@ def install_playwright(io): +@@ -15,57 +15,8 @@ def install_playwright(io): def install_playwright(io): - try: - from playwright.sync_api import sync_playwright -+ return ++ return False - has_pip = True - except ImportError: - has_pip = False - +- - try: - with sync_playwright() as p: - p.chromium.launch() @@ -23,7 +23,8 @@ - return True - - pip_cmd = utils.get_pip_install(["aider-chat[playwright]"]) -- chromium_cmd = "playwright install --with-deps chromium".split() +- chromium_cmd = "-m playwright install --with-deps chromium" +- chromium_cmd = [sys.executable] + chromium_cmd.split() - - cmds = "" - if not has_pip: @@ -37,7 +38,7 @@ -See {urls.enable_playwright} for more info. -""" - -- io.tool_error(text) +- io.tool_output(text) - if not io.confirm_ask("Install playwright?", default="y"): - return - @@ -58,15 +59,81 @@ class Scraper: pandoc_available = None playwright_available = None -@@ -89,10 +42,7 @@ class Scraper: - `url` - the URLto scrape. +@@ -82,7 +33,7 @@ class Scraper: + else: + self.print_error = print + +- self.playwright_available = playwright_available ++ self.playwright_available = False + self.verify_ssl = verify_ssl + + def scrape(self, url): +@@ -93,10 +44,7 @@ class Scraper: + `url` - the URL to scrape. """ - if self.playwright_available: -- content = self.scrape_with_playwright(url) +- content, mime_type = self.scrape_with_playwright(url) - else: -- content = self.scrape_with_httpx(url) -+ content = self.scrape_with_httpx(url) +- content, mime_type = self.scrape_with_httpx(url) ++ content, mime_type = self.scrape_with_httpx(url) if not content: - return + self.print_error(f"Failed to retrieve content from {url}") +@@ -130,56 +78,6 @@ class Scraper: + return False + + # Internals... +- def scrape_with_playwright(self, url): +- import playwright # noqa: F401 +- from playwright.sync_api import Error as PlaywrightError +- from playwright.sync_api import TimeoutError as PlaywrightTimeoutError +- from playwright.sync_api import sync_playwright +- +- with sync_playwright() as p: +- try: +- browser = p.chromium.launch() +- except Exception as e: +- self.playwright_available = False +- self.print_error(str(e)) +- return None, None +- +- try: +- context = browser.new_context(ignore_https_errors=not self.verify_ssl) +- page = context.new_page() +- +- user_agent = page.evaluate("navigator.userAgent") +- user_agent = user_agent.replace("Headless", "") +- user_agent = user_agent.replace("headless", "") +- user_agent += " " + aider_user_agent +- +- page.set_extra_http_headers({"User-Agent": user_agent}) +- +- response = None +- try: +- response = page.goto(url, wait_until="networkidle", timeout=5000) +- except PlaywrightTimeoutError: +- self.print_error(f"Timeout while loading {url}") +- except PlaywrightError as e: +- self.print_error(f"Error navigating to {url}: {str(e)}") +- return None, None +- +- try: +- content = page.content() +- mime_type = None +- if response: +- content_type = response.header_value("content-type") +- if content_type: +- mime_type = content_type.split(";")[0] +- except PlaywrightError as e: +- self.print_error(f"Error retrieving page content: {str(e)}") +- content = None +- mime_type = None +- finally: +- browser.close() +- +- return content, mime_type +- + def scrape_with_httpx(self, url): + import httpx + diff --git a/misc/py-aider-chat/files/patch-pyproject.toml b/misc/py-aider-chat/files/patch-pyproject.toml new file mode 100644 index 000000000000..2c261ee0ce98 --- /dev/null +++ b/misc/py-aider-chat/files/patch-pyproject.toml @@ -0,0 +1,11 @@ +--- pyproject.toml.orig 2024-09-09 09:50:15 UTC ++++ pyproject.toml +@@ -62,7 +62,7 @@ include = ["aider*", "aider.website"] + ] + + [build-system] +-requires = ["setuptools>=68", "setuptools_scm[toml]>=8"] ++requires = ["setuptools>=61", "setuptools_scm[toml]>=8"] + build-backend = "setuptools.build_meta" + + [tool.setuptools_scm] diff --git a/misc/py-aider-chat/files/patch-setup.py b/misc/py-aider-chat/files/patch-setup.py deleted file mode 100644 index 6a9f4e08d16e..000000000000 --- a/misc/py-aider-chat/files/patch-setup.py +++ /dev/null @@ -1,11 +0,0 @@ ---- setup.py.orig 2024-07-27 19:19:07 UTC -+++ setup.py -@@ -33,7 +33,7 @@ print("Packages:", packages) - - print("Packages:", packages) - --extras = "dev help browser playwright".split() -+extras = [] - - setup( - name="aider-chat",