Skip to content

Commit

Permalink
[chores] Formatted code and docs, updated dependabot configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
pandafy committed Aug 12, 2024
1 parent 806860f commit eabf808
Show file tree
Hide file tree
Showing 9 changed files with 294 additions and 211 deletions.
6 changes: 0 additions & 6 deletions .coveragerc

This file was deleted.

6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,9 @@ updates:
interval: "monthly"
commit-message:
prefix: "[deps] "
- package-ecosystem: "github-actions" # Check for GitHub Actions updates
directory: "/"
schedule:
interval: "monthly" # Check for updates weekly
commit-message:
prefix: "[ci] "
46 changes: 22 additions & 24 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:

build:
name: Python==${{ matrix.python-version }} | ${{ matrix.django-version }}
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
Expand All @@ -29,41 +29,39 @@ jobs:
ref: ${{ github.event.pull_request.head.sha }}

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
cache-dependency-path: |
**/requirements*.txt
- name: Upgrade python system packages
run: pip install -U pip wheel

- name: Install test dependencies
run: pip install -r requirements-test.txt

- name: Install netdiff
run: pip install -e .
- name: Install Dependencies
id: deps
run: |
pip install -U pip wheel setuptools
pip install -U -r requirements-test.txt
pip install -U -e .
pip install --no-cache-dir --no-deps -U "openwisp-utils[qa] @ https://github.com/openwisp/openwisp-utils/tarball/master"
- name: QA checks
run: ./run-qa-checks

- name: Tests
run: coverage run -a --source=netdiff runtests.py
if: ${{ !cancelled() && steps.deps.conclusion == 'success' }}
run: coverage run runtests.py

- name: Upload Coverage
run: coveralls --service=github
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_FLAG_NAME: python-${{ matrix.python-version }}
COVERALLS_PARALLEL: true
if: ${{ success() }}
uses: coverallsapp/github-action@v2
with:
format: cobertura
flag-name: python-${{ matrix.env.env }}
github-token: ${{ secrets.GITHUB_TOKEN }}

coveralls:
name: Finish Coveralls
needs: build
runs-on: ubuntu-latest
container: python:3-slim
steps:
- name: Finished
run: |
pip3 install --upgrade coveralls
coveralls --finish --service=github
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Coveralls Finished
uses: coverallsapp/github-action@v2
142 changes: 89 additions & 53 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ Version 1.0.0 [28-04-2022]
Version 0.9.0 [28-07-2020]
--------------------------

- **Backward incompatible change for OpenVPN Parser**:
switched to use common name as netjson ID to avoid duplicate nodes when
multiple nodes are behind the same public IP, for more information
see `Specialized features: OpenVPN <https://github.com/openwisp/netdiff#openvpn>`_
- **Backward incompatible change for OpenVPN Parser**: switched to use
common name as netjson ID to avoid duplicate nodes when multiple nodes
are behind the same public IP, for more information see `Specialized
features: OpenVPN <https://github.com/openwisp/netdiff#openvpn>`_

Version 0.8.0 [28-06-2020]
--------------------------
Expand All @@ -27,13 +27,12 @@ Version 0.8.0 [28-06-2020]
be missed if the OpenVPN nodes had same IP but different ports
- Feature: detect changes in nodes and links
- Change: Added/remove/changed nodes/links are now sorted
- Change: Unspecified fields like node's label and link's ``cost_text`` are now always
shown as empty string if they are not specified
- Change: Unspecified fields like node's label and link's ``cost_text``
are now always shown as empty string if they are not specified
- Change: Parse ``cost_text`` field from links
- **Backward incompatible change**: the output of ``diff`` in this release differs
slightly from the previous versions.
Applications using previous netdiff versions will likely need minor adjustments
to their code
- **Backward incompatible change**: the output of ``diff`` in this release
differs slightly from the previous versions. Applications using previous
netdiff versions will likely need minor adjustments to their code
- Documentation Improvements
- Added support for openwisp-utils~=0.5.0

Expand All @@ -56,114 +55,151 @@ Version 0.6.0 [27-12-2017]
[openvpn] Convert node properties to integer
- `6b72dab <https://github.com/ninuxorg/netdiff/commit/6b72dab>`_:
[openvpn] Avoid failing if data is empty
- `#56 <https://github.com/ninuxorg/netdiff/pull/56>`_:
Updated networkx to 2.0
- `#56 <https://github.com/ninuxorg/netdiff/pull/56>`_: Updated networkx
to 2.0

Version 0.5.2 [26-12-2017]
--------------------------

- `#55 <https://github.com/ninuxorg/netdiff/pull/55>`_:
Added a label in OpenvpnParser output
- `#52 <https://github.com/ninuxorg/netdiff/pull/52>`_:
Added a label in NetjsonParser output
- `#49 <https://github.com/ninuxorg/netdiff/pull/49>`_:
Added support to TAP mode in OpenVPN parser
- `#55 <https://github.com/ninuxorg/netdiff/pull/55>`_: Added a label in
OpenvpnParser output
- `#52 <https://github.com/ninuxorg/netdiff/pull/52>`_: Added a label in
NetjsonParser output
- `#49 <https://github.com/ninuxorg/netdiff/pull/49>`_: Added support to
TAP mode in OpenVPN parser

Version 0.5.1 [29-09-2017]
--------------------------

- `#47 <https://github.com/ninuxorg/netdiff/pull/47>`_:
Added OpenVPN parser
- `#47 <https://github.com/ninuxorg/netdiff/pull/47>`_: Added OpenVPN
parser

Version 0.5.0 [30-08-2017]
--------------------------

- `#40 <https://github.com/ninuxorg/netdiff/issues/40>`_:
implemented stricter input (**backward incompatible**)
- `#40 <https://github.com/ninuxorg/netdiff/issues/40>`_: implemented
stricter input (**backward incompatible**)

Version 0.4.8 [30-08-2017]
--------------------------

- pinned precise supported versions of dependencies to avoid incompatibilities
- pinned precise supported versions of dependencies to avoid
incompatibilities

Version 0.4.7 [04-01-2016]
--------------------------

- `c79b745 <https://github.com/ninuxorg/netdiff/commit/c79b745>`_: fixed return value of ``_get_primary_address()`` in ``BatmanParser``
- `c79b745 <https://github.com/ninuxorg/netdiff/commit/c79b745>`_: fixed
return value of ``_get_primary_address()`` in ``BatmanParser``

Version 0.4.6 [27-12-2015]
--------------------------

- `#36 <https://github.com/ninuxorg/netdiff/issues/36>`_: fixed wrong diff when same nodes but different links
- `#36 <https://github.com/ninuxorg/netdiff/issues/36>`_: fixed wrong diff
when same nodes but different links

Version 0.4.5 [28-09-2015]
--------------------------

- `#34 <https://github.com/ninuxorg/netdiff/issues/34>`_: show ``local_addresses`` in NetJSON output (``OlsrParser``, ``BatmanParser`` and ``NetJsonParser``)
- `#29 <https://github.com/ninuxorg/netdiff/issues/29>`_: support additional properties in NetJSON output
- `#32 <https://github.com/ninuxorg/netdiff/issues/32>`_: mock telnet requests in tests
- `63a5e8a <https://github.com/ninuxorg/netdiff/commit/63a5e8a>`_: added ``"Unrecognized format"`` message in ``ParserError`` exceptions
- `9ed48a4 <https://github.com/ninuxorg/netdiff/commit/9ed48a4>`_: added arbitrary metric value (average of tx and rx) in ``Bmx6Parser``
- `#34 <https://github.com/ninuxorg/netdiff/issues/34>`_: show
``local_addresses`` in NetJSON output (``OlsrParser``, ``BatmanParser``
and ``NetJsonParser``)
- `#29 <https://github.com/ninuxorg/netdiff/issues/29>`_: support
additional properties in NetJSON output
- `#32 <https://github.com/ninuxorg/netdiff/issues/32>`_: mock telnet
requests in tests
- `63a5e8a <https://github.com/ninuxorg/netdiff/commit/63a5e8a>`_: added
``"Unrecognized format"`` message in ``ParserError`` exceptions
- `9ed48a4 <https://github.com/ninuxorg/netdiff/commit/9ed48a4>`_: added
arbitrary metric value (average of tx and rx) in ``Bmx6Parser``

Version 0.4.4 [06-09-2015]
--------------------------

- `#31 <https://github.com/ninuxorg/netdiff/issues/31>`_: mocked HTTP requests in tests
- `#28 <https://github.com/ninuxorg/netdiff/issues/28>`_: replaced weight with cost in all NetJSON occurrences
- `#31 <https://github.com/ninuxorg/netdiff/issues/31>`_: mocked HTTP
requests in tests
- `#28 <https://github.com/ninuxorg/netdiff/issues/28>`_: replaced weight
with cost in all NetJSON occurrences

Version 0.4.3 [02-07-2015]
--------------------------

- `#27 <https://github.com/ninuxorg/netdiff/issues/27>`_: added support for txtinfo format to ``BatmanParser``
- `ab9c40 <https://github.com/ninuxorg/netdiff/commit/ab9c40>`_, `9ac89a <https://github.com/ninuxorg/netdiff/commit/9ac89a>`_: minor optimizations and simplifications in ``BatmanParser``
- `990a30 <https://github.com/ninuxorg/netdiff/commit/990a30>`_: minor optimization in ``Bmx6Parser``
- `64f8f44 <https://github.com/ninuxorg/netdiff/commit/64f8f44>`_: the parse() method of each parser now must return a networkx.Graph instance instead of storing it
- `#27 <https://github.com/ninuxorg/netdiff/issues/27>`_: added support
for txtinfo format to ``BatmanParser``
- `ab9c40 <https://github.com/ninuxorg/netdiff/commit/ab9c40>`_, `9ac89a
<https://github.com/ninuxorg/netdiff/commit/9ac89a>`_: minor
optimizations and simplifications in ``BatmanParser``
- `990a30 <https://github.com/ninuxorg/netdiff/commit/990a30>`_: minor
optimization in ``Bmx6Parser``
- `64f8f44 <https://github.com/ninuxorg/netdiff/commit/64f8f44>`_: the
parse() method of each parser now must return a networkx.Graph instance
instead of storing it

Version 0.4.2 [27-06-2015]
--------------------------

- `deea34 <https://github.com/ninuxorg/netdiff/commit/deea34>`_: skip links with infinite cost in ``OlsrParser``
- `deea34 <https://github.com/ninuxorg/netdiff/commit/deea34>`_: skip
links with infinite cost in ``OlsrParser``

Version 0.4.1 [26-06-2015]
--------------------------

- `#13 <https://github.com/ninuxorg/netdiff/issues/13>`_: added support for OLSR 0.6.x txtinfo plugin
- `e94e91 <https://github.com/ninuxorg/netdiff/commit/e94e91>`_: updated default "version" attribute of ``OlsrParser``
- `#13 <https://github.com/ninuxorg/netdiff/issues/13>`_: added support
for OLSR 0.6.x txtinfo plugin
- `e94e91 <https://github.com/ninuxorg/netdiff/commit/e94e91>`_: updated
default "version" attribute of ``OlsrParser``

Version 0.4 [14-06-2015]
------------------------

- `#21 <https://github.com/ninuxorg/netdiff/issues/21>`_: **breaking change** made ``diff`` output consistent with NetJSON ``NetworkGraph``
- `#24 <https://github.com/ninuxorg/netdiff/issues/24>`_: add "changed" section to ``diff`` to show changes in weight
- `a6a161a <https://github.com/ninuxorg/netdiff/commit/a6a161a>`_: ``diff`` now returns an OrderedDict
- `#21 <https://github.com/ninuxorg/netdiff/issues/21>`_: **breaking
change** made ``diff`` output consistent with NetJSON ``NetworkGraph``
- `#24 <https://github.com/ninuxorg/netdiff/issues/24>`_: add "changed"
section to ``diff`` to show changes in weight
- `a6a161a <https://github.com/ninuxorg/netdiff/commit/a6a161a>`_:
``diff`` now returns an OrderedDict

Version 0.3.2 [03-06-2015]
--------------------------

- `#26 <https://github.com/ninuxorg/netdiff/issues/26>`_: renamed exceptions with "NetParser" prefix
- `#25 <https://github.com/ninuxorg/netdiff/issues/25>`_: raise Exception if topology file/URL not reachable
- `53e02cc <https://github.com/ninuxorg/netdiff/commit/53e02cc>`_: flagged ``to_python`` of ``BaseParser`` as public
- `48d2927 <https://github.com/ninuxorg/netdiff/commit/48d2927>`_: refactored exceptions, added explaination in README
- `#26 <https://github.com/ninuxorg/netdiff/issues/26>`_: renamed
exceptions with "NetParser" prefix
- `#25 <https://github.com/ninuxorg/netdiff/issues/25>`_: raise Exception
if topology file/URL not reachable
- `53e02cc <https://github.com/ninuxorg/netdiff/commit/53e02cc>`_: flagged
``to_python`` of ``BaseParser`` as public
- `48d2927 <https://github.com/ninuxorg/netdiff/commit/48d2927>`_:
refactored exceptions, added explaination in README

Version 0.3.1 [22-05-2015]
--------------------------

- `c91e4e <https://github.com/ninuxorg/netdiff/commit/c91e4e48917c6503fc490e725da1574cb5c549fe>`_: corrected weight in ``OlsrParser``
- `#22 <https://github.com/ninuxorg/netdiff/pull/22>`_: added subtraction operator as a shortcut to diff function
- `be9f476 <https://github.com/ninuxorg/netdiff/commit/be9f476>`_: corrected ``MANIFEST.in`` to fix egg builds
- `c91e4e
<https://github.com/ninuxorg/netdiff/commit/c91e4e48917c6503fc490e725da1574cb5c549fe>`_:
corrected weight in ``OlsrParser``
- `#22 <https://github.com/ninuxorg/netdiff/pull/22>`_: added subtraction
operator as a shortcut to diff function
- `be9f476 <https://github.com/ninuxorg/netdiff/commit/be9f476>`_:
corrected ``MANIFEST.in`` to fix egg builds

Version 0.3 [15-05-2015]
------------------------

- `#18 <https://github.com/ninuxorg/netdiff/pull/18>`_: added CNML parser
- `#17 <https://github.com/ninuxorg/netdiff/pull/17>`_: added BMX6 (b6m tool) parser
- `#16 <https://github.com/ninuxorg/netdiff/pull/16>`_: added ``NetParserJsonException`` which is raised if no JSON object can be decoded in ``_to_python``
- `#14 <https://github.com/ninuxorg/netdiff/pull/14>`_: replaced ``startswith`` string method with ``urlparse`` module for URL scheme recognition
- `#17 <https://github.com/ninuxorg/netdiff/pull/17>`_: added BMX6 (b6m
tool) parser
- `#16 <https://github.com/ninuxorg/netdiff/pull/16>`_: added
``NetParserJsonException`` which is raised if no JSON object can be
decoded in ``_to_python``
- `#14 <https://github.com/ninuxorg/netdiff/pull/14>`_: replaced
``startswith`` string method with ``urlparse`` module for URL scheme
recognition

Version 0.2 [08-05-2015]
------------------------

- `#12 <https://github.com/ninuxorg/netdiff/pull/12>`_: Added support for telnet urls in ``BaseParser``
- `#12 <https://github.com/ninuxorg/netdiff/pull/12>`_: Added support for
telnet urls in ``BaseParser``

Version 0.1 [02-05-2015]
------------------------
Expand Down
6 changes: 4 additions & 2 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
Contributing
============

Thanks for your interest! We love contributions, so please feel free to fix bugs, improve things, provide documentation. Just `follow the
guidelines <https://github.com/ninuxorg/netdiff#contribute>`_ and submit a PR.
Thanks for your interest! We love contributions, so please feel free to
fix bugs, improve things, provide documentation. Just `follow the
guidelines <https://github.com/ninuxorg/netdiff#contribute>`_ and submit a
PR.
Loading

0 comments on commit eabf808

Please sign in to comment.