Git Product home page Git Product logo

Comments (7)

mindflayer avatar mindflayer commented on June 12, 2024 1

I had a look again at what you did. It's definitely something I have never seen before, but it works, and the fix was super-easy.

Here is a new Mocket version for you: https://pypi.org/project/mocket/3.10.9/

from python-mocket.

mindflayer avatar mindflayer commented on June 12, 2024

Hi @amotl, I had a look at your project and I noticed the way you are using mocket is very uncommon.
You don't seem to be using its decorator nor its context manager, which is probably the reason why Mocket does not have that attribute set properly (connect is not happening inside Mocket's scope).
Could you please help me with a snippet of code that fail the same way as your tests?
The _address attribute wasn't moved, this is the only recent change related to it:
https://github.com/mindflayer/python-mocket/pull/183/files#diff-bdbad69094211a1bec191da22004fa4eea8ed1e953a16e52da1e442036f18b47R430

from python-mocket.

mindflayer avatar mindflayer commented on June 12, 2024

I even see you are creating a MocketEntry with (None, None) as location, which makes no sense because no client would try to connect to that couple of non-existing host/port.

from python-mocket.

amotl avatar amotl commented on June 12, 2024

Dear Giorgio,

thanks a stack for taking the time to look into this, and for discovering our irregular use of Mocket. I have to admit I did not look too closely when "just bumping some development dependencies" ;].

So, it appears that we will have to do our homework and review/modify our usage of Mocket accordingly. On that matter, I want to avoid bothering you any longer about it, and diverted this issue back to hiveeyes/terkin-datalogger#117 again.

I even see you are creating a MocketEntry with (None, None) as location, which makes no sense because no client would try to connect to that couple of non-existing host/port.

I think that was needed to support the irregular socket.AF_LORA socket type, which completely lacks the host/port addressing scheme.

Thank you again and with kind regards,
Andreas.

from python-mocket.

mindflayer avatar mindflayer commented on June 12, 2024

Nevertheless, @amotl let me know if you need any kind of support on my end, no matter if it's for something Mocket supports at the moment or not.

from python-mocket.

amotl avatar amotl commented on June 12, 2024

Dear Giorgio,

your offer is very kind. However, I don't have any other specific need for help other than offering a detailed reproduction, if you are really keen enough that you would like to look directly into the issue on behalf of the code base where I have been observing it.

If you can quickly spot what I was doing wrong, and see an immediate solution, I will be more than happy. Otherwise, please don't waste your valuable time on this matter. The workable solution is to just downgrade to mocket-3.9.x, so it is currently not a blocker for the evolution of Terkin - however it may well become in the future.

With kind regards,
Andreas.

Success

# Acquire sources and create sandbox environment.
git clone https://github.com/hiveeyes/terkin-datalogger
cd terkin-datalogger/
python3.10 -m venv .venv310
source .venv310/bin/activate

# Install dependency packages from PyPI.
pip install --editable=.[lorawan] --requirement=requirements-test.txt

# Install more requirements manually. We will have to improve this.
wget https://raw.githubusercontent.com/daq-tools/micropython/improve-onewire/drivers/onewire/onewire.py --output-document=dist-packages/onewire_native.py
wget https://raw.githubusercontent.com/micropython/micropython/v1.11/drivers/onewire/ds18x20.py --output-document=dist-packages/ds18x20_native.py
wget https://raw.githubusercontent.com/robert-hh/BME280/79ccf348ec674f15c92a1debf1aceb383db38321/bme280_float.py --output-document=dist-packages/bme280_float.py 

# Run specific set of software tests, to save cycles.
pytest test/test_lorawan.py

Error

See it failing after upgrading to most recent version of mocket.

pip install mocket --upgrade
pytest --no-cov test/test_lorawan.py -k test_uplink_system_temperature

Works again

Make it work again by downgrading to mocket-3.9.x.

pip install "mocket<3.10" --upgrade
pytest --no-cov test/test_lorawan.py -k test_uplink_system_temperature

from python-mocket.

amotl avatar amotl commented on June 12, 2024

Hi again,

after a bit more fiddling at hiveeyes/terkin-datalogger#116, it now works like a charm. Thank you so much for the exceptional quick fix and release!

With kind regards,
Andreas.

from python-mocket.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.