public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Benjamin A. Beasley <code@musicinmybrain.net>
To: git-commits@fedoraproject.org
Subject: [rpms/hatch] epel10: Fix a couple of tests when no “python” in path
Date: Wed, 28 Oct 2026 14:58:14 GMT	[thread overview]
Message-ID: <179319949414.1.10054364910116706782.rpms-hatch-5cd3302f7480@fedoraproject.org> (raw)

A new commit has been pushed.

Repo   : rpms/hatch
Branch : epel10
Commit : 5cd3302f7480579c3c9ad89cabd687cd2f8b648e
Author : Benjamin A. Beasley <code@musicinmybrain.net>
Date   : 2026-10-28T14:15:21+00:00
Stats  : +36/-0 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/hatch/c/5cd3302f7480579c3c9ad89cabd687cd2f8b648e?branch=epel10

Log:
Fix a couple of tests when no “python” in path

---
diff --git a/hatch-1.15.1-unversioned-python.patch b/hatch-1.15.1-unversioned-python.patch
new file mode 100644
index 0000000..7dfce1b
--- /dev/null
+++ b/hatch-1.15.1-unversioned-python.patch
@@ -0,0 +1,25 @@
+diff -Naur a/tests/cli/run/test_run.py b/tests/cli/run/test_run.py
+--- a/tests/cli/run/test_run.py	2025-10-16 21:33:50.000000000 +0100
++++ b/tests/cli/run/test_run.py	2026-10-28 11:49:24.893183481 +0000
+@@ -1,4 +1,5 @@
+ import os
++import pathlib
+ import sys
+ 
+ import pytest
+@@ -710,7 +711,14 @@
+ 
+     project = Project(project_path)
+     config = dict(project.raw_config)
+-    config['tool']['hatch']['scripts'] = {'py': 'python -c {args}'}
++    # Try to handle testing on systems where there is no "python", only e.g.
++    # "python3". Ideally we would use the absolute path from sys.executable
++    # path, but then we are much more likely to have problems due to things
++    # like whitespace in the directory path, considering we are not attempting
++    # shell escaping. Even the executable name could have these issues, but
++    # this should be good enough for testing purposes.
++    py = pathlib.Path(sys.executable).name
++    config['tool']['hatch']['scripts'] = {'py': f'{py} -c {{args}}'}
+     project.save_config(config)
+ 
+     with project_path.as_cwd(env_vars={ConfigEnvVars.DATA: str(data_path)}):

diff --git a/hatch.spec b/hatch.spec
index fae1b9b..62c1b07 100644
--- a/hatch.spec
+++ b/hatch.spec
@@ -61,6 +61,17 @@ Source1700:     hatch-test.1
 # https://github.com/pypa/hatch/pull/1665
 Patch:          %{url}/pull/1665.patch
 
+# Fix a couple of tests when no “python” in path
+#
+# These CLI tests assume a “python” executable is available outside of a
+# virtualenv, which is not necessarily true (e.g. Fedora has only “python3” if
+# the `python-unversioned-command` package is not installed). Use the value of
+# `sys.executable` in the script configs for these tests instead.
+#
+# https://github.com/pypa/hatch/pull/2399
+# Backported to v1.15.1.
+Patch:          hatch-1.15.1-unversioned-python.patch
+
 BuildArch:      noarch
 
 %if %{with tests}

                 reply	other threads:[~2026-10-28 14:58 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=179319949414.1.10054364910116706782.rpms-hatch-5cd3302f7480@fedoraproject.org \
    --to=code@musicinmybrain.net \
    --cc=git-commits@fedoraproject.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