forked from pool/python-iniconfig
* add IniConfig.parse() classmethod with strip_inline_comments parameter (fixes #55) - by default (strip_inline_comments=True), inline comments are properly stripped from values - set strip_inline_comments=False to preserve old behavior if needed * IniConfig() constructor maintains backward compatibility (does not strip inline comments) * users should migrate to IniConfig.parse() for correct comment handling * add strip_section_whitespace parameter to IniConfig.parse() (regarding #4) - opt-in parameter to strip Unicode whitespace from section names - when True, strips Unicode whitespace (U+00A0, U+2000, U+3000, etc.) from section names - when False (default), preserves existing behavior for backward compatibility * clarify Unicode whitespace handling (regarding #4) - since iniconfig 2.0.0 (Python 3 only), all strings are Unicode by default - Python 3's str.strip() has handled Unicode whitespace since Python 3.0 (2008) - iniconfig automatically benefits from this in all supported versions (Python >= 3.10) - key names and values have Unicode whitespace properly stripped using Python's built-in methods - from version 2.2.0 * drop Python 3.8 and 3.9 support (now requires Python >= 3.10) * add Python 3.14 classifier * migrate from hatchling to setuptools 77 with setuptools_scm * adopt PEP 639 license specifiers and PEP 740 build attestations * migrate from black + pyupgrade to ruff * migrate CI to uv and unified test workflow * automate GitHub releases and PyPI publishing via Trusted Publishing * include tests in sdist * modernize code for Python 3.10+ (remove __future__ annotations, TYPE_CHECKING guards) * rename _ParsedLine to ParsedLine - Update BuildRequires from pyproject.toml OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-iniconfig?expand=0&rev=22
89 lines
2.7 KiB
RPMSpec
89 lines
2.7 KiB
RPMSpec
#
|
|
# spec file for package python-iniconfig
|
|
#
|
|
# 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
|
|
# 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/
|
|
#
|
|
|
|
|
|
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
|
|
%global flavor @BUILD_FLAVOR@%{nil}
|
|
%if "%{flavor}" == "test"
|
|
%define psuffix -%{flavor}
|
|
%bcond_without test
|
|
%else
|
|
%define psuffix %{nil}
|
|
%bcond_with test
|
|
%endif
|
|
%{?sle15_python_module_pythons}
|
|
Name: python-iniconfig%{psuffix}
|
|
Version: 2.3.0
|
|
Release: 0
|
|
Summary: iniconfig: brain-dead simple config-ini parsing
|
|
License: MIT
|
|
Group: Development/Languages/Python
|
|
URL: https://github.com/RonnyPfannschmidt/iniconfig
|
|
Source: https://files.pythonhosted.org/packages/source/i/iniconfig/iniconfig-%{version}.tar.gz
|
|
Source1: https://github.com/pytest-dev/iniconfig/archive/refs/tags/v%{version}.tar.gz#/iniconfig-%{version}-tests.tar.gz
|
|
BuildRequires: %{python_module base >= 3.8}
|
|
BuildRequires: %{python_module pip}
|
|
BuildRequires: %{python_module setuptools >= 77}
|
|
BuildRequires: %{python_module setuptools-scm >= 8}
|
|
BuildRequires: fdupes
|
|
BuildRequires: python-rpm-macros
|
|
BuildArch: noarch
|
|
%if %{with test}
|
|
BuildRequires: %{python_module iniconfig}
|
|
BuildRequires: %{python_module pytest}
|
|
%endif
|
|
%python_subpackages
|
|
|
|
%description
|
|
iniconfig is a small and simple INI-file parser module
|
|
having a unique set of features:
|
|
|
|
* tested against Python2.4 across to Python3.2, Jython, PyPy
|
|
* maintains order of sections and entries
|
|
* supports multi-line values with or without line-continuations
|
|
* supports "#" comments everywhere
|
|
* raises errors with proper line-numbers
|
|
* no bells and whistles like automatic substitutions
|
|
* iniconfig raises an Error if two sections have the same name.
|
|
|
|
%prep
|
|
%setup -q -n iniconfig-%{version} -a1
|
|
|
|
%if !%{with test}
|
|
%build
|
|
%pyproject_wheel
|
|
|
|
%install
|
|
%pyproject_install
|
|
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
|
%endif
|
|
|
|
%check
|
|
%if %{with test}
|
|
%pytest
|
|
%endif
|
|
|
|
%if !%{with test}
|
|
%files %{python_files}
|
|
%license LICENSE
|
|
%doc README.rst
|
|
%{python_sitelib}/iniconfig
|
|
%{python_sitelib}/iniconfig-%{version}.dist-info
|
|
%endif
|
|
|
|
%changelog
|