Blob Blame History Raw
%global         srcname     javaproperties

# tests are enabled by default
%bcond_without  tests

Name:           python-%{srcname}
Version:        0.8.1
Release:        %autorelease
Summary:        Read & write Java .properties files
License:        MIT
URL:  {srcname}/
Source0:        %pypi_source

BuildArch:      noarch

BuildRequires:  python3-devel
BuildRequires:  python3-setuptools

%if %{with tests}
BuildRequires:  python3-dateutil
BuildRequires:  python3-pytest
BuildRequires:  python3-pytest-mock

%global _description %{expand:
Read & write Java .properties files}

%description %{_description}

%package -n python3-%{srcname}
Summary:        %{summary}

%description -n python3-%{srcname} %{_description}

%autosetup -n %{srcname}-%{version}

# Project uses pyproject for building, but pyproject-rpm-macros don't exist in
# EPEL. This is a workaround to make it easily installable with setuptools.
tee > /dev/null << EOF
from setuptools import setup



%if %{with tests}
# Environment variables come from upstream's tox.ini:
# Tests fail if they are not present due to time zone shenanigans.
export LC_ALL=en_US.UTF-8
export TZ=EST5EDT,M3.2.0,M11.1.0

%files -n python3-%{srcname}
%license LICENSE
%doc README.rst