2018-06-01 13:03:32 +00:00
|
|
|
#
|
|
|
|
# spec file for package python-unify
|
|
|
|
#
|
2024-04-02 08:10:07 +00:00
|
|
|
# Copyright (c) 2024 SUSE LLC
|
2018-06-01 13:03:32 +00:00
|
|
|
#
|
|
|
|
# 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.
|
|
|
|
|
2018-12-04 14:11:39 +00:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
2018-06-11 10:05:08 +00:00
|
|
|
#
|
2018-06-01 13:03:32 +00:00
|
|
|
|
|
|
|
|
|
|
|
Name: python-unify
|
2019-09-10 09:33:48 +00:00
|
|
|
Version: 0.5
|
2018-06-01 13:03:32 +00:00
|
|
|
Release: 0
|
2018-06-11 10:05:08 +00:00
|
|
|
Summary: Tool to modify strings to use the same quotes
|
2018-06-01 13:03:32 +00:00
|
|
|
License: MIT
|
2019-06-03 11:55:46 +00:00
|
|
|
URL: https://github.com/myint/unify
|
|
|
|
Source: https://github.com/myint/unify/archive/v%{version}.tar.gz
|
2018-06-09 12:17:15 +00:00
|
|
|
Source9: README.suse
|
2024-12-12 05:46:20 +00:00
|
|
|
# PATCH-FIX-OPENSUSE Do not use lib2to3
|
|
|
|
Patch0: no-more-lib2to3.patch
|
|
|
|
BuildRequires: %{python_module pip}
|
2018-06-01 13:03:32 +00:00
|
|
|
BuildRequires: %{python_module setuptools}
|
2024-12-12 05:46:20 +00:00
|
|
|
BuildRequires: %{python_module wheel}
|
2018-06-01 13:03:32 +00:00
|
|
|
BuildRequires: fdupes
|
|
|
|
BuildRequires: python-rpm-macros
|
2019-06-03 11:55:46 +00:00
|
|
|
Requires: python-untokenize
|
2020-05-18 13:01:26 +00:00
|
|
|
Requires(post): update-alternatives
|
|
|
|
Requires(postun): update-alternatives
|
2019-06-03 11:55:46 +00:00
|
|
|
BuildArch: noarch
|
2018-06-01 13:03:32 +00:00
|
|
|
# SECTION test requirements
|
2019-06-03 11:55:46 +00:00
|
|
|
BuildRequires: %{python_module pytest}
|
2018-06-01 13:03:32 +00:00
|
|
|
BuildRequires: %{python_module untokenize}
|
|
|
|
# /SECTION
|
|
|
|
%python_subpackages
|
|
|
|
|
|
|
|
%description
|
2018-06-09 04:40:50 +00:00
|
|
|
Modifies strings to all use the same (single/double) quote where possible.
|
|
|
|
|
|
|
|
Note that the "unify" executable has been renamed to "unify_quotes" to
|
|
|
|
avoid conflicts with the wdiff package.
|
2018-06-01 13:03:32 +00:00
|
|
|
|
|
|
|
%prep
|
2024-12-12 05:46:20 +00:00
|
|
|
%autosetup -p1 -n unify-%{version}
|
2018-06-01 13:03:32 +00:00
|
|
|
sed -i -e '/^#!\//, 1d' unify.py
|
2018-06-09 12:17:15 +00:00
|
|
|
cp %{SOURCE9} .
|
2018-06-01 13:03:32 +00:00
|
|
|
|
|
|
|
%build
|
2024-12-12 05:46:20 +00:00
|
|
|
%pyproject_wheel
|
2018-06-01 13:03:32 +00:00
|
|
|
|
2019-06-03 11:55:46 +00:00
|
|
|
%check
|
2024-04-02 08:10:07 +00:00
|
|
|
# https://github.com/myint/unify/issues/22
|
|
|
|
donttest="DUMMY"
|
|
|
|
python312_donttest="or (TestUnitsWithFstrings and test_format_code)"
|
2024-12-12 05:46:20 +00:00
|
|
|
python313_donttest=$python312_donttest
|
2024-04-02 08:10:07 +00:00
|
|
|
%pytest -k "not ($donttest ${$python_donttest})"
|
2019-06-03 11:55:46 +00:00
|
|
|
|
2018-06-01 13:03:32 +00:00
|
|
|
%install
|
2024-12-12 05:46:20 +00:00
|
|
|
%pyproject_install
|
2018-06-01 13:03:32 +00:00
|
|
|
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
2018-06-09 04:40:50 +00:00
|
|
|
mv %{buildroot}%{_bindir}/unify %{buildroot}%{_bindir}/unify_quotes
|
2020-05-18 13:01:26 +00:00
|
|
|
%python_clone -a %{buildroot}%{_bindir}/unify_quotes
|
|
|
|
|
|
|
|
%post
|
|
|
|
%python_install_alternative unify_quotes
|
|
|
|
|
|
|
|
%postun
|
|
|
|
%python_uninstall_alternative unify_quotes
|
2018-06-01 13:03:32 +00:00
|
|
|
|
|
|
|
%files %{python_files}
|
2019-09-10 09:33:48 +00:00
|
|
|
%license LICENSE
|
2018-06-09 12:17:15 +00:00
|
|
|
%doc README.rst README.suse
|
2020-05-18 13:01:26 +00:00
|
|
|
%python_alternative %{_bindir}/unify_quotes
|
2024-04-02 08:10:07 +00:00
|
|
|
%{python_sitelib}/unify.py
|
2024-12-12 05:46:20 +00:00
|
|
|
%pycache_only %{python_sitelib}/__pycache__/unify*pyc
|
|
|
|
%{python_sitelib}/unify-%{version}.dist-info
|
2018-06-01 13:03:32 +00:00
|
|
|
|
|
|
|
%changelog
|