From af389b61ce7367ba91e62aef8bd5ce37e748b78d Mon Sep 17 00:00:00 2001 From: Jvle Date: Wed, 11 Mar 2026 22:34:24 +0800 Subject: [PATCH] SPECS: add python-tokenize-rt Signed-off-by: Jvle --- python-tokenize-rt.spec | 48 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 python-tokenize-rt.spec diff --git a/python-tokenize-rt.spec b/python-tokenize-rt.spec new file mode 100644 index 0000000..880a119 --- /dev/null +++ b/python-tokenize-rt.spec @@ -0,0 +1,48 @@ +# SPDX-FileCopyrightText: (C) 2026 Institute of Software, Chinese Academy of Sciences (ISCAS) +# SPDX-FileCopyrightText: (C) 2026 openRuyi Project Contributors +# SPDX-FileContributor: Jvle +# +# SPDX-License-Identifier: MulanPSL-2.0 + +%global srcname tokenize-rt +%global modname tokenize_rt + +Name: python-%{srcname} +Version: 6.2.0 +Release: %autorelease +Summary: Wrapper for Python's stdlib `tokenize` supporting roundtrips +License: MIT +URL: https://github.com/asottile/tokenize-rt/ +#!RemoteAsset +Source0: https://files.pythonhosted.org/packages/source/t/%{modname}/%{modname}-%{version}.tar.gz +BuildArch: noarch +BuildSystem: pyproject + +BuildOption(install): -l %{modname} + +BuildRequires: gcc +BuildRequires: pkgconfig(python3) +BuildRequires: pyproject-rpm-macros +BuildRequires: python3dist(setuptools) +BuildRequires: python3dist(pytest) +# BuildRequires: python3dist(wheel) + +Provides: python3-%{srcname} +%python_provide python3-%{srcname} + +%description +The stdlib tokenize module does not properly roundtrip. This wrapper +around the stdlib provides two additional tokens ESCAPED_NL and +UNIMPORTANT_WS, and a Token data type. Use src_to_tokens and +tokens_to_src to roundtrip. This library is useful if you are writing +a refactoring tool based on the python tokenization. + +%generate_buildrequires +%pyproject_buildrequires + +%files -f %{pyproject_files} +%doc README.md +%{_bindir}/tokenize-rt + +%changelog +%{?autochangelog}