[Bug 2258034] Review Request: python-fortranformat - reading and writing fortran style from python

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



https://bugzilla.redhat.com/show_bug.cgi?id=2258034

Ben Beasley <code@xxxxxxxxxxxxxxxxxx> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |code@xxxxxxxxxxxxxxxxxx



--- Comment #8 from Ben Beasley <code@xxxxxxxxxxxxxxxxxx> ---
Based on the commit message “Version 2.0.0”, I think it’s safe to take

 
https://github.com/brendanarnold/py-fortranformat/commit/07e119639746ebe1cf3016b508625d67585a052e

as the commit corresponding to the 2.0.0 release on PyPI. I would suggest
adding a comment that the release isn’t tagged on GitHub and linking your issue
https://github.com/brendanarnold/py-fortranformat/issues/32, but at the same
time, I would go ahead and package it *as if* that commit were tagged, without
worrying about

 
https://docs.fedoraproject.org/en-US/packaging-guidelines/Versioning/#_snapshots

Then you could enable at least the “handwritten” tests, something like:

--- ./before/python-fortranformat.spec  2024-01-17 13:15:46.900368184 -0500
+++ ./rebuild/python-fortranformat.spec 2024-01-17 14:24:06.742339660 -0500
@@ -1,3 +1,13 @@
+# Run at least the handwritten tests?
+%bcond tests 1
+# Currently, these tests require nose, which is deprecated
+# (https://fedoraproject.org/wiki/Changes/DeprecateNose), so packages are not
+# permitted to add new dependencies on it.
+%bcond minimal_tests 0
+# Not only do these tests require nose, but the necessary files take a long
+# time (~30 minutes) to generate.
+%bcond full_tests 0
+
 Name:           python-fortranformat
 Version:        2.0.0
 Release:        %{autorelease}
@@ -5,12 +15,27 @@

 License:        MIT
 URL:            https://github.com/brendanarnold/py-fortranformat
-Source:         %pypi_source fortranformat
+# The PyPI sdist lacks tests, CHANGELOG.md, etc. that are present in GitHub
+# source archives. There are no release tags
+# (https://github.com/brendanarnold/py-fortranformat/issues/32), so we must
+# reference a particular commit; however, since we are confident that this
+# commit corresponds to the PyPI release, we do not add a snapshot information
+# field to the Version as prescribed in
+#
https://docs.fedoraproject.org/en-US/packaging-guidelines/Versioning/#_snapshots.
+%global release_commit 07e119639746ebe1cf3016b508625d67585a052e
+Source:        
%{url}/archive/%{release_commit}/py-fortranformat-%{release_commit}.tar.gz

 BuildArch:      noarch
 BuildRequires:  python3-devel
+%if %{with tests}
 BuildRequires:  python3-pytest
+%if %{with minimal_tests} || %{with full_tests}
 BuildRequires:  make
+%endif
+%if %{with full_tests}
+BuildRequires:  gcc-gfortran
+%endif
+%endif

 %global _description %{expand:
 Generates text from a Python list of variables or will read a line of text
@@ -26,7 +51,8 @@


 %prep
-%autosetup -p1 -n fortranformat-%{version}
+%autosetup -p1 -n py-fortranformat-%{release_commit}
+sed -r -i 's@\bpython\b@%{python3}@' Makefile


 %generate_buildrequires
@@ -35,6 +61,15 @@

 %build
 %pyproject_wheel
+%if %{with tests}
+%if %{with minimal_tests}
+%make_build buildtests
+%endif
+%if %{with full_tests}
+# This takes a long time!
+%make_build compilertests
+%endif
+%endif


 %install
@@ -43,14 +78,19 @@


 %check
-## Bits not included in release
-## https://github.com/brendanarnold/py-fortranformat/issues/32
-## Can be run either with:
-#make buildtests
-#make runtests
-## or pytest macro should also work
-#%%pytest
 %pyproject_check_import fortranformat
+%if %{with tests}
+%if %{without full_tests} && %{without minimal_tests}
+# At least run the hand-written tests:
+%pytest tests/handwritten
+%endif
+%if %{with minimal_tests}
+%py3_test_envvars %make_build runminimaltests
+%endif
+%if %{with full_tests}
+%py3_test_envvars %make_build runtests
+%endif
+%endif


 %files -n python3-fortranformat -f %{pyproject_files}


The above also demonstrates how you could run the minimal tests and/or the full
tests, but you will need to remove the dependency on python3-nose first (or
persuade upstream to do so). If I add a BR on python3-nose after the BR on make
(which of course isn’t permitted) then the minimal tests *do* pass in the
example above. The full tests might pass too, but I haven’t yet waited long
enough for the --with full_tests build to finish.

Of course, if you switch to the GitHub archive, you’ll need to audit its
contents to make sure none of the new files have licensing issues.

What do you think?

Beyond that, I haven’t attempted a review, but I did notice:

- If you switch to the GitHub archive, you should add %doc CHANGELOG.md to
%files
- In either case, since are relying on %pyproject_save_files to handle the
LICENSE file, you should pass the new -l option to %pyproject_save_files


-- 
You are receiving this mail because:
You are on the CC list for the bug.
You are always notified about changes to this product and component
https://bugzilla.redhat.com/show_bug.cgi?id=2258034

Report this comment as SPAM: https://bugzilla.redhat.com/enter_bug.cgi?product=Bugzilla&format=report-spam&short_desc=Report%20of%20Bug%202258034%23c8
--
_______________________________________________
package-review mailing list -- package-review@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to package-review-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/package-review@xxxxxxxxxxxxxxxxxxxxxxx
Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue




[Index of Archives]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite Conditions]     [KDE Users]

  Powered by Linux