Skip to content

Commit

Permalink
Merge branch 'robshakir:master' into add_reserved_word
Browse files Browse the repository at this point in the history
  • Loading branch information
JoseIgnacioTamayo committed Jul 21, 2023
2 parents 6e06ae2 + 23a7a0d commit a1b13b0
Show file tree
Hide file tree
Showing 19 changed files with 165 additions and 108 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python

name: Python test and package

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

jobs:
build:

runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
cache: 'pip' # caching pip dependencies
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
- name: Install building and testing dependencies
run: pip install tox black build
- name: Run tox
# Run tox using the version of Python in `PATH`
run: tox -e py
continue-on-error: true
- name: Build package
run: python -m build
33 changes: 0 additions & 33 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ To avoid unnecessary discussions about coding style we are currently enforcing i
* To ease the testing of generated bindings, there is the `tests.base.PyangBindTestCase` class which
you may subclass in order to automate the process. A simple example of its usage can be seen in
`tests/strings/run.py`.
* Tests can be run via the `tox` command, or `setup.py test`.
* Tests can be run via the `tox` command, or `python3 -m pytest -q tests`.

### Other Issues

Expand Down
7 changes: 2 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
[![#PyangBind][img-pyangbind]][pyangbind-docs]


[![Travis][img-travis]][travis]
[![Codecov][img-codecov]][codecov]
[![PyPI][img-pypi]][pypi-project]
[![PyPI - License][img-license]][license]
[![PyPI - Python Version][img-pyversion]][pypi-project]
Expand Down Expand Up @@ -388,14 +385,14 @@ limitations under the License.
* The managability team at Juniper Networks.


[img-pyangbind]: http://rob.sh/img/pyblogo_gh.png
[img-pyangbind]: https://cdn.rob.sh/img/pyblogo_gh.png
[img-travis]: https://img.shields.io/travis/robshakir/pyangbind.svg
[img-codecov]: https://img.shields.io/codecov/c/github/robshakir/pyangbind.svg
[img-pypi]: https://img.shields.io/pypi/v/pyangbind.svg
[img-license]: https://img.shields.io/pypi/l/pyangbind.svg
[img-pyversion]: https://img.shields.io/pypi/pyversions/pyangbind.svg

[pyangbind-docs]: http://pynms.io/pyangbind/
[pyangbind-docs]: https://github.com/robshakir/pyangbind/tree/master/docs
[travis]: https://travis-ci.org/robshakir/pyangbind
[codecov]: https://codecov.io/gh/robshakir/pyangbind
[pypi-project]: https://pypi.org/project/pyangbind/
Expand Down
2 changes: 1 addition & 1 deletion pyangbind/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.8.1"
__version__ = "0.8.2"
3 changes: 2 additions & 1 deletion pyangbind/lib/yangtypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
from __future__ import unicode_literals

import collections
from collections import abc
import copy
import uuid
from decimal import Decimal
Expand Down Expand Up @@ -416,7 +417,7 @@ def TypedListType(*args, **kwargs):
if not isinstance(allowed_type, list):
allowed_type = [allowed_type]

class TypedList(collections.MutableSequence):
class TypedList(abc.MutableSequence):
_pybind_generated_by = "TypedListType"
_list = list()

Expand Down
6 changes: 6 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[build-system]
requires = [
"setuptools",
"wheel"
]
build-backend = "setuptools.build_meta"
2 changes: 2 additions & 0 deletions requirements.DEVELOPER.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
black==18.5b0; python_version >= '3.6'
build
coverage
pytest
requests
tox
unittest2; python_version < '3.0'
Expand Down
41 changes: 41 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,44 @@
ignore=E111,E114,E121,E126,E127,E128,E131
exclude=.eggs,.tox,env,pyvirtualenv
max-line-length=119

[metadata]
name = pyangbind
version = attr: pyangbind.__version__
description = PyangBind is a plugin for pyang which converts YANG data models into a Python class hierarchy, such that Python can be used to manipulate data that conforms with a YANG model.
long_description_content_type = text/x-rst
long_description = file: README.rst
license = Apache License, Version 2.0
author = Rob Shakir
author_email = rjs@rob.sh
url = https://github.com/robshakir/pyangbind
keywords =
yang
pyang
classifiers =
Development Status :: 4 - Beta
Intended Audience :: Telecommunications Industry
Intended Audience :: Developers
Topic :: Software Development :: Code Generators
License :: OSI Approved :: Apache Software License
Programming Language :: Python :: 2.7
Programming Language :: Python :: 3.4
Programming Language :: Python :: 3.5
Programming Language :: Python :: 3.6
Programming Language :: Python :: 3.7
Programming Language :: Python :: Implementation :: CPython
Programming Language :: Python :: Implementation :: PyPy

[options]
python_requires = >=3.7
install_requires = file: requirements.txt
packages = find:
include_package_data = True
zip_safe=False
test_suite="tests.test_suite",

[options.packages.find]
include =
pyangbind
exclude =
tests
52 changes: 0 additions & 52 deletions setup.py

This file was deleted.

13 changes: 13 additions & 0 deletions tests/integration/openconfig-bgp/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,19 @@ class OpenconfigBGPTests(PyangBindTestCase):
"types/openconfig-types.yang",
"types/openconfig-inet-types.yang",
"types/openconfig-yang-types.yang",
"rib/openconfig-rib-bgp.yang",
"rib/openconfig-rib-bgp-tables.yang",
"rib/openconfig-rib-bgp-shared-attributes.yang",
"rib/openconfig-rib-bgp-attributes.yang",
"rib/openconfig-rib-bgp-table-attributes.yang",
"rib/openconfig-rib-bgp-types.yang",
"segment-routing/openconfig-segment-routing-types.yang",
"network-instance/openconfig-network-instance-types.yang",
"network-instance/openconfig-evpn-types.yang",
"mpls/openconfig-mpls-types.yang",
"bfd/openconfig-bfd.yang",
"optical-transport/openconfig-transport-types.yang",
"platform/openconfig-platform-types.yang",
],
},
{
Expand Down
3 changes: 2 additions & 1 deletion tests/integration/openconfig-interfaces/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ class OpenconfigInterfacesTests(PyangBindTestCase):
"vlan/openconfig-vlan-types.yang",
"types/openconfig-inet-types.yang",
"types/openconfig-yang-types.yang",
"optical-transport/openconfig-transport-types.yang",
"platform/openconfig-platform-types.yang",
],
},
{
Expand All @@ -45,7 +47,6 @@ class OpenconfigInterfacesTests(PyangBindTestCase):
"interfaces/openconfig-if-ip.yang",
"interfaces/openconfig-if-ethernet.yang",
"interfaces/openconfig-if-aggregate.yang",
"interfaces/openconfig-if-types.yang",
"interfaces/openconfig-interfaces.yang",
],
},
Expand Down
13 changes: 13 additions & 0 deletions tests/serialise/juniper-json-examples/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,19 @@ class JuniperJSONTests(PyangBindTestCase):
"types/openconfig-inet-types.yang",
"types/openconfig-yang-types.yang",
"bgp/openconfig-bgp-types.yang",
"rib/openconfig-rib-bgp.yang",
"rib/openconfig-rib-bgp-tables.yang",
"rib/openconfig-rib-bgp-shared-attributes.yang",
"rib/openconfig-rib-bgp-attributes.yang",
"rib/openconfig-rib-bgp-table-attributes.yang",
"rib/openconfig-rib-bgp-types.yang",
"segment-routing/openconfig-segment-routing-types.yang",
"network-instance/openconfig-network-instance-types.yang",
"network-instance/openconfig-evpn-types.yang",
"mpls/openconfig-mpls-types.yang",
"bfd/openconfig-bfd.yang",
"optical-transport/openconfig-transport-types.yang",
"platform/openconfig-platform-types.yang",
],
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
},
"config": {
"enabled": true,
"loopback-mode": false,
"loopback-mode": "NONE",
"type": "",
"description": "",
"name": "",
Expand All @@ -25,7 +25,10 @@
"type": "",
"description": "",
"enabled": true,
"loopback-mode": false,
"loopback-mode": "NONE",
"cpu": false,
"management": false,
"logical": false,
"admin-status": "",
"mtu": 0,
"ifindex": 0,
Expand All @@ -47,7 +50,9 @@
"in-broadcast-pkts": 0,
"carrier-transitions": 0,
"in-unknown-protos": 0,
"in-octets": 0
"in-octets": 0,
"in-pkts": 0,
"out-pkts": 0
}
},
"name": "eth0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
},
"config": {
"enabled": false,
"loopback-mode": false,
"loopback-mode": "",
"type": "",
"description": "",
"name": "",
Expand All @@ -25,7 +25,10 @@
"type": "",
"description": "",
"enabled": false,
"loopback-mode": false,
"cpu": false,
"loopback-mode": "",
"logical":false,
"management": false,
"admin-status": "",
"mtu": 0,
"ifindex": 0,
Expand All @@ -47,7 +50,9 @@
"in-broadcast-pkts": "0",
"carrier-transitions": "0",
"in-unknown-protos": "0",
"in-octets": "0"
"in-octets": "0",
"in-pkts": "0",
"out-pkts": "0"
}
},
"name": "eth0"
Expand Down

0 comments on commit a1b13b0

Please sign in to comment.