Skip to content

Commit a61e6ba

Browse files
committed
Initial commit
0 parents  commit a61e6ba

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+26246
-0
lines changed

.copier-answers.yml

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# This file is managed by Copier; DO NOT EDIT OR REMOVE.
2+
_commit: v0.1.0
3+
_src_path: https://github.com/quantco/copier-template-python-open-source
4+
add_autobump_workflow: true
5+
github_url: https://github.com/quantco/tabulardelta
6+
github_user: AaronTackeQC
7+
minimal_python_version: py311
8+
project_name: TabularDelta
9+
project_short_description: Simplify table comparisons.
10+
project_slug: tabulardelta
11+
use_devcontainer: false

.gitattributes

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
* text=auto
2+
3+
*.{diff,patch} binary
4+
5+
*.{py,yaml,yml,sh} text eol=lf
6+
*.bat text eol=crlf
7+
8+
pixi.lock linguist-language=YAML linguist-generated=true

.github/CODEOWNERS

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @AaronTackeQC

.github/PULL_REQUEST_TEMPLATE.md

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Motivation
2+
3+
<!-- Why is this change necessary? Link issues here if applicable. -->
4+
5+
# Changes
6+
7+
<!-- What changes have been performed? -->
+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: Launch MSSQL on GitHub Linux VMs
2+
3+
runs:
4+
using: composite
5+
steps:
6+
- name: Cache connection details
7+
shell: bash -el {0}
8+
run: echo '{"project_name":"","port":1434,"docker_compose_file":"","cache_file":""}' > ./tests/mssql_container/.mssql_container_cache.json
9+
- name: Login to GHCR
10+
shell: bash -el {0}
11+
run: docker login ghcr.io -u ${{ github.actor }} -p ${{ github.token }}
12+
- name: Launch MSSQL
13+
shell: bash -el {0}
14+
run: |
15+
docker compose -f ./tests/mssql_container/docker-compose.yml up -d
+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Launch MSSQL on GitHub Windows VMs
2+
3+
runs:
4+
using: composite
5+
steps:
6+
- name: Cache connection details
7+
shell: bash -el {0}
8+
run: echo '{"project_name":"","port":null,"docker_compose_file":"","cache_file":""}' > ./tests/mssql_container/.mssql_container_cache.json
9+
- name: Start SQL Server LocalDB
10+
shell: bash -el {0}
11+
run: |
12+
SqlLocalDB.exe create "SQLLocalDB"
13+
SqlLocalDB.exe share "SQLLocalDB" "MSSQLLocalDB"
14+
SqlLocalDB.exe start "SQLLocalDB"
15+
- name: Establish login for SQL Server LocalDB
16+
shell: bash -el {0}
17+
run: |
18+
CONN_STR=$(
19+
SqlLocalDB.exe info "SQLLocalDB" \
20+
| grep "Instance pipe name:" \
21+
| sed 's/^Instance pipe name: \(.*\)$/\1/'
22+
)
23+
CREATE_USER_QUERY=$(
24+
cat <<EOF
25+
ALTER LOGIN sa ENABLE;
26+
GO
27+
ALTER LOGIN sa WITH PASSWORD = 'Passw0rd' UNLOCK;
28+
GO
29+
EXIT
30+
EOF
31+
)
32+
sqlcmd -b -j -S "$CONN_STR" -Q "$CREATE_USER_QUERY"

.github/dependabot.yml

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: github-actions
4+
directory: /
5+
schedule:
6+
interval: monthly
7+
groups:
8+
gh-actions:
9+
patterns:
10+
- "*"

.github/release-drafter.yml

+100
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
# ------------------------------------- PULL REQUEST LABELS ------------------------------------- #
2+
autolabeler:
3+
# Conventional Commit Types (https://github.com/commitizen/conventional-commit-types)
4+
- label: build
5+
title:
6+
- '/^build(\(.*\))?(\!)?\:/'
7+
- label: chore
8+
title:
9+
- '/^chore(\(.*\))?(\!)?\:/'
10+
- label: ci
11+
title:
12+
- '/^ci(\(.*\))?(\!)?\:/'
13+
- label: documentation
14+
title:
15+
- '/^docs(\(.*\))?(\!)?\:/'
16+
- label: enhancement
17+
title:
18+
- '/^feat(\(.*\))?(\!)?\:/'
19+
- label: fix
20+
title:
21+
- '/^fix(\(.*\))?(\!)?\:/'
22+
- label: performance
23+
title:
24+
- '/^perf(\(.*\))?(\!)?\:/'
25+
- label: refactor
26+
title:
27+
- '/^refactor(\(.*\))?(\!)?\:/'
28+
- label: revert
29+
title:
30+
- '/^revert(\(.*\))?(\!)?\:/'
31+
- label: style
32+
title:
33+
- '/^style(\(.*\))?(\!)?\:/'
34+
- label: test
35+
title:
36+
- '/^test(\(.*\))?(\!)?\:/'
37+
# Custom Types
38+
- label: breaking
39+
title:
40+
- '/^[a-z]+(\(.*\))?\!\:/'
41+
# ------------------------------------- AUTOMATIC VERSIONING ------------------------------------ #
42+
version-resolver:
43+
major:
44+
labels:
45+
- breaking
46+
minor:
47+
labels:
48+
- enhancement
49+
default: patch
50+
# ------------------------------------ RELEASE CONFIGURATION ------------------------------------ #
51+
name-template: "v$RESOLVED_VERSION"
52+
tag-template: "v$RESOLVED_VERSION"
53+
category-template: "### $TITLE"
54+
change-template: "- $TITLE by @$AUTHOR in [#$NUMBER]($URL)"
55+
replacers:
56+
# remove conventional commit tag & scope from change list
57+
- search: '/- [a-z]+(\(.*\))?(\!)?\: /g'
58+
replace: "- "
59+
template: |
60+
## What's Changed
61+
62+
$CHANGES
63+
64+
categories:
65+
- title: ⚠️ Breaking Changes
66+
labels:
67+
- breaking
68+
- title: ✨ New Features
69+
labels:
70+
- enhancement
71+
- title: 🐞 Bug Fixes
72+
labels:
73+
- fix
74+
- title: 🏎️ Performance Improvements
75+
labels:
76+
- performance
77+
- title: 📚 Documentation
78+
labels:
79+
- documentation
80+
- title: 🏗️ Testing
81+
labels:
82+
- test
83+
- title: ⚙️ Automation
84+
labels:
85+
- ci
86+
- title: 🛠 Builds
87+
labels:
88+
- build
89+
- title: 💎 Code Style
90+
labels:
91+
- style
92+
- title: 📦 Refactorings
93+
labels:
94+
- refactor
95+
- title: ♻️ Chores
96+
labels:
97+
- chore
98+
- title: 🗑 Reverts
99+
labels:
100+
- revert

.github/workflows/build.yml

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Build
2+
on:
3+
pull_request:
4+
push:
5+
branches:
6+
- main
7+
tags:
8+
- "*"
9+
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
with:
16+
ref: ${{ github.ref }}
17+
fetch-depth: 0
18+
- name: Set up pixi
19+
uses: prefix-dev/setup-pixi@ba3bb36eb2066252b2363392b7739741bb777659
20+
with:
21+
environments: build
22+
- name: Build project
23+
run: pixi run -e build build-wheel
24+
- name: Check build artifact
25+
run: pixi run -e build twine-check
26+
- name: Upload package
27+
uses: actions/upload-artifact@v4
28+
with:
29+
name: artifact
30+
path: dist/*
31+
32+
release:
33+
name: Publish package
34+
if: startsWith(github.ref, 'refs/tags/')
35+
needs: [build]
36+
runs-on: ubuntu-latest
37+
permissions:
38+
id-token: write
39+
environment: pypi
40+
steps:
41+
- uses: actions/download-artifact@v4
42+
with:
43+
name: artifact
44+
path: dist
45+
- name: Publish package on PyPi
46+
uses: pypa/gh-action-pypi-publish@ec4db0b4ddc65acdf4bff5fa45ac92d78b56bdf0

.github/workflows/chore.yml

+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: Chore
2+
on:
3+
pull_request:
4+
branches: [main]
5+
types: [opened, reopened, edited, synchronize]
6+
push:
7+
branches: [main]
8+
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
12+
13+
jobs:
14+
check-pr-title:
15+
name: Check PR Title
16+
if: github.event_name == 'pull_request'
17+
runs-on: ubuntu-latest
18+
permissions:
19+
contents: read
20+
pull-requests: write
21+
steps:
22+
- name: Check valid conventional commit message
23+
id: lint
24+
uses: amannn/action-semantic-pull-request@v5
25+
with:
26+
subjectPattern: ^[A-Z].+[^. ]$ # subject must start with uppercase letter and may not end with a dot/space
27+
env:
28+
GITHUB_TOKEN: ${{ github.token }}
29+
- name: Post comment about invalid PR title
30+
if: failure()
31+
uses: marocchino/sticky-pull-request-comment@v2
32+
with:
33+
header: conventional-commit-pr-title
34+
message: |
35+
Thank you for opening this pull request! 👋🏼
36+
37+
This repository requires pull request titles to follow the [Conventional Commits specification](https://www.conventionalcommits.org/en/v1.0.0/) and it looks like your proposed title needs to be adjusted.
38+
39+
<details><summary><b>Details</b></summary>
40+
41+
```
42+
${{ steps.lint.outputs.error_message }}
43+
```
44+
45+
</details>
46+
- name: Delete comment about invalid PR title
47+
if: success()
48+
uses: marocchino/sticky-pull-request-comment@v2
49+
with:
50+
header: conventional-commit-pr-title
51+
delete: true
52+
53+
release-drafter:
54+
name: ${{ github.event_name == 'pull_request' && 'Assign Labels' || 'Draft Release' }}
55+
runs-on: ubuntu-latest
56+
permissions:
57+
contents: write
58+
pull-requests: write
59+
steps:
60+
- name: ${{ github.event_name == 'pull_request' && 'Assign labels' || 'Update release draft' }}
61+
uses: release-drafter/release-drafter@v6
62+
with:
63+
disable-releaser: ${{ github.event_name == 'pull_request' }}
64+
disable-autolabeler: ${{ github.event_name == 'push' }}
65+
env:
66+
GITHUB_TOKEN: ${{ github.token }}

.github/workflows/ci.yml

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: CI
2+
on: [push]
3+
4+
# Automatically stop old builds on the same branch/PR
5+
concurrency:
6+
group: ${{ github.workflow }}-${{ github.ref }}
7+
cancel-in-progress: true
8+
9+
jobs:
10+
pre-commit:
11+
timeout-minutes: 30
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout branch
15+
uses: actions/checkout@v4
16+
- name: Set up pixi
17+
uses: prefix-dev/setup-pixi@ba3bb36eb2066252b2363392b7739741bb777659
18+
with:
19+
environments: default lint
20+
- name: pre-commit
21+
run: pixi run pre-commit-run --color=always --show-diff-on-failure
22+
23+
unit-tests:
24+
name: pytest
25+
timeout-minutes: 30
26+
runs-on: ${{ matrix.os }}
27+
strategy:
28+
fail-fast: false
29+
matrix:
30+
environment:
31+
- py311
32+
- py312
33+
- no-sql
34+
os:
35+
- ubuntu-latest
36+
- windows-latest
37+
steps:
38+
- name: Checkout branch
39+
uses: actions/checkout@v4
40+
with:
41+
fetch-depth: 0
42+
- name: Install msodbcsql17 (Linux Only)
43+
if: ${{ matrix.environment != 'no-sql' && matrix.os == 'ubuntu-latest' }}
44+
run: sudo ACCEPT_EULA=Y apt-get install msodbcsql17 -y
45+
- name: Launch MSSQL (Linux Only)
46+
if: ${{ matrix.environment != 'no-sql' && matrix.os == 'ubuntu-latest' }}
47+
uses: ./.github/actions/mssql-linux
48+
- name: Launch MSSQL (Windows Only)
49+
if: ${{ matrix.environment != 'no-sql' && matrix.os == 'windows-latest' }}
50+
uses: ./.github/actions/mssql-windows
51+
- name: Set up pixi
52+
uses: prefix-dev/setup-pixi@ba3bb36eb2066252b2363392b7739741bb777659
53+
with:
54+
environments: ${{ matrix.environment }}
55+
- name: Install repository
56+
run: pixi run -e ${{ matrix.environment }} postinstall
57+
- name: Run pytest
58+
run: pixi run -e ${{ matrix.environment }} test-coverage --color=yes ${{ matrix.environment=='no-sql' && '-m "not sql"' || ''}}

0 commit comments

Comments
 (0)