Bug 2074313 - python3-netaddr
Summary: python3-netaddr
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: python-netaddr
Version: 35
Hardware: Unspecified
OS: Unspecified
unspecified
low
Target Milestone: ---
Assignee: John Eckersberg
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-04-11 23:38 UTC by Ladar Levison
Modified: 2022-05-22 01:23 UTC (History)
5 users (show)

Fixed In Version: python-netaddr-0.8.0-7.fc37 python-netaddr-0.8.0-8.fc36 python-netaddr-0.8.0-8.fc35
Clone Of:
Environment:
Last Closed: 2022-04-12 16:13:27 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker FREEIPA-8150 0 None None None 2022-04-12 01:46:30 UTC

Description Ladar Levison 2022-04-11 23:38:56 UTC
On Fedora 35, the python3-netaddr.noarch package appears to require IPython:

```
# dnf install -y python3-netaddr
Last metadata expiration check: 0:01:04 ago on Mon 11 Apr 2022 11:32:56 PM UTC.
Dependencies resolved.
================================================================================
 Package                Architecture  Version               Repository     Size
================================================================================
Installing:
 python3-netaddr        noarch        0.8.0-5.fc35          fedora        1.5 M

Transaction Summary
================================================================================
Install  1 Package

Total download size: 1.5 M
Installed size: 9.4 M
Downloading Packages:
python3-netaddr-0.8.0-5.fc35.noarch.rpm         1.4 MB/s | 1.5 MB     00:01    
--------------------------------------------------------------------------------
Total                                           1.2 MB/s | 1.5 MB     00:01     
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                        1/1 
  Installing       : python3-netaddr-0.8.0-5.fc35.noarch                    1/1 
  Running scriptlet: python3-netaddr-0.8.0-5.fc35.noarch                    1/1 
  Verifying        : python3-netaddr-0.8.0-5.fc35.noarch                    1/1 

Installed:
  python3-netaddr-0.8.0-5.fc35.noarch                                           

Complete!
# netaddr 
IPython (http://ipython.scipy.org/) not found!
```

Looks to be an easy fix, installing python3-ipython.noarch makes it work, which means adding python3-ipython.noarch to the RPM SPEC should be all that's required.


```
# dnf install --quiet -y python3-ipython

Installed:
  python3-backcall-0.1.0-14.fc35.noarch                                         
  python3-ipython-7.26.0-3.fc35.noarch                                          
  python3-ipython_genutils-0.1.0-26.fc35.noarch                                 
  python3-jedi-0.18.0-6.fc35.noarch                                             
  python3-matplotlib-inline-0.1.2-3.fc35.noarch                                 
  python3-parso-0.8.2^1.da3a748-1.fc35.noarch                                   
  python3-pexpect-4.8.0-9.fc35.noarch                                           
  python3-pickleshare-0.7.5-7.fc35.noarch                                       
  python3-prompt-toolkit-3.0.24-1.fc35.noarch                                   
  python3-ptyprocess-0.6.0-14.fc35.noarch                                       
  python3-pygments-2.9.0-2.fc35.noarch                                          
  python3-traitlets-5.0.5-5.fc35.noarch                                         
  python3-wcwidth-0.2.5-6.fc35.noarch                                           

# netaddr 

netaddr shell 0.8.0 - an interactive shell for the netaddr library

In [1]: ip = IPAddress('192.0.2.1')

In [2]: hex(ip)
Out[2]: '0xc0000201'

In [3]: ip.bin
Out[3]: '0b11000000000000000000001000000001'

In [4]: ip.bits()
Out[4]: '11000000.00000000.00000010.00000001'

In [5]: str(ip)
Out[5]: '192.0.2.1'

In [6]: quit

Share and enjoy!
```

Comment 1 Orion Poplawski 2022-04-12 01:38:52 UTC
Fixing component.  python3-netaddr is for EPEL only.

Comment 2 John Eckersberg 2022-04-12 14:42:34 UTC
Thanks for filing this!

This is probably a good use case for a weak dependency[1].  I think the vast majority of netaddr use is via the library, and not the netaddr shell (the fact that it took this long for someone to notice and file a bug supports that).  To minimize the install footprint it would be better to make ipython optional still.  There's no reason to force things like container images to pull in ipython unnecessarily.  A cursory glance on a bare f35 container shows adding ipython adds an extra 27Mb to the installed size.

If that sounds reasonable to you, can you update the pull request to change "Requires:" to "Recommends:" ?

[1] https://fedoraproject.org/wiki/Packaging:WeakDependencies#Weak_dependencies

Comment 3 Ladar Levison 2022-04-12 15:14:21 UTC
Updated the PR, and switched Requires to Recommends. 

I was looking for a CLI tool, so it caught me off-guard when I installed the package, and the CLI command it provided didn't run. But you're  right, the netaddr command isn't really intended as a typical CLI command, and IPython, is bit heavy/large to install for everyone, given that most users only need the library, and not the netaddr. If the package was larger, and/or more popular, splitting the library and netaddr command into separate packages might make sense. But with the niche use case, I think your right, to go with a weak dependency. As it happened, when I hit that error, I checked the SPEC file to see what other dependencies might be required/suggested, and see if it showed what the specific package was that I'd need to install. 

Weak dependencies are one of the few things I think APT does better than YUM/DNF. It shows the user suggested additions when they install a package, which is a good way of letting the user know they might need X package to use all of the functionality provided by what's being installed.

With YUM/DNF it's cumbersome to get this same data using DNF (dnf depends --reccomends PKG), and most RPMs haven't been updated to provide this info. Hopefully that will change in the future. I've been waiting for someone to add reccomended packages to the description that gets returned by the "info" command. And/or show this info during installs, but it hasn't happened.

Comment 4 Fedora Update System 2022-04-12 16:11:14 UTC
FEDORA-2022-14daa98dad has been submitted as an update to Fedora 37. https://bodhi.fedoraproject.org/updates/FEDORA-2022-14daa98dad

Comment 5 Fedora Update System 2022-04-12 16:13:27 UTC
FEDORA-2022-14daa98dad has been pushed to the Fedora 37 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 6 John Eckersberg 2022-04-12 16:15:20 UTC
Seems to work as expected:

[root@ffc7ae8507f0 /]# dnf install https://kojipkgs.fedoraproject.org//packages/python-netaddr/0.8.0/7.fc37/noarch/python3-netaddr-0.8.0-7.fc37.noarch.rpm
Last metadata expiration check: 0:38:11 ago on Tue Apr 12 15:35:38 2022.
python3-netaddr-0.8.0-7.fc37.noarch.rpm                                                         3.2 MB/s | 1.5 MB     00:00
Dependencies resolved.
================================================================================================================================
 Package                                  Architecture          Version                       Repository                   Size
================================================================================================================================
Installing:
 python3-netaddr                          noarch                0.8.0-7.fc37                  @commandline                1.5 M
Installing dependencies:
 python3-asttokens                        noarch                2.0.5-3.fc36                  rawhide                      37 k
 python3-backcall                         noarch                0.1.0-15.fc36                 rawhide                      26 k
 python3-decorator                        noarch                5.1.1-2.fc36                  rawhide                      27 k
 python3-executing                        noarch                0.8.2-2.fc36                  rawhide                      34 k
 python3-jedi                             noarch                0.18.1-2.fc36                 rawhide                     1.1 M
 python3-matplotlib-inline                noarch                0.1.2-4.fc36                  rawhide                      20 k
 python3-parso                            noarch                0.8.3-1.fc37                  rawhide                     152 k
 python3-pexpect                          noarch                4.8.0-11.fc37                 rawhide                     136 k
 python3-pickleshare                      noarch                0.7.5-8.fc36                  rawhide                      18 k
 python3-prompt-toolkit                   noarch                3.0.29-1.fc37                 rawhide                     633 k
 python3-ptyprocess                       noarch                0.6.0-15.fc36                 rawhide                      29 k
 python3-pure-eval                        noarch                0.2.2-1.fc36                  rawhide                      28 k
 python3-pygments                         noarch                2.11.2-1.fc37                 rawhide                     2.0 M
 python3-setuptools                       noarch                60.9.3-1.fc37                 rawhide                     1.0 M
 python3-six                              noarch                1.16.0-5.fc36                 rawhide                      36 k
 python3-stack-data                       noarch                0.2.0-1.fc37                  rawhide                      41 k
 python3-traitlets                        noarch                5.1.1-3.fc36                  rawhide                     210 k
 python3-wcwidth                          noarch                0.2.5-7.fc36                  rawhide                      41 k
Installing weak dependencies:
 python3-ipython                          noarch                8.2.0-1.fc37                  rawhide                     768 k

Transaction Summary
================================================================================================================================
Install  20 Packages

Total size: 7.9 M
Total download size: 6.4 M
Installed size: 39 M
Is this ok [y/N]: n
Operation aborted.
[root@ffc7ae8507f0 /]# dnf install --exclude python3-ipython https://kojipkgs.fedoraproject.org//packages/python-netaddr/0.8.0/7.fc37/noarch/python3-netaddr-0.8.0-7.fc37.noarch.rpm
Last metadata expiration check: 0:38:17 ago on Tue Apr 12 15:35:38 2022.
python3-netaddr-0.8.0-7.fc37.noarch.rpm                                                         5.6 MB/s | 1.5 MB     00:00
Dependencies resolved.
================================================================================================================================
 Package                           Architecture             Version                        Repository                      Size
================================================================================================================================
Installing:
 python3-netaddr                   noarch                   0.8.0-7.fc37                   @commandline                   1.5 M

Transaction Summary
================================================================================================================================
Install  1 Package

Total size: 1.5 M
Installed size: 9.4 M
Is this ok [y/N]: n
Operation aborted.
[root@ffc7ae8507f0 /]#

Comment 7 Fedora Update System 2022-04-12 16:25:23 UTC
FEDORA-2022-5b714bee7f has been submitted as an update to Fedora 36. https://bodhi.fedoraproject.org/updates/FEDORA-2022-5b714bee7f

Comment 8 Fedora Update System 2022-04-12 16:33:29 UTC
FEDORA-2022-55a0b797ad has been submitted as an update to Fedora 35. https://bodhi.fedoraproject.org/updates/FEDORA-2022-55a0b797ad

Comment 9 Fedora Update System 2022-04-13 15:19:08 UTC
FEDORA-2022-55a0b797ad has been pushed to the Fedora 35 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2022-55a0b797ad`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2022-55a0b797ad

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 10 Fedora Update System 2022-04-13 19:48:25 UTC
FEDORA-2022-5b714bee7f has been pushed to the Fedora 36 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2022-5b714bee7f`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2022-5b714bee7f

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 11 Fedora Update System 2022-05-13 18:26:50 UTC
FEDORA-2022-522546aa59 has been submitted as an update to Fedora 36. https://bodhi.fedoraproject.org/updates/FEDORA-2022-522546aa59

Comment 12 Fedora Update System 2022-05-13 18:36:36 UTC
FEDORA-2022-b8856debaa has been submitted as an update to Fedora 35. https://bodhi.fedoraproject.org/updates/FEDORA-2022-b8856debaa

Comment 13 Fedora Update System 2022-05-14 02:15:23 UTC
FEDORA-2022-522546aa59 has been pushed to the Fedora 36 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2022-522546aa59`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2022-522546aa59

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 14 Fedora Update System 2022-05-14 02:24:32 UTC
FEDORA-2022-b8856debaa has been pushed to the Fedora 35 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2022-b8856debaa`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2022-b8856debaa

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 15 Fedora Update System 2022-05-22 01:17:58 UTC
FEDORA-2022-522546aa59 has been pushed to the Fedora 36 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 16 Fedora Update System 2022-05-22 01:23:36 UTC
FEDORA-2022-b8856debaa has been pushed to the Fedora 35 stable repository.
If problem still persists, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.