| |
@@ -1,93 +1,68 @@
|
| |
%global modname datanommer.models
|
| |
+ %global pkgname datanommer-models
|
| |
+ %global pypi_version 1.0.3
|
| |
|
| |
- Name: python-datanommer-models
|
| |
- Version: 0.9.1
|
| |
- Release: 17%{?dist}
|
| |
- Summary: SQLAlchemy models for datanommer
|
| |
+ Name: python-%{pkgname}
|
| |
+ Version: %{pypi_version}
|
| |
+ Release: 1%{?dist}
|
| |
+ Summary: SQLAlchemy data model for datanommer
|
| |
|
| |
License: GPLv3+
|
| |
- URL: https://pypi.io/project/%{modname}
|
| |
- Source0: https://pypi.io/packages/source/d/%{modname}/%{modname}-%{version}.tar.gz
|
| |
+ URL: https://github.com/fedora-infra/datanommer
|
| |
+ Source0: %{pypi_source %{modname}}
|
| |
|
| |
BuildArch: noarch
|
| |
|
| |
- %global _description\
|
| |
+ %description
|
| |
SQLAlchemy models for datanommer.
|
| |
|
| |
- %description %_description
|
| |
-
|
| |
- %package -n datanommer-config
|
| |
- Summary: Config files for datanommer
|
| |
-
|
| |
- %description -n datanommer-config
|
| |
- Config files for datanommer.
|
| |
-
|
| |
- %package -n python3-datanommer-models
|
| |
+ %package -n python3-%{pkgname}
|
| |
Summary: %summary
|
| |
|
| |
- %{?python_provide:%python_provide python3-datanommer-models}
|
| |
+ %py_provides python3-%{pkgname}
|
| |
|
| |
+ BuildRequires: libpq-devel
|
| |
+ BuildRequires: postgresql-server
|
| |
+ BuildRequires: python-pytest-postgresql
|
| |
+ BuildRequires: python3-bodhi-messages
|
| |
BuildRequires: python3-devel
|
| |
+ BuildRequires: python3-pytest
|
| |
+ BuildRequires: python3-pytest-mock
|
| |
BuildRequires: python3-setuptools
|
| |
+ BuildRequires: timescaledb
|
| |
|
| |
- # Just for the tests
|
| |
- BuildRequires: python3-nose
|
| |
- BuildRequires: python3-fedmsg-meta-fedora-infrastructure
|
| |
- BuildRequires: python3-fedmsg-core
|
| |
- BuildRequires: python3-alembic
|
| |
- BuildRequires: python3-sqlalchemy >= 0.7
|
| |
-
|
| |
- Requires: datanommer-config
|
| |
- Requires: python3-fedmsg-core
|
| |
- Requires: python3-alembic
|
| |
- Requires: python3-sqlalchemy >= 0.7
|
| |
-
|
| |
- %description -n python3-datanommer-models %_description
|
| |
+ %description -n python3-%{pkgname}
|
| |
+ SQLAlchemy models for datanommer.
|
| |
|
| |
%prep
|
| |
- %setup -q -n %{modname}-%{version}
|
| |
-
|
| |
- # Disable the consumer by default.
|
| |
- # https://github.com/fedora-infra/datanommer/issues/55
|
| |
- sed -i 's/True/False/g' fedmsg.d/example-datanommer.py
|
| |
-
|
| |
- # Also (temporarily), use a less insecure db uri by default
|
| |
- # https://github.com/fedora-infra/datanommer/issues/55
|
| |
- sed -i 's/\/\/tmp\/datanommer.db//' fedmsg.d/example-datanommer.py
|
| |
+ %autosetup -n %{modname}-%{pypi_version}
|
| |
|
| |
# Remove upstream egg-info so that it gets rebuilt.
|
| |
rm -rf *.egg-info
|
| |
|
| |
+ %generate_buildrequires
|
| |
+ %pyproject_buildrequires
|
| |
+
|
| |
%build
|
| |
- %py3_build
|
| |
+ %pyproject_wheel
|
| |
|
| |
%install
|
| |
- %py3_install
|
| |
-
|
| |
- # For some reason, this namespace file doesn't get copied in rawhide.
|
| |
- %{__cp} datanommer/__init__.py* %{buildroot}%{python3_sitelib}/datanommer/.
|
| |
-
|
| |
- # fedmsg owns this directory, but we're going to add a file.
|
| |
- %{__mkdir_p} %{buildroot}%{_sysconfdir}/fedmsg.d/
|
| |
- %{__cp} fedmsg.d/example-datanommer.py %{buildroot}%{_sysconfdir}/fedmsg.d/datanommer.py
|
| |
+ %pyproject_install
|
| |
+ %pyproject_save_files datanommer
|
| |
|
| |
# DB upgrade/downgrade scripts
|
| |
- %{__mkdir_p} %{buildroot}%{_datadir}/%{modname}/
|
| |
- %{__cp} alembic.ini %{buildroot}%{_datadir}/%{modname}/alembic.ini
|
| |
- %{__cp} -r alembic/ %{buildroot}%{_datadir}/%{modname}/alembic/
|
| |
+ %{__mkdir_p} %{buildroot}%{_sysconfdir}/%{pkgname}
|
| |
|
| |
- %check
|
| |
- %{__python3} setup.py test
|
| |
+ install -m 644 alembic.ini %{buildroot}%{_sysconfdir}/%{pkgname}/alembic.ini
|
| |
|
| |
- %files -n datanommer-config
|
| |
- %doc README.rst LICENSE
|
| |
- %{_datadir}/%{modname}/
|
| |
- %config(noreplace) %{_sysconfdir}/fedmsg.d/datanommer.py*
|
| |
+ %check
|
| |
+ %pyproject_check_import
|
| |
+ %{pytest} -v
|
| |
|
| |
- %files -n python3-datanommer-models
|
| |
- %doc README.rst LICENSE
|
| |
- %{python3_sitelib}/datanommer/
|
| |
- %{python3_sitelib}/%{modname}-%{version}*
|
| |
+ %files -n python3-%{pkgname} -f %{pyproject_files}
|
| |
+ %doc README.rst
|
| |
+ %license LICENSE
|
| |
+ %config(noreplace) %{_sysconfdir}/%{pkgname}/alembic.ini
|
| |
|
| |
%changelog
|
| |
* Fri Jan 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.1-17
|
| |
Update to version 1.0.3