15
0

- Convert to libalternatives on SLE-16-based and newer systems only

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-ini2toml?expand=0&rev=30
This commit is contained in:
2025-08-21 08:45:47 +00:00
committed by Git OBS Bridge
commit 0ca33edd22
6 changed files with 368 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

1
.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
.osc

3
_multibuild Normal file
View File

@@ -0,0 +1,3 @@
<multibuild>
<package>test</package>
</multibuild>

BIN
ini2toml-0.15.tar.gz LFS Normal file

Binary file not shown.

110
python-ini2toml.changes Normal file
View File

@@ -0,0 +1,110 @@
-------------------------------------------------------------------
Thu Aug 21 08:40:47 UTC 2025 - Markéta Machová <mmachova@suse.com>
- Convert to libalternatives on SLE-16-based and newer systems only
-------------------------------------------------------------------
Wed May 28 12:27:02 UTC 2025 - Markéta Machová <mmachova@suse.com>
- Convert to pip-based build and libalternatives
-------------------------------------------------------------------
Tue May 14 19:03:10 UTC 2024 - Dirk Müller <dmueller@suse.com>
- update to 0.15:
* Due to the change in API for pyproject-fmt introduce a
dependency cap.
-------------------------------------------------------------------
Fri May 3 07:41:22 UTC 2024 - Dirk Müller <dmueller@suse.com>
- update to 0.14:
* Introduce LiteTranslator and FullTranslator as convenience
classes for more deterministic behaviour, :pr:`95`.
* setuptools plugin: Fix ValueError when setup.cfg contains
[options.packages.find] but also lists [options] packages =
... explicitly as a list of package names, :issue:`93`.
* Fix ValueError when setup.cfg contains
[options.packages.find] but also lists [options] packages =
... explicitly as a list of package names, :issue:`93`.
* pytest plugin: Remove comments when converting addopts with
multi-line values, :issue:`98`.
* Remove comments when converting addopts with multi-line
values, :issue:`98`.
-------------------------------------------------------------------
Wed Mar 20 13:18:28 UTC 2024 - Daniel Garcia <daniel.garcia@suse.com>
- Add python-tomli requirement
-------------------------------------------------------------------
Thu Dec 7 22:06:21 UTC 2023 - Dirk Müller <dmueller@suse.com>
- update to 0.13:
* Fix errors when ``isort`` is installed in the same
environment as ``ini2toml``
* Add support for ``file:`` directive in ``install_requires``
and ``extras_require``
-------------------------------------------------------------------
Tue May 30 06:22:39 UTC 2023 - Daniel Garcia <daniel.garcia@suse.com>
- Remove ConfigUpdater dependency for tests when it's not building for
the -full or -all subpackage.
-------------------------------------------------------------------
Fri May 5 00:13:56 UTC 2023 - Dirk Müller <dmueller@suse.com>
- update to 0.12:
* Fix logging in case of early errors while loading plugins,
* Log warning if ``flake8`` and ``devpi`` sections are
translation, prompting the user to review the output
* Fix parsing of ``filterwarnings``
-------------------------------------------------------------------
Fri Apr 21 12:26:55 UTC 2023 - Dirk Müller <dmueller@suse.com>
- add sle15_python_module_pythons (jsc#PED-68)
-------------------------------------------------------------------
Tue Apr 18 22:30:13 UTC 2023 - Matej Cepl <mcepl@suse.com>
- Switch to single spec version build for PSP
- Set ringdisabled for PSP (we need only -lite subpackage).
-------------------------------------------------------------------
Tue Apr 18 22:09:56 UTC 2023 - Matej Cepl <mcepl@suse.com>
- Switch to single spec version build for PSP
-------------------------------------------------------------------
Thu Nov 24 18:40:31 UTC 2022 - Daniel Garcia <daniel.garcia@suse.com>
- Update to 0.11.3:
* Fix dependency problems by requiring pyproject-fmt>=0.4.0
- 0.11.2:
* Adapt to changes in pyproject-fmt 0.4.0
- 0.11.1:
* Internal test fixes, minor CI and doc improvements
* Only list pyproject-fmt as an experimental dependency on Python 3.7+
-------------------------------------------------------------------
Fri Aug 5 09:35:34 UTC 2022 - Ben Greiner <code@bnavigator.de>
- Disable full and all in Ring1: Don't require ConfigUpdate
-------------------------------------------------------------------
Fri Jul 22 13:36:21 UTC 2022 - Ben Greiner <code@bnavigator.de>
- Make multibuild in order to check extra requirements
-------------------------------------------------------------------
Thu Jul 14 16:24:18 UTC 2022 - Ben Greiner <code@bnavigator.de>
- first submit with a service induced specfile clean
-------------------------------------------------------------------
Wed Jul 13 15:04:09 UTC 2022 - Ben Greiner <code@bnavigator.de>
- Initial specfile for v0.11
- Required by setuptools 63 testsuite

228
python-ini2toml.spec Normal file
View File

@@ -0,0 +1,228 @@
#
# spec file for package python-ini2toml
#
# 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/
#
%{?sle15_python_module_pythons}
%global flavor @BUILD_FLAVOR@%{nil}
%if "%{flavor}" == "test"
%define psuffix -test
%bcond_without test
%endif
%if "%{flavor}" == ""
%define psuffix %{nil}
%bcond_with test
%endif
%bcond_with ringdisabled
# | Ring1 | Factory |
# ringdisabled | x | |
# ------ | ----- | ------- |
# lite | x | x |
# full | | x |
# all | | x |
# experimental | | |
%bcond_without lite
%if 0%{?suse_version} == 1500 && 0%{?sle_version} >= 150400
%bcond_without ringdisabled
%endif
%bcond_with experimental
%if %{with ringdisabled}
%bcond_with full
%bcond_with all
%else
%bcond_without full
%bcond_without all
%endif
%if 0%{?suse_version} > 1500
%bcond_without libalternatives
%else
%bcond_with libalternatives
%endif
Name: python-ini2toml%{psuffix}
Version: 0.15
Release: 0
Summary: Automatic conversion of .ini/cfg files to TOML equivalents
License: MPL-2.0
URL: https://github.com/abravalheri/ini2toml/
Source: https://files.pythonhosted.org/packages/source/i/ini2toml/ini2toml-%{version}.tar.gz
BuildRequires: %{python_module pip}
BuildRequires: %{python_module setuptools_scm}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module wheel}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
Requires: python-packaging >= 20.7
BuildArch: noarch
%if %{with libalternatives}
BuildRequires: alts
Requires: alts
%else
Requires(post): update-alternatives
Requires(postun): update-alternatives
%endif
%if %{with test}
BuildRequires: %{python_module packaging >= 20.7}
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module validate-pyproject >= 0.6 with %python-validate-pyproject < 2}
%if %{with lite}
BuildRequires: %{python_module ini2toml-lite = %{version}}
%endif
%if %{with full}
BuildRequires: %{python_module ini2toml-full = %{version}}
%endif
%if %{with all}
BuildRequires: %{python_module ini2toml-all = %{version}}
%endif
%if %{with full} || %{with all}
BuildRequires: %{python_module ConfigUpdater}
%endif
%if %{with experimental}
BuildRequires: %{python_module ini2toml-experimental = %{version}}
%endif
%endif
%python_subpackages
%description
The original purpose of this project is to help migrating setup.cfg files
to PEP 621, but by extension it can also be used to convert any compatible ini_cfg
file to TOML.
%if %{with lite}
%package lite
Summary: Python ini2toml[lite] extra requirement
Requires: python-ini2toml = %{version}
Requires: python-tomli
Requires: (python-importlib-metadata if python-base < 3.8)
Requires: (python-tomli-w >= 0.4.0 with python-tomli-w < 2)
%description lite
The ini2toml[lite] extra requirements for %{python_flavor}-ini2toml
%endif
%if %{with full}
%package full
Summary: Python ini2toml[full] extra requirement
Requires: python-ini2toml = %{version}
Requires: (python-configupdater >= 3.0.1 with python-configupdater < 4)
Requires: (python-tomlkit >= 0.10 with python-tomlkit < 2)
%description full
The ini2toml[full] extra requirements for %{python_flavor}-ini2toml
%endif
%if %{with all}
%package all
Summary: Python ini2toml[all] extra requirement
Requires: python-ini2toml = %{version}
Requires: python-tomli
Requires: (python-configupdater >= 3.0.1 with python-configupdater < 4)
Requires: (python-importlib-metadata if python-base < 3.8)
Requires: (python-tomli-w >= 0.4.0 with python-tomli-w < 2)
Requires: (python-tomlkit >= 0.10 with python-tomlkit < 2)
%description all
The ini2toml[all] extra requirements for %{python_flavor}-ini2toml
%endif
%if %{with experimental}
%package experimental
Summary: Python ini2toml[experimental] extra requirement
Requires: python-ini2toml = %{version}
Requires: (python-pyproject-fmt >= 0.4.0 with python-pyproject-fmt < 2)
%description experimental
The ini2toml[experimental] extra requirements for %{python_flavor}-ini2toml
%endif
%prep
%setup -q -n ini2toml-%{version}
sed -i 's/--cov ini2toml --cov-report term-missing//' setup.cfg
%if !%{with test}
%build
%pyproject_wheel
%install
%pyproject_install
%python_clone -a %{buildroot}%{_bindir}/ini2toml
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%endif
%if %{with test}
%check
%if %{without all} && %{without full}
rm -v src/ini2toml/drivers/configupdater.py
rm -v src/ini2toml/drivers/full_toml.py
ignoretests=(
--ignore tests/test_examples.py
--ignore tests/test_transformations.py
--ignore tests/test_translator.py
--ignore tests/drivers/test_configupdater.py
--ignore tests/plugins/test_best_effort.py
--ignore tests/plugins/test_coverage.py
--ignore tests/drivers/test_full_toml.py
--ignore tests/plugins/test_isort.py
--ignore tests/plugins/test_mypy.py
--ignore tests/plugins/test_pytest.py
--ignore tests/plugins/test_setuptools_pep621.py
--ignore tests/plugins/test_toml_incompatibilities.py
)
%endif
%if %{without experimental}
donttest=(-k "not test_auto_formatting")
%endif
%pytest "${ignoretests[@]}" "${donttest[@]}"
%endif
%post
%python_install_alternative ini2toml
%postun
%python_uninstall_alternative ini2toml
%pre
%python_libalternatives_reset_alternative ini2toml
%if !%{with test}
%files %{python_files}
%doc AUTHORS.rst CHANGELOG.rst README.rst
%license LICENSE.txt
%python_alternative %{_bindir}/ini2toml
%{python_sitelib}/ini2toml
%{python_sitelib}/ini2toml-%{version}*-info
%if %{with lite}
%files %{python_files lite}
%license LICENSE.txt
%endif
%if %{with full}
%files %{python_files full}
%license LICENSE.txt
%endif
%if %{with all}
%files %{python_files all}
%license LICENSE.txt
%endif
%if %{with experimental}
%files %{python_files experimental}
%license LICENSE.txt
%endif
%endif
%changelog