Skip to content

Commit

Permalink
Merge pull request #1 from Gallaecio/ci
Browse files Browse the repository at this point in the history
Upgrade supported Python versions and CI config
  • Loading branch information
kmike authored Jun 13, 2024
2 parents 293a2d0 + 330cbe1 commit 90b0878
Show file tree
Hide file tree
Showing 20 changed files with 445 additions and 255 deletions.
8 changes: 8 additions & 0 deletions .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[bumpversion]
current_version = 0.3.6
commit = True
tag = True
tag_name = {new_version}

[bumpversion:file:setup.py]
parse = version\s*=\s*['"](?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)
30 changes: 30 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
[flake8]
max-line-length = 119
per-file-ignores =
# Exclude files that are meant to provide top-level imports
# E402: Module level import not at top of file
# F401: Module imported but unused
sklearn_crfsuite/__init__.py:E402

# Issues pending a review:
ignore =
B017,
D100,
D101,
D102,
D103,
D104,
D105,
D107,
D200,
D205,
D400,
E203,
E501,
E701,
E704,
F401,
W503
exclude =
docs/conf.py
setup.py
22 changes: 22 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: publish
on:
push:
tags:
- "[0-9]+.[0-9]+.[0-9]+"
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install dependencies
run: |
pip install --upgrade build twine
python -m build
- name: Publish to PyPI
uses: pypa/[email protected]
with:
password: ${{ secrets.PYPI_TOKEN }}
53 changes: 53 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: tox
on:
pull_request:
push:
branches: [ main ]
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- python-version: "3.8"
- python-version: "3.9"
- python-version: "3.10"
- python-version: "3.11"
- python-version: "3.12"
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install tox
- name: tox
run: |
tox -e ${{ matrix.toxenv || 'py' }}
- name: coverage
if: ${{ success() }}
run: bash <(curl -s https://codecov.io/bash)
check:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ['3.12']
tox-job: ["pre-commit", "mypy", "twinecheck"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install tox
- name: tox
run: |
tox -e ${{ matrix.tox-job }}
26 changes: 26 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
default_language_version:
python: python3
repos:
- hooks:
- id: black
repo: https://github.com/ambv/black
rev: 24.3.0
- hooks:
- id: isort
repo: https://github.com/PyCQA/isort
rev: 5.13.2
- hooks:
- id: flake8
additional_dependencies:
- flake8-bugbear
- flake8-comprehensions
- flake8-debugger
- flake8-docstrings
- flake8-string-format
repo: https://github.com/pycqa/flake8
rev: 7.0.0
- repo: https://github.com/asottile/pyupgrade
rev: v3.15.2
hooks:
- id: pyupgrade
args: [--py38-plus, --keep-runtime-typing]
Loading

0 comments on commit 90b0878

Please sign in to comment.