Compare commits

2 Commits

Author SHA256 Message Date
65e13ed685 Accepting request 1249581 from devel:languages:python
- 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/request/show/1249581
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-genson?expand=0&rev=3
2025-03-03 15:04:57 +00:00
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
7 changed files with 69 additions and 28 deletions

View File

@@ -1 +0,0 @@
"<22><><EFBFBD>"

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:8caf69aa10af7aee0e1a1351d1d06801f4696e005f06cedef438635384346a16
size 34387

3
genson-1.3.0.tar.gz Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:e02db9ac2e3fd29e65b5286f7135762e2cd8a986537c075b06fc5f1517308e37
size 34919

View File

@@ -1,3 +1,21 @@
-------------------------------------------------------------------
Mon Mar 3 03:20:38 UTC 2025 - Steve Kowalik <steven.kowalik@suse.com>
- 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.
-------------------------------------------------------------------
Sun Jan 24 10:41:39 UTC 2021 - Jan Engelhardt <jengelh@inai.de>

View File

@@ -1,7 +1,7 @@
#
# spec file for package python-genson
#
# Copyright (c) 2021 SUSE LLC
# Copyright (c) 2025 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -16,25 +16,27 @@
#
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-genson
Version: 1.2.2
Version: 1.3.0
Release: 0
Summary: Python JSON Schema generator
License: MIT
Group: Development/Languages/Python
URL: https://github.com/wolverdude/genson/
Source: https://files.pythonhosted.org/packages/source/g/genson/genson-%{version}.tar.gz
# https://github.com/wolverdude/GenSON/pull/53
Source1: https://raw.githubusercontent.com/wolverdude/GenSON/master/test/fixtures/cp1252.json
Source2: https://raw.githubusercontent.com/wolverdude/GenSON/master/test/fixtures/utf-8.json
# PATCH-FIX-UPSTREAM gh#wolverdude/GenSON#84
Patch0: use-sys-executable.patch
BuildRequires: %{python_module base >= 3.7}
BuildRequires: %{python_module pip}
BuildRequires: %{python_module setuptools}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
BuildArch: noarch
# SECTION test requirements
BuildRequires: %{python_module jsonschema}
BuildRequires: %{python_module pytest}
# /SECTION
Requires(post): update-alternatives
Requires(postun): update-alternatives
%python_subpackages
%description
@@ -44,29 +46,18 @@ Besides taking JSON objects and generating schemas that describe
them, this generator is able to merge schemas as well.
%prep
%setup -q -n genson-%{version}
mkdir test/fixtures
cp %{SOURCE1} %{SOURCE2} test/fixtures/
touch test/__init__.py
%autosetup -p1 -n genson-%{version}
%build
%python_build
%pyproject_wheel
%install
%python_install
%pyproject_install
%python_clone -a %{buildroot}%{_bindir}/genson
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%check
export LANG=en_US.UTF-8
mkdir ~/bin
export PATH=~/bin:$PATH
%{python_expand export PYTHONPATH=%{buildroot}%{$python_sitelib}
cp %{buildroot}/%{_bindir}/genson-%{$python_bin_suffix} ~/bin/genson
rm -f ~/bin/python
ln -s $(which $python) ~/bin/python
$python -m unittest -v
}
%pytest -k 'not test_no_input'
%post
%python_install_alternative genson
@@ -78,6 +69,7 @@ $python -m unittest -v
%doc AUTHORS.rst README.rst HISTORY.rst
%license LICENSE
%python_alternative %{_bindir}/genson
%{python_sitelib}/*
%{python_sitelib}/genson
%{python_sitelib}/genson-%{version}.dist-info
%changelog

33
use-sys-executable.patch Normal file
View File

@@ -0,0 +1,33 @@
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

View File

@@ -1 +0,0 @@
"€…™"