Skip to content

Commit

Permalink
Move to poetry
Browse files Browse the repository at this point in the history
  • Loading branch information
luqasz committed Aug 16, 2023
1 parent ffc6973 commit f8e434f
Show file tree
Hide file tree
Showing 5 changed files with 953 additions and 49 deletions.
7 changes: 0 additions & 7 deletions .bumpversion.cfg

This file was deleted.

51 changes: 18 additions & 33 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,62 +10,47 @@ jobs:
strategy:
fail-fast: false
matrix:
napalm_version:
- "3.*"
- "4.*"
python_version:
- "3.7"
- "3.8"
- "3.9"
- "3.10"
- "3.11"
exclude:
- napalm_version: "4.*"
python_version: "3.6"
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true

- name: Set up Python ${{ matrix.python_version }}
id: setup-python
uses: actions/setup-python@v4
id: pysetup
with:
python-version: ${{ matrix.python_version }}
cache: pip

- name: Update core/base packages
run: pip install -U pip setuptools wheel build

- name: Install requirements
run: pip install . -r requirements.txt
cache: "poetry"

- name: Install dev requirements
run: pip install .[tests]

- name: pip list
run: pip list

- name: Install napalm
run: pip install napalm==${{ matrix.napalm_version }}
- name: Install Python dependencies
if: steps.pysetup.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root

- name: Lint
run: pylint napalm_ros
run: poetry run pylint napalm_ros

- name: Format
run: >
poetry run
yapf -dr
napalm_ros
tests
- name: Unit tests
run: pytest tests
run: poetry run pytest tests

- name: Package
run: python3 -m build

- name: Publish package
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') && matrix.python_version == '3.7' && matrix.napalm_version == '4.*'
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.pypi_password }}
- name: Publish
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') && matrix.python_version == '3.7'
env:
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.pypi_password }}
run: poetry publish --build
Loading

0 comments on commit f8e434f

Please sign in to comment.