{"id":13648287,"url":"https://github.com/svinota/pyroute2","last_synced_at":"2025-05-11T03:44:33.637Z","repository":{"id":37561981,"uuid":"9289343","full_name":"svinota/pyroute2","owner":"svinota","description":"Python Netlink and PF_ROUTE library — network configuration and monitoring","archived":false,"fork":false,"pushed_at":"2025-05-09T05:03:30.000Z","size":9367,"stargazers_count":997,"open_issues_count":161,"forks_count":251,"subscribers_count":45,"default_branch":"master","last_synced_at":"2025-05-11T03:44:25.537Z","etag":null,"topics":["9p","9p2000","bsd","dhcp","ethtool","generic-netlink","genl","linux","namespace","netlink","netns","network","network-namespace","nfnetlink","nl80211","plan9","python","rtnl","wireguard"],"latest_commit_sha":null,"homepage":"https://pyroute2.org/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/svinota.png","metadata":{"files":{"readme":"README.contribute.rst","changelog":"CHANGELOG.rst","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":"svinota"}},"created_at":"2013-04-08T05:38:22.000Z","updated_at":"2025-05-09T10:23:06.000Z","dependencies_parsed_at":"2022-07-13T15:59:46.388Z","dependency_job_id":"622d4f10-5584-4c54-8077-fd23a6ae057e","html_url":"https://github.com/svinota/pyroute2","commit_stats":{"total_commits":4521,"total_committers":171,"mean_commits":26.43859649122807,"dds":"0.27117894271178944","last_synced_commit":"78cfe838bec8d96324811a3962bda15fb028e0ce"},"previous_names":[],"tags_count":121,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/svinota%2Fpyroute2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/svinota%2Fpyroute2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/svinota%2Fpyroute2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/svinota%2Fpyroute2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/svinota","download_url":"https://codeload.github.com/svinota/pyroute2/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253514552,"owners_count":21920334,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["9p","9p2000","bsd","dhcp","ethtool","generic-netlink","genl","linux","namespace","netlink","netns","network","network-namespace","nfnetlink","nl80211","plan9","python","rtnl","wireguard"],"created_at":"2024-08-02T01:04:06.759Z","updated_at":"2025-05-11T03:44:33.619Z","avatar_url":"https://github.com/svinota.png","language":"Python","funding_links":["https://github.com/sponsors/svinota"],"categories":["Python"],"sub_categories":[],"readme":".. devcontribute:\n\nProject Contribution Guide\n==========================\n\nSetup the Environment\n---------------------\n\n.. code-block:: bash\n\n    # Make sure you have the following installed:\n    #   bash\n    #   git\n    #   python\n    #   GNU make, sed, awk\n\n    # Clone the repository\n    git clone ${pyroute2_git_url}\n    cd pyroute2\n\n    # Run the test suite\n    sudo make test\n\n\nTest-Driven Development\n-----------------------\n\nIt is best practice that every change is covered by tests. To make\nthings easier, write the tests first and then implement your feature.\n\nThe test modules are located in the `/tests/` folder and are run\nusing nox. You can add your tests to an existing test module or create\nyour own module if it requires a specific environment that is not yet\ncovered. In that case, add a new session to `noxfile.py`.\n\nThe project’s convention is to use pytest, but it is not a strict\nrequirement. If testing your feature requires a specific framework or\nuses the standard library’s `unittest` module, it can be discussed\nin the pull request.\n\nHowever, tests must always be run using a nox session.\n\n\nCode Linting\n------------\n\nThe code must be formatted according to the project’s code style.\nThe simplest way is to run `make format`, which will automatically\nreformat the code.\n\n.. note::\n   The code must pass `make format` in order to be merged.\n\nIn addition to code style checks, additional linting is performed.\nIt is best practice to add type annotations and ensure that the\nmodified code passes mypy linting. If you do so, add the affected\nfile or module to `.mypy-check-paths` so that subsequent changes\nwill not undo your work.\n\n\nRun Specific Test Modules\n--------------------------\n\nIt is possible to run a specific test session instead of running\nall default sessions:\n\n.. code-block:: bash\n\n    make test session=unit             # run only tests/test_unit\n    make test session=core-python3.14  # run tests/test_core with Python 3.14\n\nSee `noxfile.py` for the defined sessions and the Python version matrix.\n\nEach test session is run in a separate Python process within its own\nvirtual environment, while test modules within the same session share\nthe process and virtual environment.\n\nThus, testing integration with libraries such as eventlet, or testing\nmultiprocessing start methods (spawn, fork, etc.), requires a separate\nsession since such process setup can only be performed once.\n\nTo run a specific test module within a session, use the `noxconfig` argument:\n\n.. code-block:: bash\n\n    # Run tests/test_linux/test_ndb/test_mpls.py\n    make test session=linux-python3.14 \\\n        noxconfig='{\"sub\": \"test_ndb/test_mpls.py\"}'\n\n\nTest Session Configuration\n---------------------------\n\nTest session configuration can be provided via the `noxconfig` argument\nin JSON format. Available options:\n\n**coverage** (bool, default: false)\n  Generate a coverage report.\n\n**exitfirst** (bool, default: true)\n  Exit the session after the first failure (true) or run all tests and\n  report failures at the end (false).\n\n**fail_on_warnings** (bool, default: false)\n  Fail on Python warnings, such as DeprecationWarning.\n\n**fast** (bool, default: false)\n  Reuse an existing virtual environment for the session (true) or purge\n  the virtual environment and create a new one from scratch (false).\n  This option might be useful when running tests offline, but it may\n  leave artifacts in the source tree. It is disabled by default and\n  requires at least one run with `\"fast\": false` to properly set up\n  the virtual environment. Use with caution.\n\n**pdb** (bool, default: false)\n  Launch the pdb debugger shell on errors.\n\n**sub** (str, default: none)\n  Select the module to run within the session.\n\n**test_prefix** (str, default: \"tests\")\n  Override the test sessions directory.\n\n**timeout** (int, default: 60)\n  Test case timeout in seconds.\n\n**verbose** (bool, default: true)\n  If true, print every test case name and description (if available);\n  if false, print only a dot for each test case.\n\n**Example:**\n\n.. code-block:: bash\n\n    make test \\\n        session=core-python3.14 \\\n        noxconfig='{ \\\n            \"exitfirst\": false, \\\n            \"verbose\": false, \\\n            \"timeout\": 10, \\\n            \"pdb\": true, \\\n            \"sub\": \"test_plan9/test_basic.py\" \\\n        }'\n\n\nRunning with nox\n----------------\n\nThe `make test` command creates a virtual environment and installs nox\nwithin it. However, you can also use your system’s installation of nox.\nThe previous example would then look as follows:\n\n.. code-block:: bash\n\n    nox \\\n        -e core-python3.14 -- \\\n        '{ \\\n            \"exitfirst\": false, \\\n            \"verbose\": false, \\\n            \"timeout\": 10, \\\n            \"pdb\": true, \\\n            \"sub\": \"test_plan9/test_basic.py\" \\\n        }'\n\n\nProject Dependencies\n--------------------\n\nThe project is designed to work with only the standard library, which\nis a strict requirement. Some embedded environments even strip the\nstandard library, removing modules such as sqlite3.\n\nTo support such environments, the project provides two packages: `pyroute2`\nand `pyroute2.minimal`. The latter offers a minimal distribution without\nmodules such as sqlite3 or pickle.\n\nThe `pyroute2` and `pyroute2.minimal` packages are mutually exclusive.\nEach provides its own PyPI package.\n\n\nSubmit a Pull Request\n---------------------\n\nThe primary repository for the project is on GitHub. All pull requests\nare welcome.\n\nThe code must meet the following requirements:\n\n- The library must work on Python ≥ 3.9.\n- The code must pass `make format`.\n- The code must not break existing unit and functional tests (run via `sudo make test`).\n- The use of ctypes must not cause the library to fail on SELinux.\n\n\nIRC Channel\n-----------\nThe project has an IRC channel, **#pyroute2**, on the Libera.Chat network.\nWhile the team is not guaranteed to be online 24/7, you can still discuss\nyour questions there.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsvinota%2Fpyroute2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsvinota%2Fpyroute2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsvinota%2Fpyroute2/lists"}