6e44e2a
%bcond_without tests
6e44e2a
6e44e2a
%global pypi_name amply
6e44e2a
6e44e2a
%global _description %{expand:
6e44e2a
Amply allows you to load and manipulate AMPL data as Python data
6e44e2a
structures.
6e44e2a
6e44e2a
Amply only supports a specific subset of the AMPL syntax:
6e44e2a
6e44e2a
> set declarations
6e44e2a
> set data statements
6e44e2a
> parameter declarations
6e44e2a
> parameter data statements}
6e44e2a
6e44e2a
Name:           python-%{pypi_name}
6e44e2a
Version:        0.1.4
6e44e2a
Release:        1%{?dist}
6e44e2a
Summary:        A Python package for AMPL/GMPL datafile parsing
6e44e2a
6e44e2a
License:        EPL-1.0
6e44e2a
URL:            https://github.com/willu47/amply
6e44e2a
Source0:        %{pypi_source}
6e44e2a
6e44e2a
BuildArch:      noarch
6e44e2a
6e44e2a
%description %_description
6e44e2a
6e44e2a
%package -n python3-%{pypi_name}
6e44e2a
Summary:        %{summary}
6e44e2a
BuildRequires:  python3-devel
6e44e2a
BuildRequires:  %{py3_dist setuptools}
6e44e2a
BuildRequires:  %{py3_dist wheel}
6e44e2a
BuildRequires:  %{py3_dist setuptools_scm}
6e44e2a
6e44e2a
%if %{with tests}
6e44e2a
BuildRequires:  %{py3_dist pytest}
6e44e2a
%endif
6e44e2a
6e44e2a
%py_provides python3-%{pypi_name}
6e44e2a
6e44e2a
%description -n python3-%{pypi_name} %_description
6e44e2a
6e44e2a
%prep
6e44e2a
%autosetup -n %{pypi_name}-%{version}
6e44e2a
6e44e2a
find . -type f -name "*.py" -exec sed -i '/^#![  ]*\/usr\/bin\/env.*$/ d' {} 2>/dev/null ';'
6e44e2a
6e44e2a
%build
6e44e2a
%py3_build
6e44e2a
6e44e2a
%install
6e44e2a
%py3_install
6e44e2a
6e44e2a
%check
6e44e2a
%if %{with tests}
6e44e2a
export PYTHONPATH=%{buildroot}%{python3_sitelib}
6e44e2a
pytest-%{python3_version}
6e44e2a
%endif
6e44e2a
6e44e2a
%files -n python3-%{pypi_name}
6e44e2a
%doc README.rst
6e44e2a
%license LICENSE
6e44e2a
%{python3_sitelib}/%{pypi_name}/
6e44e2a
%{python3_sitelib}/%{pypi_name}-%{version}-py%{python3_version}.egg-info/
6e44e2a
6e44e2a
%changelog
6e44e2a
* Tue Feb 16 2021 Aniket Pradhan <major AT fedoraproject DOT org> - 0.1.4-1
6e44e2a
- Initial build