nhoad / python-iwlib Goto Github PK
View Code? Open in Web Editor NEWiwlib library for Python, for interacting with wireless devices.
License: GNU General Public License v2.0
iwlib library for Python, for interacting with wireless devices.
License: GNU General Public License v2.0
Could you tag a new release?
I'd like to package 1.6.
Hi!
I'm currently trying to package 1.7.0 for the official repositories on Arch Linux.
Build seems to succeed, but when running the tests
local _py3_ver=$(python3 -c "import sys; print(str(sys.version_info.major)+'.'+str(sys.version_info.minor))")
export PYTHONPATH="build/lib.linux-$CARCH-${_py3_ver}/:${PWD}:${PYTHONPATH}"
py.test
I get:
============================= test session starts ==============================
platform linux -- Python 3.8.0, pytest-5.3.1, py-1.8.0, pluggy-0.13.1
rootdir: /build/python-iwlib/src/iwlib-1.7.0
collected 2 items
test/test_imports.py FF [100%]
=================================== FAILURES ===================================
____________________________ test_imports_dont_fail ____________________________
def test_imports_dont_fail():
'''Gross test for ensuring packaging hasn't been broken.'''
imports = [
"iwlib.iwconfig.get_iwconfig",
"iwlib.iwlist.scan",
"iwlib.utils.get_max_quality",
"iwlib.utils.set_essid",
"iwlib.utils.supports_scanning",
]
for imp in imports:
module, _from = imp.rsplit('.', 1)
print('from %s import %s' % (module, _from))
> __import__(module, fromlist=[_from])
test/test_imports.py:16:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
iwlib/__init__.py:2: in <module>
from .iwconfig import get_iwconfig
iwlib/iwconfig.py:18: in <module>
from .utils import _parse_stats, _get_bytes, iwlib_socket
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
import contextlib
import errno
import os
> from ._iwlib import ffi, lib as iwlib
@contextlib.contextmanager
E ModuleNotFoundError: No module named 'iwlib._iwlib'
iwlib/utils.py:19: ModuleNotFoundError
----------------------------- Captured stdout call -----------------------------
from iwlib.iwconfig import get_iwconfig
_________________________ test_backwards_compatibility _________________________
def test_backwards_compatibility():
'''Ensure backwards compatibility with the module before I came along.'''
> from iwlib import get_iwconfig
test/test_imports.py:21:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
iwlib/__init__.py:2: in <module>
from .iwconfig import get_iwconfig
iwlib/iwconfig.py:18: in <module>
from .utils import _parse_stats, _get_bytes, iwlib_socket
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
import contextlib
import errno
import os
> from ._iwlib import ffi, lib as iwlib
@contextlib.contextmanager
E ModuleNotFoundError: No module named 'iwlib._iwlib'
iwlib/utils.py:19: ModuleNotFoundError
============================== 2 failed in 0.06s ===============================
This might be a problem introduced with python3.8, but maybe you have an idea?
In file included from iwlib/utils.c:17:0:
iwlib/utils.h:2:19: fatal error: iwlib.h: No such file or directory
#include <iwlib.h>
^
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
Command "/usr/bin/python3 -u -c "import setuptools, tokenize;file='/tmp/pip-build-m7bch8bt/iwlib/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /tmp/pip-k1x14wgz-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-m7bch8bt/iwlib/
There is difference between releases on GitHUB and PyPi.
tar.gz file on pypi.org https://pypi.org/project/iwlib/#files contains following directory structure:
./iwlib-1.6.1
./iwlib-1.6.1/iwlib
./iwlib-1.6.1/iwlib/__pycache__
./iwlib-1.6.1/iwlib/__pycache__/_cffi__x41597a6exaad18ffc.c
./iwlib-1.6.1/iwlib/__init__.py
./iwlib-1.6.1/iwlib/_fakeiwlib_build.py
./iwlib-1.6.1/iwlib/_iwlib_build.py
./iwlib-1.6.1/iwlib/iwconfig.py
./iwlib-1.6.1/iwlib/iwlist.py
./iwlib-1.6.1/iwlib/utils.py
./iwlib-1.6.1/iwlib.egg-info
./iwlib-1.6.1/iwlib.egg-info/PKG-INFO
./iwlib-1.6.1/iwlib.egg-info/SOURCES.txt
./iwlib-1.6.1/iwlib.egg-info/dependency_links.txt
./iwlib-1.6.1/iwlib.egg-info/not-zip-safe
./iwlib-1.6.1/iwlib.egg-info/requires.txt
./iwlib-1.6.1/iwlib.egg-info/top_level.txt
./iwlib-1.6.1/test
./iwlib-1.6.1/test/test_imports.py
./iwlib-1.6.1/AUTHORS
./iwlib-1.6.1/COPYING
./iwlib-1.6.1/MANIFEST.in
./iwlib-1.6.1/README.rst
./iwlib-1.6.1/setup.py
./iwlib-1.6.1/PKG-INFO
./iwlib-1.6.1/setup.cfg
And tar.gz file on GitHUB https://github.com/nathan-hoad/python-iwlib/releases contains:
./python-iwlib-1.6.1
./python-iwlib-1.6.1/.gitignore
./python-iwlib-1.6.1/AUTHORS
./python-iwlib-1.6.1/COPYING
./python-iwlib-1.6.1/MANIFEST.in
./python-iwlib-1.6.1/README.rst
./python-iwlib-1.6.1/iwlib
./python-iwlib-1.6.1/iwlib/__init__.py
./python-iwlib-1.6.1/iwlib/_iwlib_build.py
./python-iwlib-1.6.1/iwlib/iwconfig.py
./python-iwlib-1.6.1/iwlib/iwlist.py
./python-iwlib-1.6.1/iwlib/utils.py
./python-iwlib-1.6.1/setup.py
./python-iwlib-1.6.1/test
./python-iwlib-1.6.1/test/__init__.py
./python-iwlib-1.6.1/test/test_imports.py
Why PyPi version contains iwlib/_fakeiwlib_build.py and inside references to /usr/include/fakeiwlib.h?
I don't know why but get_iwconfig
only returns the info of currently used AP, where I am supposed to get multiple results.
Do you have any idea of why this is happening?
>>> iwlib.get_iwconfig("wlan0")
{'NWID': b'Auto', 'Frequency': b'5.24 GHz', 'Access Point': b'MAC_ADDRESS_HERE, 'BitRate': b'390 Mb/s', 'ESSID': b'ESSID_HERE', 'Mode': b'Managed', 'stats': {'quality': 42, 'level': 188, 'noise': 0, 'updated': 75}}
I confirmed there are multiple APs (16) detected with iw
.
Is this somehow related to sudo privilege?
$ sudo iw wlan0 scan | grep "SSID:" | wc -l
16
Hi. iwlib show essential information... but lost the most important: the channel of AP.
It is possibie implement it?
Thanks
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.