1
0

Compare commits

...

4 Commits

Author SHA256 Message Date
080f7edb81 Accepting request 1266129 from devel:languages:python
- Make the dist-info name case-insensitive
- Lowercase metadata directory name.
- Update to 2.1.1
  * Add support for 3.13
  * Don’t require legacy-cgi to be installed on 3.13 and later (#176)
  * Don’t permit FieldStorageUploadConverter to be instantiated without
    having legacy-cgi installed since it does not make sense
  * Releases are now automated through GitHub Actions (#184)
- Adjust upstream source name in spec file
- Drop do-not-always-use-cgi-module.patch, merged upstream

OBS-URL: https://build.opensuse.org/request/show/1266129
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-FormEncode?expand=0&rev=22
2025-04-11 14:44:52 +00:00
a9fe0a54fd - Make the dist-info name case-insensitive
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-FormEncode?expand=0&rev=39
2025-04-01 12:22:41 +00:00
4a9d1e77be - Lowercase metadata directory name.
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-FormEncode?expand=0&rev=38
2025-03-26 00:39:43 +00:00
7c77d04e3e Accepting request 1244707 from home:glaubitz:branches:devel:languages:python
- Update to 2.1.1
  * Add support for 3.13
  * Don’t require legacy-cgi to be installed on 3.13 and later (#176)
  * Don’t permit FieldStorageUploadConverter to be instantiated without
    having legacy-cgi installed since it does not make sense
  * Releases are now automated through GitHub Actions (#184)
- Adjust upstream source name in spec file
- Drop do-not-always-use-cgi-module.patch, merged upstream

OBS-URL: https://build.opensuse.org/request/show/1244707
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-FormEncode?expand=0&rev=37
2025-02-10 13:48:19 +00:00
5 changed files with 30 additions and 66 deletions

BIN
FormEncode-2.1.0.tar.gz (Stored with Git LFS)

Binary file not shown.

View File

@ -1,56 +0,0 @@
From 77053ce944c11b1bae67cee387275e9f36d8d049 Mon Sep 17 00:00:00 2001
From: Oleg Broytman <phd@phdru.name>
Date: Fri, 10 Nov 2023 18:17:15 +0300
Subject: [PATCH] Protect `import cgi`
Module `cgi` was declared obsolete in Python 3.11
and will be removed in 3.13.
Fixes: #175.
---
src/formencode/validators.py | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/src/formencode/validators.py b/src/formencode/validators.py
index f2011b4..6f272b7 100644
--- a/src/formencode/validators.py
+++ b/src/formencode/validators.py
@@ -5,7 +5,10 @@
Validator/Converters for use with FormEncode.
"""
-import cgi
+try:
+ import cgi
+except ImportError: # Python >= 3.13
+ cgi = None
import re
import warnings
from encodings import idna
@@ -1772,7 +1775,7 @@ class FieldStorageUploadConverter(FancyValidator):
no upload was given).
"""
def _convert_to_python(self, value, state=None):
- if isinstance(value, cgi.FieldStorage):
+ if cgi and isinstance(value, cgi.FieldStorage):
if getattr(value, 'filename', None):
return value
raise Invalid('invalid', value, state)
@@ -1780,7 +1783,7 @@ def _convert_to_python(self, value, state=None):
return value
def is_empty(self, value):
- if isinstance(value, cgi.FieldStorage):
+ if cgi and isinstance(value, cgi.FieldStorage):
return not bool(getattr(value, 'filename', None))
return FancyValidator.is_empty(self, value)
@@ -1825,7 +1828,7 @@ def _convert_to_python(self, value, state):
upload = value.get(self.upload_key)
static = value.get(self.static_key, '').strip()
filename = content = None
- if isinstance(upload, cgi.FieldStorage):
+ if cgi and isinstance(upload, cgi.FieldStorage):
filename = upload.filename
content = upload.value
elif isinstance(upload, str) and upload:

BIN
formencode-2.1.1.tar.gz (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -1,3 +1,25 @@
-------------------------------------------------------------------
Tue Apr 1 11:56:57 UTC 2025 - Markéta Machová <mmachova@suse.com>
- Make the dist-info name case-insensitive
-------------------------------------------------------------------
Wed Mar 26 00:39:25 UTC 2025 - Steve Kowalik <steven.kowalik@suse.com>
- Lowercase metadata directory name.
-------------------------------------------------------------------
Mon Feb 10 10:10:13 UTC 2025 - John Paul Adrian Glaubitz <adrian.glaubitz@suse.com>
- Update to 2.1.1
* Add support for 3.13
* Dont require legacy-cgi to be installed on 3.13 and later (#176)
* Dont permit FieldStorageUploadConverter to be instantiated without
having legacy-cgi installed since it does not make sense
* Releases are now automated through GitHub Actions (#184)
- Adjust upstream source name in spec file
- Drop do-not-always-use-cgi-module.patch, merged upstream
-------------------------------------------------------------------
Tue Sep 10 04:11:22 UTC 2024 - Steve Kowalik <steven.kowalik@suse.com>

View File

@ -1,7 +1,7 @@
#
# spec file for package python-FormEncode
#
# Copyright (c) 2024 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
@ -18,14 +18,12 @@
%{?sle15_python_module_pythons}
Name: python-FormEncode
Version: 2.1.0
Version: 2.1.1
Release: 0
Summary: HTML form validation, generation, and conversion package
License: Python-2.0
URL: https://formencode.org
Source: https://files.pythonhosted.org/packages/source/F/FormEncode/FormEncode-%{version}.tar.gz
# PATCH-FIX-UPSTREAM gh#formencode/formencode#176
Patch0: do-not-always-use-cgi-module.patch
Source: https://files.pythonhosted.org/packages/source/f/formencode/formencode-%{version}.tar.gz
BuildRequires: %{python_module base >= 3.7}
BuildRequires: %{python_module dnspython}
BuildRequires: %{python_module pip}
@ -45,7 +43,7 @@ a declarative form of defining the validation, and decoupled processes
for filling and generating forms.
%prep
%autosetup -p1 -n FormEncode-%{version}
%autosetup -p1 -n formencode-%{version}
%build
%pyproject_wheel
@ -73,6 +71,6 @@ python2_flags="--version"
%license LICENSE.txt
%doc README.rst
%{python_sitelib}/formencode
%{python_sitelib}/FormEncode-%{version}.dist-info
%{python_sitelib}/[fF]orm[eE]ncode-%{version}.dist-info
%changelog