%global srcname pgcopy-standalone # Upstream mistagged this, the actual version is 1.6.0 %global srcversion 0.1.6 # The tests require a running database %bcond check 0 Name: python-%{srcname} Version: 1.6.0 Release: %autorelease Summary: Standalone fast database insert with PostgreSQL binary copy License: MIT URL: https://github.com/LaunchPlatform/pgcopy-standalone # PyPI tarball doesn't include tests Source: %{url}/archive/%{srcversion}/%{srcname}-%{srcversion}.tar.gz BuildArch: noarch BuildRequires: python3-devel BuildRequires: sed %if %{with check} BuildRequires: python3dist(psycopg2) BuildRequires: python3dist(pytest) %endif %global _description %{expand: This package provides fast database insert with PostgreSQL binary copy without the need for a psycopg2 dependency. It is a fork of pgcopy.} %description %_description %package -n python3-%{srcname} Summary: %{summary} %description -n python3-%{srcname} %_description %prep %autosetup -p1 -n %{srcname}-%{srcversion} # Relax pytz versioning sed -i 's/pytz = "^2023.3.post1"/pytz = ">=2023.3.post1"/' pyproject.toml # We don't care about Python 2 rm pgcopy/errors/py2.py cat > pgcopy/errors/__init__.py <