Skip to content

Upgrade python requirement to 3.9 #83

Upgrade python requirement to 3.9

Upgrade python requirement to 3.9 #83

Workflow file for this run

name: Test and upload Python package
on:
pull_request:
push:
branches: [master]
tags:
- 'v*'
- '!v*-dev'
jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: pre-commit/[email protected]
test:
if: github.repository == 'zeek/zeek-client'
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e '.[dev]'
- name: Run unit tests
run: pytest
upload:
runs-on: ubuntu-latest
needs: [test]
if: github.repository == 'zeek/zeek-client' && github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
steps:
- uses: actions/checkout@v3
- name: Check release version
# This fails e.g. if VERSION contains a dev commits suffix,
# since we don't want to push these to PyPI.
run: |
grep -E -x '[0-9]+\.[0-9]+\.[0-9]+' VERSION
- name: Build sdist
# This places the sdist in the dist folder, where the upload
# action in the next step knows to look for it.
run: |
make dist
- name: Upload to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}