Skip to content

update to http handling using new Hishel features #92

update to http handling using new Hishel features

update to http handling using new Hishel features #92

Workflow file for this run

name: Deploy
on:
push:
tags: ['v*']
workflow_dispatch:
inputs:
pre-release-suffix:
description: 'Version suffix for pre-releases ("a", "b", "rc", etc.)'
required: false
default: 'dev'
pre-release-version:
description: 'Version number for pre-releases; defaults to build number'
required: false
default: ''
env:
LATEST_PY_VERSION: '3.10'
PYTEST_VERBOSE: 'true'
jobs:
# Run tests for all supported requests versions and minimum supported python version
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8]
# Run tests for most recent python versions
include:
- python-version: '3.10'
requests-version: latest
fail-fast: false
steps:
# Set up python + poetry
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- uses: snok/install-poetry@v1.3
with:
virtualenvs-in-project: true
# Cache packages per python version, and reuse until lockfile changes
- name: Cache python packages
id: cache
uses: actions/cache@v3
with:
path: .venv
key: venv-${{ matrix.python-version }}-${{ hashFiles('poetry.lock') }}
- name: Install dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: |
poetry install -v && poetry run pip install pandas
# Run unit + integration tests, with additional stress tests
- name: Run tests
run: |
source $VENV
nox -e test-current
env:
PATENT_CLIENT_BASE_DIR: ./${{ matrix.python-version }}
# Deploy stable builds on tags only, and pre-release builds from manual trigger ("workflow_dispatch")
release:
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ env.LATEST_PY_VERSION }}
- uses: snok/install-poetry@v1
with:
virtualenvs-in-project: true
- name: Set pre-release version
if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
env:
pre-release-suffix: ${{ github.event.inputs.pre-release-suffix || 'dev' }}
pre-release-version: ${{ github.event.inputs.pre-release-version || github.run_number }}
run: |
poetry version $(poetry version -s).${{ env.pre-release-suffix }}${{ env.pre-release-version }}
poetry version
- name: Build and publish to pypi
run: |
poetry build
poetry publish -u __token__ -p ${{ secrets.PYPI_TOKEN }}