Hi,
I'm working towards updating python-dns-lexicon. It can handle many different dns APIs and for some APIs the code needs additional libraries (some of these are not packaged for Fedora).
Upstream handles this by using "extras" requirements and the CLI throws an error message if you try to use a provider which needs additional dependencies.
lexicon.client.ProviderNotAvailableError: This provider (transip) has required dependencies that are missing. Please install lexicon[transip] first.
Ideally I'd like to move the provider's Python file (just a single file) AND the generated .pyc to a RPM subpackage where I could add the required dependencies (if possible). All provider files are located in the same directory.
Is that possible with Fedora's RPM macros? Felix
On 29. 06. 20 22:47, Felix Schwarz wrote:
Hi,
I'm working towards updating python-dns-lexicon. It can handle many different dns APIs and for some APIs the code needs additional libraries (some of these are not packaged for Fedora).
Upstream handles this by using "extras" requirements and the CLI throws an error message if you try to use a provider which needs additional dependencies.
lexicon.client.ProviderNotAvailableError: This provider (transip) has required dependencies that are missing. Please install lexicon[transip] first.
Ideally I'd like to move the provider's Python file (just a single file) AND the generated .pyc to a RPM subpackage where I could add the required dependencies (if possible). All provider files are located in the same directory.
Is that possible with Fedora's RPM macros?
Yes:
%files -n python3-dns-lexicon %{python3_stielib}/lexicon/dns_lexicon-%{version}-py%{python3_version}.egg-info/ %{python3_stielib}/lexicon/ %pycached %exclude %{python3_stielib}/lexicon/lexicon/providers/transip.py
%files -n python3-dns-lexicon+transip %pycached %{python3_stielib}/lexicon/lexicon/providers/transip.py
BTW make sure to use "%pycached %exclude" in this order and not the other way around: https://pagure.io/packaging-committee/pull-request/986
On 29. 06. 20 23:12, Miro Hrončok wrote:
%files -n python3-dns-lexicon %{python3_stielib}/lexicon/dns_lexicon-%{version}-py%{python3_version}.egg-info/ %{python3_stielib}/lexicon/ %pycached %exclude %{python3_stielib}/lexicon/lexicon/providers/transip.py
%files -n python3-dns-lexicon+transip %pycached %{python3_stielib}/lexicon/lexicon/providers/transip.py
With https://fedoraproject.org/wiki/Changes/PythonExtras you would also add:
%ghost %{python3_stielib}/lexicon/dns_lexicon-%{version}-py%{python3_version}.egg-info
to the +transip subpackage.
However, that might confuse the current dependency generator to provide python3dist(dns-lexicon) from it. If it does, you can guard it via:
%{?python_extras_subpkg:%ghost ...}
python-devel@lists.fedoraproject.org