Compare commits
1 Commits
Author | SHA256 | Date | |
---|---|---|---|
a72e6d1a86 |
BIN
FormEncode-2.0.1.tar.gz
(Stored with Git LFS)
Normal file
BIN
FormEncode-2.0.1.tar.gz
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
FormEncode-2.1.0.tar.gz
(Stored with Git LFS)
BIN
FormEncode-2.1.0.tar.gz
(Stored with Git LFS)
Binary file not shown.
@@ -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:
|
|
@@ -1,33 +1,3 @@
|
|||||||
-------------------------------------------------------------------
|
|
||||||
Tue Sep 10 04:11:22 UTC 2024 - Steve Kowalik <steven.kowalik@suse.com>
|
|
||||||
|
|
||||||
- Add patch do-not-always-use-cgi-module.patch:
|
|
||||||
* Support Python 3.13 by making use of cgi optional.
|
|
||||||
- Switch to autosetup macro.
|
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
|
||||||
Tue Apr 16 13:25:39 UTC 2024 - Markéta Machová <mmachova@suse.com>
|
|
||||||
|
|
||||||
- Remove unneeded dependency on six
|
|
||||||
* https://github.com/formencode/formencode/commit/98e9e97e
|
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
|
||||||
Sat Dec 16 21:00:19 UTC 2023 - Dirk Müller <dmueller@suse.com>
|
|
||||||
|
|
||||||
- update to 2.1.0:
|
|
||||||
* Add support for Python 3.7 to 3.12, end support for older Python
|
|
||||||
versions
|
|
||||||
* Context.set() now works as a context manager
|
|
||||||
* Fix binary of swedish translation
|
|
||||||
* Some internal code cleanup and modernization
|
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
|
||||||
Tue Jul 18 02:48:07 UTC 2023 - Steve Kowalik <steven.kowalik@suse.com>
|
|
||||||
|
|
||||||
- Clean up Python 2 leftovers.
|
|
||||||
- Switch to pyproject macros.
|
|
||||||
- Drop BuildRequires on setuptools_scm_git_archive
|
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Fri Apr 21 12:20:37 UTC 2023 - Dirk Müller <dmueller@suse.com>
|
Fri Apr 21 12:20:37 UTC 2023 - Dirk Müller <dmueller@suse.com>
|
||||||
|
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# spec file for package python-FormEncode
|
# spec file for package python-FormEncode
|
||||||
#
|
#
|
||||||
# Copyright (c) 2024 SUSE LLC
|
# Copyright (c) 2023 SUSE LLC
|
||||||
#
|
#
|
||||||
# All modifications and additions to the file contributed by third parties
|
# All modifications and additions to the file contributed by third parties
|
||||||
# remain the property of their copyright owners, unless otherwise agreed
|
# remain the property of their copyright owners, unless otherwise agreed
|
||||||
@@ -16,27 +16,33 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
|
|
||||||
|
%define oldpython python
|
||||||
|
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
|
||||||
|
%bcond_without python2
|
||||||
%{?sle15_python_module_pythons}
|
%{?sle15_python_module_pythons}
|
||||||
Name: python-FormEncode
|
Name: python-FormEncode
|
||||||
Version: 2.1.0
|
Version: 2.0.1
|
||||||
Release: 0
|
Release: 0
|
||||||
Summary: HTML form validation, generation, and conversion package
|
Summary: HTML form validation, generation, and conversion package
|
||||||
License: Python-2.0
|
License: Python-2.0
|
||||||
URL: https://formencode.org
|
Group: Development/Languages/Python
|
||||||
|
URL: http://formencode.org
|
||||||
Source: https://files.pythonhosted.org/packages/source/F/FormEncode/FormEncode-%{version}.tar.gz
|
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
|
|
||||||
BuildRequires: %{python_module base >= 3.7}
|
|
||||||
BuildRequires: %{python_module dnspython}
|
BuildRequires: %{python_module dnspython}
|
||||||
BuildRequires: %{python_module pip}
|
|
||||||
BuildRequires: %{python_module pycountry}
|
BuildRequires: %{python_module pycountry}
|
||||||
BuildRequires: %{python_module pytest}
|
BuildRequires: %{python_module pytest}
|
||||||
|
BuildRequires: %{python_module setuptools_scm_git_archive}
|
||||||
BuildRequires: %{python_module setuptools_scm}
|
BuildRequires: %{python_module setuptools_scm}
|
||||||
BuildRequires: %{python_module setuptools}
|
BuildRequires: %{python_module setuptools}
|
||||||
BuildRequires: %{python_module wheel}
|
BuildRequires: %{python_module six}
|
||||||
BuildRequires: fdupes
|
BuildRequires: fdupes
|
||||||
BuildRequires: python-rpm-macros
|
BuildRequires: python-rpm-macros
|
||||||
|
Requires: python-six
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
|
%ifpython2
|
||||||
|
Provides: %{oldpython}-formencode = %{version}
|
||||||
|
Obsoletes: %{oldpython}-formencode < %{version}
|
||||||
|
%endif
|
||||||
%python_subpackages
|
%python_subpackages
|
||||||
|
|
||||||
%description
|
%description
|
||||||
@@ -45,19 +51,21 @@ a declarative form of defining the validation, and decoupled processes
|
|||||||
for filling and generating forms.
|
for filling and generating forms.
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%autosetup -p1 -n FormEncode-%{version}
|
%setup -q -n FormEncode-%{version}
|
||||||
|
|
||||||
%build
|
%build
|
||||||
%pyproject_wheel
|
%python_build
|
||||||
|
|
||||||
%install
|
%install
|
||||||
%pyproject_install
|
%python_install
|
||||||
|
rm %{buildroot}%{_prefix}/LICENSE.txt
|
||||||
# trick find-lang.sh into finding the translation files
|
# trick find-lang.sh into finding the translation files
|
||||||
%python_expand mv %{buildroot}%{$python_sitelib}/formencode/{i18n,locale}
|
%python_expand mv %{buildroot}%{$python_sitelib}/formencode/{i18n,locale}
|
||||||
%python_find_lang FormEncode
|
%python_find_lang FormEncode
|
||||||
sed -i s/locale/i18n/ python*-FormEncode.lang
|
sed -i s/locale/i18n/ python*-FormEncode.lang
|
||||||
%python_expand mv %{buildroot}%{$python_sitelib}/formencode/{locale,i18n}
|
%python_expand mv %{buildroot}%{$python_sitelib}/formencode/{locale,i18n}
|
||||||
# remove misplaced documentation
|
# remove misplaced documentation
|
||||||
|
%python_expand rm -r %{buildroot}%{$python_sitelib}/docs
|
||||||
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
||||||
|
|
||||||
%check
|
%check
|
||||||
@@ -73,6 +81,6 @@ python2_flags="--version"
|
|||||||
%license LICENSE.txt
|
%license LICENSE.txt
|
||||||
%doc README.rst
|
%doc README.rst
|
||||||
%{python_sitelib}/formencode
|
%{python_sitelib}/formencode
|
||||||
%{python_sitelib}/FormEncode-%{version}.dist-info
|
%{python_sitelib}/FormEncode-%{version}*-info
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
Reference in New Issue
Block a user