Compare commits
No commits in common. "c9" and "c8s" have entirely different histories.
5
.gitignore
vendored
5
.gitignore
vendored
@ -1 +1,4 @@
|
|||||||
SOURCES/netifaces-0.10.6.tar.gz
|
/netifaces-0.5.tar.gz
|
||||||
|
/netifaces-0.10.4.tar.gz
|
||||||
|
/netifaces-0.10.5.tar.gz
|
||||||
|
/netifaces-0.10.6.tar.gz
|
||||||
|
@ -1 +0,0 @@
|
|||||||
e318ebb83b9eba92e168cba2d9d7251b21bceb85 SOURCES/netifaces-0.10.6.tar.gz
|
|
6
gating.yaml
Normal file
6
gating.yaml
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
--- !Policy
|
||||||
|
product_versions:
|
||||||
|
- rhel-8
|
||||||
|
decision_context: osci_compose_gate
|
||||||
|
rules:
|
||||||
|
- !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional}
|
@ -1,20 +1,39 @@
|
|||||||
%global pypi_name netifaces
|
%global pypi_name netifaces
|
||||||
|
|
||||||
|
%if 0%{?rhel} > 7
|
||||||
|
# Disable python2 build by default
|
||||||
|
%bcond_with python2
|
||||||
|
%else
|
||||||
|
%bcond_without python2
|
||||||
|
%endif
|
||||||
|
|
||||||
Name: python-netifaces
|
Name: python-netifaces
|
||||||
Version: 0.10.6
|
Version: 0.10.6
|
||||||
Release: 15%{?dist}
|
Release: 4%{?dist}
|
||||||
Summary: Python library to retrieve information about network interfaces
|
Summary: Python library to retrieve information about network interfaces
|
||||||
License: MIT
|
License: MIT
|
||||||
URL: https://pypi.python.org/pypi/netifaces
|
URL: https://pypi.python.org/pypi/netifaces
|
||||||
Source0: https://files.pythonhosted.org/packages/source/n/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
|
Source0: https://files.pythonhosted.org/packages/source/n/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
|
||||||
|
|
||||||
BuildRequires: gcc
|
%if %{with python2}
|
||||||
|
BuildRequires: python2-devel
|
||||||
|
BuildRequires: python2-setuptools
|
||||||
|
%endif # with python2
|
||||||
|
|
||||||
%description
|
%description
|
||||||
This package provides a cross platform API for getting address information
|
This package provides a cross platform API for getting address information
|
||||||
from network interfaces.
|
from network interfaces.
|
||||||
|
|
||||||
|
%if %{with python2}
|
||||||
|
%package -n python2-%{pypi_name}
|
||||||
|
Summary: Python 2 library to retrieve information about network interfaces
|
||||||
|
%{?python_provide:%python_provide python2-%{pypi_name}}
|
||||||
|
|
||||||
|
%description -n python2-%{pypi_name}
|
||||||
|
This package provides a cross platform API for getting address information
|
||||||
|
from network interfaces.
|
||||||
|
%endif # with python2
|
||||||
|
|
||||||
%package -n python%{python3_pkgversion}-%{pypi_name}
|
%package -n python%{python3_pkgversion}-%{pypi_name}
|
||||||
Summary: Python %{python3_pkgversion} library to retrieve information about network interfaces
|
Summary: Python %{python3_pkgversion} library to retrieve information about network interfaces
|
||||||
BuildRequires: python%{python3_pkgversion}-devel
|
BuildRequires: python%{python3_pkgversion}-devel
|
||||||
@ -31,12 +50,24 @@ from network interfaces.
|
|||||||
|
|
||||||
|
|
||||||
%build
|
%build
|
||||||
|
%if %{with python2}
|
||||||
|
%py2_build
|
||||||
|
%endif # with python2
|
||||||
%py3_build
|
%py3_build
|
||||||
|
|
||||||
|
|
||||||
%install
|
%install
|
||||||
|
%if %{with python2}
|
||||||
|
%py2_install
|
||||||
|
%endif # with python2
|
||||||
%py3_install
|
%py3_install
|
||||||
|
|
||||||
|
%if %{with python2}
|
||||||
|
%files -n python2-%{pypi_name}
|
||||||
|
%doc README.rst
|
||||||
|
%{python2_sitearch}/%{pypi_name}-%{version}-*.egg-info/
|
||||||
|
%{python2_sitearch}/%{pypi_name}.so
|
||||||
|
%endif # with python2
|
||||||
|
|
||||||
%files -n python%{python3_pkgversion}-%{pypi_name}
|
%files -n python%{python3_pkgversion}-%{pypi_name}
|
||||||
%doc README.rst
|
%doc README.rst
|
||||||
@ -44,43 +75,8 @@ from network interfaces.
|
|||||||
%{python3_sitearch}/%{pypi_name}*.so
|
%{python3_sitearch}/%{pypi_name}*.so
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
* Tue Aug 10 2021 Mohan Boddu <mboddu@redhat.com> - 0.10.6-15
|
* Tue Jun 19 2018 Charalampos Stratakis <cstratak@redhat.com> - 0.10.6-4
|
||||||
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
|
- Conditionalize the python2 subpackage
|
||||||
Related: rhbz#1991688
|
|
||||||
|
|
||||||
* Fri Apr 16 2021 Mohan Boddu <mboddu@redhat.com> - 0.10.6-14
|
|
||||||
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
|
|
||||||
|
|
||||||
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.10.6-13
|
|
||||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
|
|
||||||
|
|
||||||
* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.10.6-12
|
|
||||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
|
|
||||||
|
|
||||||
* Tue May 26 2020 Miro Hrončok <mhroncok@redhat.com> - 0.10.6-11
|
|
||||||
- Rebuilt for Python 3.9
|
|
||||||
|
|
||||||
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.10.6-10
|
|
||||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
|
|
||||||
|
|
||||||
* Thu Oct 31 2019 Miro Hrončok <mhroncok@redhat.com> - 0.10.6-9
|
|
||||||
- Subpackage python2-netifaces has been removed
|
|
||||||
See https://fedoraproject.org/wiki/Changes/Mass_Python_2_Package_Removal
|
|
||||||
|
|
||||||
* Mon Aug 19 2019 Miro Hrončok <mhroncok@redhat.com> - 0.10.6-8
|
|
||||||
- Rebuilt for Python 3.8
|
|
||||||
|
|
||||||
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.10.6-7
|
|
||||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
|
|
||||||
|
|
||||||
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.10.6-6
|
|
||||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
|
|
||||||
|
|
||||||
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.10.6-5
|
|
||||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
|
|
||||||
|
|
||||||
* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 0.10.6-4
|
|
||||||
- Rebuilt for Python 3.7
|
|
||||||
|
|
||||||
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.10.6-3
|
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.10.6-3
|
||||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
|
1
sources
Normal file
1
sources
Normal file
@ -0,0 +1 @@
|
|||||||
|
SHA512 (netifaces-0.10.6.tar.gz) = 2c892062286007a8330c2cddc148ea21d1fd24aec32b5f25b8fe905933c651f8c532596f523f0bb7edb3a143e9a491ec49d60f75efad4407273ac2647b579b1e
|
30
tests/test_netifaces.py
Normal file
30
tests/test_netifaces.py
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
import netifaces
|
||||||
|
import pytest
|
||||||
|
|
||||||
|
|
||||||
|
def test_interfaces():
|
||||||
|
ifaces = netifaces.interfaces()
|
||||||
|
assert isinstance(ifaces, list)
|
||||||
|
assert "lo" in ifaces
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.parametrize(
|
||||||
|
"iface,af,expected",
|
||||||
|
[
|
||||||
|
("lo", netifaces.AF_INET, "127.0.0.1"),
|
||||||
|
("lo", netifaces.AF_INET6, "::1"),
|
||||||
|
],
|
||||||
|
)
|
||||||
|
def test_ifaddresses_lo(iface, af, expected):
|
||||||
|
addrs = netifaces.ifaddresses(iface)
|
||||||
|
assert addrs[af][0]["addr"] == expected
|
||||||
|
|
||||||
|
|
||||||
|
def test_invalid():
|
||||||
|
with pytest.raises(ValueError):
|
||||||
|
netifaces.ifaddresses("invalid interface")
|
||||||
|
|
||||||
|
|
||||||
|
def test_gateways():
|
||||||
|
gw = netifaces.gateways()
|
||||||
|
assert "default" in gw
|
13
tests/tests.yml
Normal file
13
tests/tests.yml
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
---
|
||||||
|
- hosts: localhost
|
||||||
|
tags:
|
||||||
|
- classic
|
||||||
|
roles:
|
||||||
|
- role: standard-test-basic
|
||||||
|
required_packages:
|
||||||
|
- python3-netifaces
|
||||||
|
- python3-pytest
|
||||||
|
tests:
|
||||||
|
- unittests:
|
||||||
|
dir: "."
|
||||||
|
run: pytest-3 test_netifaces.py
|
Loading…
Reference in New Issue
Block a user