Re: Macro to smoke-test-import a Python module in %check

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

 



On 28. 06. 21 22:25, Dan Čermák wrote:
Hi Miro,

Miro Hrončok <mhroncok@xxxxxxxxxx> writes:

Hello Python RPM packagers,

based on some discussion in the "F35 Change: Python Packaging Guidelines
overhaul (System-Wide Change proposal)" thread [0], I've drafted a macro that
can help to test-import a Python module in %check when no other tests exist or
are when they cannot be executed during build [1].

The semantics is quite simple:


      %check
      %py3_check_import mymodule mymodule.submodule

...

This looks pretty good imho. Would it somehow be possible for the macro
to automatically try to import the module name from the generated
python3.Ydist() provides? That would make the macro even more convenient
to use and reduce any potential user error further.

Honestly, I'd rather not do that. People already confuse "module names" (that's what you import) with "Python package names" (that's what you install from PyPI or what's provided as python3.Ydist()). And while this would make the macro slightly easier to use for the optimal case when those names are identical, it would only create more confusion when they are not.

In the future, we could extend it to automatically import modules found in the %buidlroot, but now I'd rather provide a simple tool where the packager needs to be explicit, than a very complex tool that does heuristics.

--
Miro Hrončok
--
Phone: +420777974800
IRC: mhroncok
_______________________________________________
packaging mailing list -- packaging@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to packaging-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/packaging@xxxxxxxxxxxxxxxxxxxxxxx
Do not reply to spam on the list, report it: https://pagure.io/fedora-infrastructure




[Index of Archives]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite Forum]     [KDE Users]

  Powered by Linux