#3 Update to 1.0.3
Closed 2 years ago by lenkaseg. Opened 2 years ago by lenkaseg.
rpms/ lenkaseg/python-datanommer-models 1.0.3  into  rawhide

Update to 1.0.3
Lenka Segura • 2 years ago  
file modified
+1
@@ -17,3 +17,4 @@ 

  /datanommer.models-0.8.2.tar.gz

  /datanommer.models-0.9.0.tar.gz

  /datanommer.models-0.9.1.tar.gz

+ /datanommer.models-1.0.3.tar.gz

file modified
+36 -61
@@ -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

file modified
+1 -1
@@ -1,1 +1,1 @@ 

- SHA512 (datanommer.models-0.9.1.tar.gz) = 056f07d737cbe03c7ed738915aa94e13d1e7512c8d8480c407aff52831033ab482d64ad1d5ac04f15642cc5545fcfe0786564f36ef3ac403ac30cbf9c98434c5

+ SHA512 (datanommer.models-1.0.3.tar.gz) = a15fc04abc27b73c1649584524314ff4aa3682555b5e97a4033da382d199a6057d9bcfa31dcbfb857c0ad864b342cc4bb80e02d7ec76fe710f6a8f3f162cedf4

Update to version 1.0.3

Hmm, this seems wrong. We're not using namespaces as the old package used to do, no need to copy this file.

This contains the DB URL, it thus needs to be modified by the admin, it should be in /etc

Please have a look at the Python packaging guidelines, there may be helpful macros there that you could use.

Also, if we're moving from python-datanommer-models to python-datanommer.models, there should be a set of Obsoletes/Provides. But only rename the package if it brings it in line with the Package naming guidelines for Python. Otherwise it's not worth the trouble I think.

rebased onto 315d39f

2 years ago

Thanks a lot for the review!

Renaming the package was a mistake, not an intent. Explais why the fedpkg mockbuild was not working, only the mock. Now corrected.

%{pyproject_files} and %{pyproject_save_files} added. I was actually trying to use them in the first place, but something was not working, so I decided to add the files manually. But now everything seems to work well.

Added %{pyproject_check_import}
I removed the pytest run, because it required a postgresql server running. Is there a way how to solve this?

alembic.ini moved to _sysconfdir

Yeah the tests have a plugin that let them run postgresql just for the tests, but you'll need to add a BuildRequires on postgresql-server.

I'm not sure that it's the right way to solve it, because the name of the package in PyPI is indeed datanommer.models. Maybe change the Name tag instead?

Now that you use %{pyproject_files}, you can drop all the lines below.

Please use %license for the LICENSEfile instead of %doc

Yeah the tests have a plugin that let them run postgresql just for the tests, but you'll need to add a BuildRequires on postgresql-server.

I did, but I got an error that the server is not running. Didn't know how to solve that. Also I was not sure if running a postgresql server is something that should be done for a build.

rebased onto 2ede7f5

2 years ago

rebased onto 85ea8cf

2 years ago

rebased onto 172fd87

2 years ago

rebased onto a2625cd

2 years ago

Actually I think you can keep modname defined, you can use it below
Also, I think pkgname is more common that just pkname, let's use that instead.

Here you could use %{modname} as well

It's just nitpicking... sorry :-) Almost there!

On the contrary! I appreciate feedback even on small details, to have the spec perfect :)

rebased onto 55f6d28

2 years ago

rebased onto 7de2470

2 years ago

#4 to be continued as release 1.0.4 together with the alembic changes

Pull-Request has been closed by lenkaseg

2 years ago