Skip to content

Commit

Permalink
Renovations, 2024-10 (#12)
Browse files Browse the repository at this point in the history
* Refresh license
* Update pre-commit tools; use ruff for formatting
* Upgrade CI bits; separate build step
  • Loading branch information
akx authored Oct 31, 2024
1 parent d5710e4 commit 37e2218
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 37 deletions.
55 changes: 33 additions & 22 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,50 +1,61 @@
name: CI
'on':
"on":
push:
branches:
- master
tags:
- 'v*'
- "v*"
pull_request:
branches:
- master
jobs:
Build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.13"
- uses: astral-sh/[email protected]
- run: uv build .
- uses: actions/upload-artifact@v4
with:
name: dist
path: dist/
Test:
runs-on: '${{ matrix.os }}'
runs-on: "${{ matrix.os }}"
strategy:
matrix:
os:
- ubuntu-22.04
python-version:
- '3.7'
- '3.8'
- '3.9'
- '3.10'
- "3.7"
- "3.8"
- "3.9"
- "3.10"
- "3.11"
- "3.12"
- "3.13"
steps:
- uses: actions/checkout@v3
- name: 'Set up Python ${{ matrix.python-version }}'
uses: actions/setup-python@v4
- uses: actions/checkout@v4
- name: "Set up Python ${{ matrix.python-version }}"
uses: actions/setup-python@v5
with:
python-version: '${{ matrix.python-version }}'
python-version: "${{ matrix.python-version }}"
- run: pip install -U build pytest pytest-cov
- run: py.test -vvv --cov .
- run: python -m build .
- uses: actions/upload-artifact@v3
with:
name: dist
path: dist/
Lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- uses: pre-commit/[email protected].0
python-version: "3.13"
- uses: pre-commit/[email protected].1
Publish:
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
needs:
- Test
- Build
name: Upload release to PyPI
runs-on: ubuntu-latest
environment:
Expand All @@ -53,7 +64,7 @@ jobs:
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: dist
path: dist/
Expand Down
13 changes: 5 additions & 8 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,21 @@ minimum_pre_commit_version: 2.15.0
ci:
autofix_prs: false
repos:
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.0.272
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.7.1
hooks:
- id: ruff
args:
- --fix
- repo: https://github.com/psf/black
rev: 23.3.0
hooks:
- id: black
- id: ruff-format
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v5.0.0
hooks:
- id: debug-statements
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.3.0
rev: v1.13.0
hooks:
- id: mypy
additional_dependencies:
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

The MIT License (MIT)

Copyright (c) 2021 Valohai
Copyright (c) 2021-2024 Valohai

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
10 changes: 4 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ name = "gitignorant"
dynamic = ["version"]
description = "A parser for gitignore files"
readme = "README.md"
license = ""
license = "MIT"
requires-python = ">=3.7"
authors = [
{ name = "Aarni Koskela", email = "[email protected]" },
Expand All @@ -33,8 +33,6 @@ include = [
[tool.ruff]
ignore = []
line-length = 88
select = [
"E",
"F",
"W",
]

[tool.ruff.lint]
select = ["E", "F", "W"]

0 comments on commit 37e2218

Please sign in to comment.