Giter VIP home page Giter VIP logo

gufo_snmp's People

Contributors

dvolodin7 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

gufo_snmp's Issues

BUG: Getting FileNotFoundError exception if multiple instances of SnmpSession were previously used

Describe the issue:

Getting a FileNotFoundError exception if multiple instances of SnmpSession were previously used.

Reproduce the code example:

import asyncio
from gufo.snmp import SnmpSession

async def run_multiple_sessions() -> None:
    for i in range(10):
        async with SnmpSession(
            addr="127.0.0.1",
            community="public"
        ) as session:
            async for _ in session.fetch("1.3.6.1.2.1.1"):
                pass

asyncio.run(run_multiple_sessions())

Error message:

Traceback (most recent call last):
  File "/opt/gufo-snmp/run-multiple.py", line 13, in <module>
    asyncio.run(run_multiple_sessions())
  File "/usr/lib/python3.9/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/usr/lib/python3.9/asyncio/base_events.py", line 642, in run_until_complete
    return future.result()
  File "/opt/gufo-snmp/run-multiple.py", line 10, in run_multiple_sessions
    async for _ in session.fetch("1.3.6.1.2.1.1"):
  File "/opt/gufo-snmp/venv/lib/python3.9/site-packages/gufo/snmp/getbulk.py", line 74, in __anext__
    loop.add_writer(self._fd, w_ev.set)
  File "/usr/lib/python3.9/asyncio/selector_events.py", line 346, in add_writer
    self._add_writer(fd, callback, *args)
  File "/usr/lib/python3.9/asyncio/selector_events.py", line 304, in _add_writer
    self._selector.modify(fd, mask | selectors.EVENT_WRITE,
  File "/usr/lib/python3.9/selectors.py", line 390, in modify
    self._selector.modify(key.fd, selector_events)
FileNotFoundError: [Errno 2] No such file or directory

Python version information

3.9.2 (default, Feb 28 2021, 17:03:44)
[GCC 10.2.1 20210110

Gufo Ping version information

0.1.0

Operation system version

Debian GNU/Linux 11 (bullseye)

BUG: install gufo-snmp on Mac (m3) fails on rust issue

Describe the issue:

tried installing the package on my MacBook Pro m3 pro laptop but it ran into a problem.
I have no issues on another laptop that runs ubuntu

Reproduce the code example:

pdm add gufo-snmp

Error message:

(inetutils-python-3.12) sh-3.2# pdm add gufo-snmp
Adding packages to default dependencies: gufo-snmp
๐Ÿ”’ Lock successful
Changes are written to pyproject.toml.
Synchronizing working set with resolved packages: 1 to add, 0 to update, 0 to remove

  โœ– Install gufo-snmp 0.5.0 failed
Retry failed jobs
  โœ– Install gufo-snmp 0.5.0 failed

ERRORS:
add gufo-snmp failed:
Traceback (most recent call last):
  File "/opt/homebrew/Cellar/[email protected]/3.12.2_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/nielsvanhooij/Library/Application Support/pdm/venv/lib/python3.12/site-packages/pdm/installers/synchronizers.py", line 285, in install_candidate
    self.manager.install(can)
  File "/Users/nielsvanhooij/Library/Application Support/pdm/venv/lib/python3.12/site-packages/pdm/installers/manager.py", line 34, in install
    dist_info = installer(str(prepared.build()), self.environment, prepared.direct_url())
                              ^^^^^^^^^^^^^^^^
  File "/Users/nielsvanhooij/Library/Application Support/pdm/venv/lib/python3.12/site-packages/pdm/models/candidates.py", line 418, in build
    self.wheel = Path(builder.build(build_dir, metadata_directory=self._metadata_dir))
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/nielsvanhooij/Library/Application Support/pdm/venv/lib/python3.12/site-packages/pdm/builders/wheel.py", line 28, in build
    filename = self._hook.build_wheel(out_dir, config_settings, metadata_directory)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/nielsvanhooij/Library/Application Support/pdm/venv/lib/python3.12/site-packages/pyproject_hooks/_impl.py", line 209, in build_wheel
    return self._call_hook('build_wheel', {
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/nielsvanhooij/Library/Application Support/pdm/venv/lib/python3.12/site-packages/pyproject_hooks/_impl.py", line 311, in _call_hook
    self._subprocess_runner(
  File "/Users/nielsvanhooij/Library/Application Support/pdm/venv/lib/python3.12/site-packages/pdm/builders/base.py", line 261, in subprocess_runner
    return log_subprocessor(cmd, cwd, extra_environ=env)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/nielsvanhooij/Library/Application Support/pdm/venv/lib/python3.12/site-packages/pdm/builders/base.py", line 107, in log_subprocessor
    raise build_error(e) from None
pdm.exceptions.BuildError: Build backend raised error: Showing the last 10 lines of the build output:
adding license file 'LICENSE.md'
writing manifest file 'src/gufo_snmp.egg-info/SOURCES.txt'
running build_ext
running build_rust
cargo rustc --lib --message-format=json-render-diagnostics --manifest-path Cargo.toml --release -v --features pyo3/extension-module --crate-type cdylib -- -C link-args=-undefined dynamic_lookup -Wl,-install_name,@rpath/_fast.cpython-312-darwin.so
error: failed to parse manifest at `/private/tmp/pdm-build-bffi8i33/Cargo.toml`

Caused by:
  can't find `cri_decode` bench at `benches/cri_decode.rs` or `benches/cri_decode/main.rs`. Please specify bench.path if you want to use a non-default path.
error: `cargo rustc --lib --message-format=json-render-diagnostics --manifest-path Cargo.toml --release -v --features pyo3/extension-module --crate-type cdylib -- -C 'link-args=-undefined dynamic_lookup -Wl,-install_name,@rpath/_fast.cpython-312-darwin.so'` failed 
with code 101

Python version information

3.12

Gufo Ping version information

0.5.0

Operation system version

macOS Sonoma 14.3.1

ENH: <sync version support>

Proposed new feature or change:

appreciate hardworking on this project. Is there any possible to support sync version rather that async only?

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.