Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate to copier template #61

Merged
merged 10 commits into from
Jul 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .copier-answers.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# This file is managed by Copier; DO NOT EDIT OR REMOVE.
_commit: v0.1.0-2-g162001d
_src_path: https://github.com/quantco/copier-template-python-open-source
add_autobump_workflow: false
author_email: [email protected]
author_name: QuantCo, Inc.
github_url: https://github.com/quantco/multiregex
github_user: pavelzw
minimal_python_version: py38
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
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:
- "*"
9 changes: 4 additions & 5 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 @@ -13,10 +13,9 @@ jobs:
steps:
- 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: build
- name: Build project
Expand All @@ -41,8 +40,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
69 changes: 32 additions & 37 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,60 +1,55 @@
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/setup-pixi@v0.8.1
uses: prefix-dev/setup-pixi@ba3bb36eb2066252b2363392b7739741bb777659
with:
environments: ${{ matrix.environment }}
- name: Install repository
run: pixi run -e ${{ matrix.environment }} postinstall
- name: Run unittests
uses: quantco/pytest-action@v2
with:
report-title: Unit tests ${{ matrix.environment }}
custom-pytest: pixi run -e ${{ matrix.environment }} pytest
environments: default lint
- name: pre-commit
run: pixi run pre-commit-run --color=always --show-diff-on-failure

pre-commit-checks:
name: Pre-commit Checks
pytest:
timeout-minutes: 30
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
environment:
- py38
- py39
- py310
- py311
- py312
os:
- ubuntu-latest
- macos-latest
- windows-latest
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