Skip to content

Updates the supported versions #16

Updates the supported versions

Updates the supported versions #16

# -*- coding: utf-8 -*-
#
# K2hash Python Driver under MIT License
#
# Copyright (c) 2022 Yahoo Japan Corporation
#
# For the full copyright and license information, please view
# the license file that was distributed with this source code.
#
# AUTHOR: Hirotaka Wakabayashi
# CREATE: Tue Feb 08 2022
# REVISION:
#
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Python package
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
release:
types: [published]
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.13", "3.12", "3.11", "3.10", "3.9"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
architecture: "x64"
- name: Install dependencies
run: |
./.github/scripts/install_dependencies.sh
shell: sh
- name: Install dependencies in GHA
run: |
python -m pip install --upgrade pip
pip install pylint pytest
- name: Lint with pylint
run: |
./.github/scripts/lint_with_pylint.sh
shell: sh
- name: Test with unittest
run: |
python -I -m pip install setuptools wheel
pip install -q build
python -m build
pip3 install dist/k2hash-*.whl
pytest
shell: sh
- name: Install dependencies for upload pypi package
if: startsWith(github.ref, 'refs/tags')
run: |
python -m pip install --upgrade pip
pip install build
- name: Build package
if: startsWith(github.ref, 'refs/tags')
run: python -m build
- name: Publish distribution to PyPI
if: ${{ matrix.python-version == '3.12' && startsWith(github.ref, 'refs/tags') }}
uses: pypa/gh-action-pypi-publish@release/v1