Skip to content

Commit

Permalink
Migrate to copier template
Browse files Browse the repository at this point in the history
  • Loading branch information
pavelzw committed Jul 12, 2024
1 parent 4089cd4 commit 6e0efa5
Show file tree
Hide file tree
Showing 13 changed files with 409 additions and 139 deletions.
12 changes: 12 additions & 0 deletions .copier-answers.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# This file is managed by Copier; DO NOT EDIT OR REMOVE.
_commit: v0.1.0
_src_path: https://github.com/quantco/copier-template-python-open-source
add_autobump_workflow: false
github_url: https://github.com/quantco/multiregex
github_user: pavelzw
minimal_python_version: py38
project_name: multiregex
project_short_description: Quickly match many regexes against a string. Provides 2-10x
speedups over naïve regex matching.
project_slug: multiregex
use_devcontainer: false
7 changes: 0 additions & 7 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,8 +1 @@
* text=auto

*.{diff,patch} binary

*.{py,yaml,yml,sh} text eol=lf
*.bat text eol=crlf
# GitHub syntax highlighting
pixi.lock linguist-language=YAML linguist-generated=true
3 changes: 1 addition & 2 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
* @0xbe7a
* @pavelzw
* @0xbe7a @pavelzw
10 changes: 7 additions & 3 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
- package-ecosystem: github-actions
directory: /
schedule:
interval: "weekly"
interval: monthly
reviewers:
- "quantco/ci"
groups:
gh-actions:
patterns:
- "*"
8 changes: 4 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ on:
pull_request:
push:
branches:
- "main"
- main
tags:
- "*"

Expand All @@ -16,7 +16,7 @@ jobs:
ref: ${{ github.ref }}
fetch-depth: 0
- name: Set up pixi
uses: prefix-dev/setup-pixi@v0.8.1
uses: prefix-dev/setup-pixi@ba3bb36eb2066252b2363392b7739741bb777659
with:
environments: build
- name: Build project
Expand All @@ -41,8 +41,8 @@ jobs:
name: artifact
path: dist
- name: Publish package on TestPyPi
uses: pypa/gh-action-pypi-publish@ec4db0b4ddc65acdf4bff5fa45ac92d78b56bdf0
uses: pypa/gh-action-pypi-publish@81e9d935c883d0b210363ab89cf05f3894778450
with:
repository-url: https://test.pypi.org/legacy/
- name: Publish package on PyPi
uses: pypa/gh-action-pypi-publish@ec4db0b4ddc65acdf4bff5fa45ac92d78b56bdf0
uses: pypa/gh-action-pypi-publish@81e9d935c883d0b210363ab89cf05f3894778450
70 changes: 32 additions & 38 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,60 +1,54 @@
name: CI
on:
pull_request:
push:
branches:
- main
pull_request:

defaults:
run:
shell: bash -el {0}
# Automatically stop old builds on the same branch/PR
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
unit-tests:
name: pytest
timeout-minutes: 10
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- { os: ubuntu-latest, environment: py38 }
- { os: ubuntu-latest, environment: py312 }
- { os: windows-latest, environment: py38 }
- { os: windows-latest, environment: py312 }
- { os: macos-latest, environment: py38 }
- { os: macos-latest, environment: py312 }
pre-commit:
timeout-minutes: 30
runs-on: ubuntu-latest
steps:
- name: Checkout branch
uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
fetch-depth: 0
- name: Set up pixi
uses: prefix-dev/[email protected]
with:
environments: ${{ matrix.environment }}
- name: Install repository
run: pixi run -e ${{ matrix.environment }} postinstall
- name: Run unittests
uses: quantco/pytest-action@v2
uses: prefix-dev/setup-pixi@ba3bb36eb2066252b2363392b7739741bb777659
with:
report-title: Unit tests ${{ matrix.environment }}
custom-pytest: pixi run -e ${{ matrix.environment }} pytest

pre-commit-checks:
name: Pre-commit Checks
environments: default lint
- name: pre-commit
run: pixi run pre-commit-run --color=always --show-diff-on-failure
pytest:
timeout-minutes: 30
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- windows-latest
- macos-latest
environment:
- py38
- py39
- py310
- py311
- py312
steps:
- name: Checkout branch
uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
fetch-depth: 0
- name: Set up pixi
uses: prefix-dev/setup-pixi@v0.8.1
uses: prefix-dev/setup-pixi@ba3bb36eb2066252b2363392b7739741bb777659
with:
environments: lint default
- name: pre-commit
run: pixi run pre-commit-run --color=always --show-diff-on-failure
environments: ${{ matrix.environment }}
- name: Install repository
run: pixi run -e ${{ matrix.environment }} postinstall
- name: Run pytest
run: pixi run -e ${{ matrix.environment }} test-coverage --color=yes
Loading

0 comments on commit 6e0efa5

Please sign in to comment.