Skip to content

Commit

Permalink
Merge branch 'master' into spytest
Browse files Browse the repository at this point in the history
  • Loading branch information
sachinholla committed Jan 12, 2024
2 parents 3a63478 + 7613086 commit acbb168
Show file tree
Hide file tree
Showing 88 changed files with 1,264 additions and 1,595 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@

name: Python package and publish

on:
release:
types: [published]

jobs:
pypi-publish:
name: Package and upload release to PyPI
runs-on: ubuntu-latest
environment: release
permissions:
id-token: write
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Install building dependencies
run: pip -q install build
- name: Build package
run: python -m build --outdir dist/ .
- name: Install package
run: pip -q install dist/pyangbind-*.whl
- name: Test bind with pyang
run: |
export PYBINDPLUGIN=`/usr/bin/env python -c 'import pyangbind; import os; print ("{}/plugin".format(os.path.dirname(pyangbind.__file__)))'`
pyang -V --plugindir $PYBINDPLUGIN -f pybind tests/base-test.yang
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1


40 changes: 40 additions & 0 deletions .github/workflows/python-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# 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: Run TOX tests

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

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
- name: Install testing dependency
run: pip install tox
- name: Lint with black
run: tox -e black
unit-tests:
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 testing dependencies
run: pip install tox
- name: Run tox for ${{ matrix.python-version }}
# Run tox using the version of Python in `PATH`
run: tox -e py
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,4 @@ tests/serialise/openconfig-serialise/include/
tests/serialise/openconfig-serialise/ocbind/
tests/serialise/openconfig-serialise/openconfig/
tests/split-classes/bindings/
tests/base-binding-out.py
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
Loading

0 comments on commit acbb168

Please sign in to comment.