diff --git a/0001-fix-parse-error-py.patch b/0001-fix-parse-error-py.patch new file mode 100644 index 0000000..41dea4e --- /dev/null +++ b/0001-fix-parse-error-py.patch @@ -0,0 +1,20 @@ +From 84630b9f714207add20484d50804e830d68760dc Mon Sep 17 00:00:00 2001 +From: mengzhaoa +Date: Fri, 22 Sep 2023 09:48:14 +0800 +Subject: [PATCH] fix parse.py + +--- + pytype/tools/merge_pyi/test_data/parse_error.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/pytype/tools/merge_pyi/test_data/parse_error.py b/pytype/tools/merge_pyi/test_data/parse_error.py +index 5853871..98f1b66 100644 +--- a/pytype/tools/merge_pyi/test_data/parse_error.py ++++ b/pytype/tools/merge_pyi/test_data/parse_error.py +@@ -1,2 +1,2 @@ + # This will raise a MergeError +-def f(*): pass ++def f(*args): pass +-- +1.8.3.1 + diff --git a/python-pytype.spec b/python-pytype.spec new file mode 100644 index 0000000..9b38cff --- /dev/null +++ b/python-pytype.spec @@ -0,0 +1,52 @@ +%global pypi_name pytype + +Name: python-%{pypi_name} +Version: 2023.9.19 +Release: 1 +Summary: Python type inferencer + +License: Apache 2.0 +URL: https://github.com/google/pytype +Source0: %{url}/archive/v%{version}/%{pypi_name}-%{version}.tar.gz +Patch1: 0001-fix-parse-error-py.patch + +%description +Pytype checks and infers types for your Python code - without requiring type annotations. + +%package -n python3-%{pypi_name} +Summary: Python type inferencer +Provides: python-%{pypi_name} + +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-setuptools_scm +BuildRequires: python3-pip +BuildRequires: python3-wheel +BuildRequires: python3-pybind11 +BuildRequires: gcc-c++ +Requires: ninja-build + +%description -n python3-%{pypi_name} +Pytype checks and infers types for your Python code - without requiring type annotations. + +%prep +%autosetup -p1 -n %{pypi_name}-%{version} + +%build +%pyproject_build + +%install +%pyproject_install + +%files -n python3-%{pypi_name} +%license LICENSE +%doc README.md +%{python3_sitearch}/pytype*.dist-info/ +%{python3_sitearch}/pytype/ +%{python3_sitearch}/pytype_extensions/ +%{python3_sitearch}/third_party/ +%{_bindir} + +%changelog +* Wed Sep 20 2023 mengzhaoa - 2023.9.19-1 +- Init package. \ No newline at end of file diff --git a/pytype-2023.9.19.tar.gz b/pytype-2023.9.19.tar.gz new file mode 100644 index 0000000..204ec20 Binary files /dev/null and b/pytype-2023.9.19.tar.gz differ