From a8695a5e551be6ef6bb8031ec260098fa26dd7bfbe78419f4ef44165c5fe67fa Mon Sep 17 00:00:00 2001 From: Nico Krapp Date: Tue, 27 May 2025 13:01:04 +0000 Subject: [PATCH] - Convert to pip-based build OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-fb-re2?expand=0&rev=13 --- .gitattributes | 23 +++++++++++++++ .gitignore | 1 + cpp17.patch | 12 ++++++++ python-fb-re2.changes | 37 +++++++++++++++++++++++ python-fb-re2.spec | 68 +++++++++++++++++++++++++++++++++++++++++++ v1.0.7.tar.gz | 3 ++ 6 files changed, 144 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 cpp17.patch create mode 100644 python-fb-re2.changes create mode 100644 python-fb-re2.spec create mode 100644 v1.0.7.tar.gz diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -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 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/cpp17.patch b/cpp17.patch new file mode 100644 index 0000000..c571e9e --- /dev/null +++ b/cpp17.patch @@ -0,0 +1,12 @@ +Index: pyre2-1.0.7/setup.py +=================================================================== +--- pyre2-1.0.7.orig/setup.py ++++ pyre2-1.0.7/setup.py +@@ -21,6 +21,6 @@ setup( + ext_modules = [Extension("_re2", + sources = ["_re2.cc"], + libraries = ["re2"], +- extra_compile_args=['-std=c++11'], ++ extra_compile_args=['-std=c++17'], + )], + ) diff --git a/python-fb-re2.changes b/python-fb-re2.changes new file mode 100644 index 0000000..0f20718 --- /dev/null +++ b/python-fb-re2.changes @@ -0,0 +1,37 @@ +------------------------------------------------------------------- +Tue May 27 11:38:59 UTC 2025 - Markéta Machová + +- Convert to pip-based build + +------------------------------------------------------------------- +Thu Mar 28 12:31:02 UTC 2024 - ecsos + +- Add %{?sle15_python_module_pythons} + +------------------------------------------------------------------- +Thu Feb 22 08:33:37 UTC 2024 - Markéta Machová + +- Fix tests on Python 3.12 + +------------------------------------------------------------------- +Thu Aug 3 11:02:39 UTC 2023 - Daniel Garcia + +- Add cpp17.patch to build in newer version of absl + gh#facebook/pyre2#25 + +------------------------------------------------------------------- +Wed May 19 09:09:13 UTC 2021 - pgajdos@suse.com + +- use %pytest_arch macro in %check + +------------------------------------------------------------------- +Tue Mar 12 15:11:50 UTC 2019 - Tomáš Chvátal + +- Update to 1.0.7: + * initialize regexp field to preven nullptr free +- Run tests (switch to github tarball for them) + +------------------------------------------------------------------- +Tue Dec 11 18:56:14 UTC 2018 - Thomas Bechtold + +- Initial packaging (version 1.0.6) diff --git a/python-fb-re2.spec b/python-fb-re2.spec new file mode 100644 index 0000000..4895053 --- /dev/null +++ b/python-fb-re2.spec @@ -0,0 +1,68 @@ +# +# spec file for package python-fb-re2 +# +# 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} +Name: python-fb-re2 +Version: 1.0.7 +Release: 0 +Summary: Python wrapper for Google's RE2 +License: BSD-3-Clause +Group: Development/Languages/Python +URL: https://github.com/facebook/pyre2 +Source: https://github.com/facebook/pyre2/archive/v%{version}.tar.gz +# PATCH-FIX-UPSTREAM cpp17.patch gh#facebook/pyre2#25 +Patch0: cpp17.patch +BuildRequires: %{python_module devel} +BuildRequires: %{python_module pip} +BuildRequires: %{python_module pytest} +BuildRequires: %{python_module setuptools} +BuildRequires: %{python_module wheel} +BuildRequires: fdupes +BuildRequires: gcc-c++ +BuildRequires: python-rpm-macros +BuildRequires: re2-devel +%python_subpackages + +%description +Python wrapper for Google's RE2 + +%prep +%autosetup -p1 -n pyre2-%{version} +# fix tests on py312 +sed -i 's/assertRaisesRegexp/assertRaisesRegex/g' tests/test_match.py + +%build +export CFLAGS="%{optflags}" +%pyproject_wheel + +%install +%pyproject_install +%python_expand %fdupes %{buildroot}%{$python_sitearch} + +%check +%pytest_arch + +%files %{python_files} +%doc README.rst +%license LICENSE +%{python_sitearch}/_re2*.so +%{python_sitearch}/re2.py +%{python_sitearch}/fb_re2-%{version}*-info +%pycache_only %{python_sitearch}/__pycache__ + +%changelog diff --git a/v1.0.7.tar.gz b/v1.0.7.tar.gz new file mode 100644 index 0000000..ebd0ea4 --- /dev/null +++ b/v1.0.7.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:277a5ca0731c9e3f6c5996965380280117fb47e4091fe44d61bd417bcf401e02 +size 11684