# # spec file for package python-cookies # # Copyright (c) 2023 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed # upon. The license for this file, and modifications and additions to the # file, is the same license as for the pristine package itself (unless the # license for the pristine package is not an Open Source License, in which # case the license is the MIT License). An "Open Source License" is a # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. # Please submit bugfixes or comments via https://bugs.opensuse.org/ # %define skip_python2 1 %define skip_python36 1 %define skip_python38 1 %define skip_python39 1 %define skip_python311 1 %{?sle15_python_module_pythons} Name: python-cookies Version: 2.2.1 Release: 6.2 Summary: Friendlier RFC 6265-compliant cookie parser/renderer License: MIT Group: Development/Languages/Python URL: https://github.com/sashahart/cookies Source: https://files.pythonhosted.org/packages/source/c/cookies/cookies-%{version}.tar.gz Source1: https://raw.githubusercontent.com/sashahart/cookies/master/LICENSE # PATCH-FIX-OPENSUSE do-not-install-test_cookies.diff -- Do not install test files Patch0: do-not-install-test_cookies.diff Patch1: python37.patch BuildRequires: %{python_module pip} BuildRequires: %{python_module pytest} BuildRequires: %{python_module wheel} BuildRequires: python-rpm-macros BuildArch: noarch %python_subpackages %description cookies.py is a Python module for working with HTTP cookies: parsing and rendering 'Cookie:' request headers and 'Set-Cookie:' response headers, and exposing a convenient API for creating and modifying cookies. It can be used as a replacement of Python's Cookie.py (aka http.cookies). * Rendering according to RFC 6265. It uses URL encoding to represent non-ASCII by default, like many other languages' libraries. * Liberal parsing, incorporating many complaints about Cookie.py barfing on common cookie formats which can be reliably parsed * Documented code, with chapter and verse from RFCs * A test suite with 100%% test coverage * Unlike Cookie.py, it doesn't lock all implementation inside its own classes. You can suppress minor parse exceptions with parameters rather than subclass wrappers. You can plug in your own parsers, renderers and validators for new or existing cookie attributes. You can render the data out in a dict. You can use the underlying imperative API or even lift the parser's regexps for your own parser or project. While this is intended to be a good module for handling cookies, it does not even try to do any of the following: * Backward compatibility with Cookie.py * Implementation of RFC 2109 or 2965 * Handle every conceivable output from legacy applications * Provide a means to store pickled Python objects in cookie values This does not compete with the cookielib (http.cookiejar) module in the Python standard library. %prep %autosetup -p1 -n cookies-%{version} cp %{SOURCE1} . %build %pyproject_wheel %install %pyproject_install %check %pytest test_cookies.py %files %{python_files} %license LICENSE %doc README %{python_sitelib}/cookies.py %pycache_only %{python_sitelib}/__pycache__/cookies*.pyc %{python_sitelib}/cookies-%{version}*-info %changelog * Wed May 31 2023 Matej Cepl - Clean up SPEC file * Fri Apr 21 2023 Dirk Müller - add sle15_python_module_pythons (jsc#PED-68) * Thu Apr 13 2023 Matej Cepl - Make calling of %%{sle15modernpython} optional. * Fri Feb 1 2019 Tomáš Chvátal - Apply patch to fix build on python3.7: * python37.patch * Thu Oct 18 2018 Tomáš Chvátal - Upstream moved to gitlab * Wed Aug 29 2018 tchvatal@suse.com - Add license - Run the tests in a way to work on 42.3 * Mon Apr 10 2017 alarrosa@suse.com - Update for singlespec - Add do-not-install-test_cookies.diff so test_cookies.py is not installed in the system. * Tue Feb 21 2017 jengelh@inai.de - Trim long description * Mon Feb 20 2017 alarrosa@suse.com - Use py.test in %%check to fix "setup.py test" not working with python 3.6 * Thu Jan 19 2017 alarrosa@suse.com - Initial release