14
0
forked from pool/python-genson
Files
python-genson/use-sys-executable.patch
Steve Kowalik dc2d0bad8a - Update to 1.3.0:
* add support for Python versions up through 3.12
  * remove support for old Python versions older than 3.7 since test
    dependencies no longer support them
  * remove Python 2.7 support
    + remove tests & test commands only relevant to Python 2.7
    + remove backwards-compatibility from code
  * enable running as a module (python -m genson)
  * modernize package configuration
  * Use a valid schema_uri in tests
- Add patch use-sys-executable.patch:
  * Use sys.executable, rather than python in testsuite.
- Switch to autosetup, pyproject and pytest macros.
- No more greedy globs in %files.

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-genson?expand=0&rev=5
2025-03-03 03:23:11 +00:00

34 lines
1.1 KiB
Diff

From bfa7b22533082c954dcaed46bd7ff0bb3f2e291e Mon Sep 17 00:00:00 2001
From: Steve Kowalik <steven@wedontsleep.org>
Date: Mon, 3 Mar 2025 14:14:04 +1100
Subject: [PATCH] test: Use sys.executable for integration testing
Systems may not have a python executable in $PATH when running the
testsuite. Since we're already running inside a Python process, we can
leverage sys.executable to give us the full path instead.
---
test/test_bin.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/test/test_bin.py b/test/test_bin.py
index 5a8aeaf..08baff4 100644
--- a/test/test_bin.py
+++ b/test/test_bin.py
@@ -1,6 +1,7 @@
import unittest
import json
import os
+import sys
from subprocess import Popen, PIPE
from genson import SchemaBuilder
@@ -25,7 +26,7 @@ def run(args=tuple(), stdin_data=None):
Run the ``genson`` executable as a subprocess and return
(stdout, stderr).
"""
- full_args = ['python', '-m', 'genson']
+ full_args = [sys.executable, '-m', 'genson']
full_args.extend(args)
env = os.environ.copy()
env['COLUMNS'] = '80' # set width for deterministic text wrapping