15
0
forked from pool/python-getmac

- update to 0.9.5:

* Fixed macOS arp when MAC has one character sections in
    specific cases (Fixes issue #92)
- Update to 0.9.4:
  * `arping` (POSIX) or `SendARP` (Windows) will now *always* be used instead
  * Added ability to override the detected platform via `--override-platform`
  Issue deprecation message as a warning in addition to a log message

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-getmac?expand=0&rev=18
This commit is contained in:
2024-10-29 21:44:41 +00:00
committed by Git OBS Bridge
commit f5f2129ccd
7 changed files with 218 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

1
.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
.osc

13
cope-with-no-ip6.patch Normal file
View File

@@ -0,0 +1,13 @@
Index: getmac-0.9.4/tests/test_getmac.py
===================================================================
--- getmac-0.9.4.orig/tests/test_getmac.py
+++ getmac-0.9.4/tests/test_getmac.py
@@ -144,7 +144,7 @@ def test_initialize_method_cache_valid_t
assert getmac.initialize_method_cache(method_type)
assert getmac.METHOD_CACHE[method_type] is not None
if method_type in ["ip4", "ip6"]:
- assert getmac.FALLBACK_CACHE[method_type]
+ assert method_type in getmac.FALLBACK_CACHE
def test_initialize_method_cache_initialized(mocker):

3
getmac-0.9.4.tar.gz Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:8477755b69ff93a3b514b54e1fbb8ebb57d8f4e5c37e7c18bcef3a0f1f149232
size 94019

3
getmac-0.9.5.tar.gz Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:456435cdbf1f5f45c433a250b8b795146e893b6fc659060f15451e812a2ab17d
size 94031

98
python-getmac.changes Normal file
View File

@@ -0,0 +1,98 @@
-------------------------------------------------------------------
Tue Oct 29 21:44:24 UTC 2024 - Dirk Müller <dmueller@suse.com>
- update to 0.9.5:
* Fixed macOS arp when MAC has one character sections in
specific cases (Fixes issue #92)
-------------------------------------------------------------------
Fri Mar 8 00:58:45 UTC 2024 - Steve Kowalik <steven.kowalik@suse.com>
- Update to 0.9.4:
* Support BusyBox's ``arping``
* Improve how ARP is handled. If ``ArpFile`` method succeeds, use it
instead of ``ArpingHost``
* Speed up the first call to ``ArpingHost``
* Fix FORCE_METHOD not being respected for IPv4 macs
* Fix `ArpFile` method being used for IPv6
* Deprecate Python 3.6 support
* This release is a *complete rewrite of getmac from the ground up*. The
public API of `getmac` is **unchanged** as part of this rewrite.
* Fully support Python 3.9
* Tentatively support Python 3.10 and 3.11
* `arping` (POSIX) or `SendARP` (Windows) will now *always* be used instead
of sending a UDP packet when looking for the MAC of a IPv4 host, if
they're available and operable (otherwise, UDP + ARP table check will be
used like before).
* Added ability to override the detected platform via `--override-platform`
argument (CLI) or `getmac.getmac.OVERRIDE_PLATFORM` variable (Python).
This will force methods for that platform to be used, regardless of the
actual platform.
* Overhauled `ifconfig` parsing. It should now be far more reliable and
accurate across all platforms.
* Fixed bug with `/proc/net/route` parsing
* Removed man pages from distribution (`getmac.1`/`getmac2.1`). They were
severely out of date and unused.
- Drop patches fix-failing-darwin-test.patch and support-python3.9.patch
- Add patch cope-with-no-ip6.patch
-------------------------------------------------------------------
Wed Sep 28 21:01:13 UTC 2022 - Yogalakshmi Arunachalam <yarunachalam@suse.com>
- 0.8.3 (12/10/2021)
Announcement: Compatibility with Python versions older than 3.6 (2.7, 3.4, and 3.5) is deprecated and will be removed in getmac 1.0.0.
If you are stuck on an unsupported Python, considor loosely pinning the version of this package in your dependency list, e.g. getmac<1.
Changed
Added support for Thomas Habets' version of arping in addition to the existing iputils one (contributed by Ville Skyttä (@scop) in #52 and #54)
Added support for docker in network bridge mode (contributed by Tomasz Duda (@tomaszduda23) in #57)
Add CHANGELOG URL to PyPI metadata (contributed by Ville Skyttä (@scop) in #58)
Fixed code quality test suite errors (includes changes by Daniel Flanagan (@FlantasticDan) in #67)
Improved Android support (contributed by @emadmahdi in #71)
Minor code quality fixes (2 years of neglecting master branch)
Add Code of Conduct for project contributors
Add SECURITY.md for reporting security issues (e.g. vulnerabilities)
Deprecate Python 3.4 and 3.5
Issue deprecation message as a warning in addition to a log message
-------------------------------------------------------------------
Fri Apr 16 17:16:11 UTC 2021 - Antonio Larrosa <alarrosa@suse.com>
- Add patch to fix build by skipping a test that doesn't work as
expected:
* fix-failing-darwin-test.patch
- Add patch to fix build with python 3.9:
* support-python3.9.patch
-------------------------------------------------------------------
Tue May 26 06:34:22 UTC 2020 - Petr Gajdos <pgajdos@suse.com>
- %python3_only -> %python_alternative
-------------------------------------------------------------------
Thu Apr 16 13:23:39 UTC 2020 - Tomáš Chvátal <tchvatal@suse.com>
- Skip test_cli_main as it fails for some reason on OBS
-------------------------------------------------------------------
Thu Apr 16 13:18:15 UTC 2020 - Tomáš Chvátal <tchvatal@suse.com>
- Fix all files having executable bit
-------------------------------------------------------------------
Mon Apr 6 14:41:53 UTC 2020 - Marketa Calabkova <mcalabkova@suse.com>
- update to 0.8.2
* Added warning about Python 2 compatibility being dropped in 1.0.0
* Officially support Python 3.8
* Documented a known issue with looking up IP of a local interface on Linux/WSL (See the "Known Issues" section in the README)
* Added remote host lookup using `arping` as last resort
-------------------------------------------------------------------
Tue Sep 10 07:13:43 UTC 2019 - Jan Engelhardt <jengelh@inai.de>
- Use noun phrase/full sentences for summary/description.
-------------------------------------------------------------------
Wed Sep 4 09:47:36 UTC 2019 - Antonio Larrosa <alarrosa@suse.com>
- Initial release of python-getmac 0.8.1

77
python-getmac.spec Normal file
View File

@@ -0,0 +1,77 @@
#
# spec file for package python-getmac
#
# Copyright (c) 2024 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
Name: python-getmac
Version: 0.9.5
Release: 0
Summary: Module to get MAC addresses of remote hosts and local interfaces
License: MIT
URL: https://github.com/GhostofGoes/getmac
Source: https://files.pythonhosted.org/packages/source/g/getmac/getmac-%{version}.tar.gz
# PATCH-FIX-OPENSUSE
Patch0: cope-with-no-ip6.patch
BuildRequires: %{python_module pip}
BuildRequires: %{python_module pytest-benchmark}
BuildRequires: %{python_module pytest-mock}
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module wheel}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
Requires(post): update-alternatives
Requires(postun): update-alternatives
BuildArch: noarch
%python_subpackages
%description
A Python module to get MAC addresses of remote hosts and local interfaces.
%prep
%autosetup -p1 -n getmac-%{version}
sed -i "1,4{/\/usr\/bin\/env/d}" getmac/__main__.py
rm -r *egg-info
find . -type f -exec chmod -x {} \;
%build
%pyproject_wheel
%install
%pyproject_install
%python_clone -a %{buildroot}%{_bindir}/getmac
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%check
export LANG=C.UTF-8
# test_cli_main fails in OBS not local run
# test_cli_multiple_debug_levels same as above
%pytest tests -k 'not test_cli_main and not test_cli_multiple_debug_levels'
%post
%python_install_alternative getmac
%postun
%python_uninstall_alternative getmac
%files %{python_files}
%doc CHANGELOG.md README.md
%license LICENSE
%python_alternative %{_bindir}/getmac
%{python_sitelib}/getmac
%{python_sitelib}/getmac-%{version}.dist-info
%changelog