-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from andnp/main
chore: setup project infrastructure
- Loading branch information
Showing
8 changed files
with
234 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# To get started with Dependabot version updates, you'll need to specify which | ||
# package ecosystems to update and where the package manifests are located. | ||
# Please see the documentation for all configuration options: | ||
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file | ||
|
||
version: 2 | ||
updates: | ||
- package-ecosystem: "pip" # See documentation for possible values | ||
directory: "/" # Location of package manifests | ||
schedule: | ||
interval: "weekly" | ||
|
||
groups: | ||
python-deps: | ||
applies-to: version-updates | ||
patterns: | ||
- "*" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: Benchmark | ||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
permissions: | ||
contents: write | ||
deployments: write | ||
|
||
jobs: | ||
benchmark: | ||
name: Run pytest-benchmark | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Python 3.11 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.11" | ||
cache: 'pip' | ||
|
||
- name: Run benchmark | ||
run: | | ||
python -m venv .venv | ||
source .venv/bin/activate | ||
pip install uv | ||
uv pip compile --extra=dev pyproject.toml -o requirements.txt | ||
uv pip sync requirements.txt | ||
echo PATH=$PATH >> $GITHUB_ENV | ||
pytest --benchmark-json output.json | ||
- name: Store benchmark result | ||
uses: benchmark-action/github-action-benchmark@v1 | ||
with: | ||
name: Python Benchmark with pytest-benchmark | ||
tool: 'pytest' | ||
output-file-path: output.json | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
auto-push: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: Benchmark | ||
on: | ||
pull_request: | ||
branches: [ main ] | ||
|
||
jobs: | ||
benchmark: | ||
name: Run pytest-benchmark | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Python 3.11 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.11" | ||
cache: 'pip' | ||
|
||
- name: Run benchmark | ||
run: | | ||
python -m venv .venv | ||
source .venv/bin/activate | ||
pip install uv | ||
uv pip compile --extra=dev pyproject.toml -o requirements.txt | ||
uv pip sync requirements.txt | ||
echo PATH=$PATH >> $GITHUB_ENV | ||
pytest --benchmark-json output.json | ||
- name: Store benchmark result | ||
uses: benchmark-action/github-action-benchmark@v1 | ||
with: | ||
name: Python Benchmark with pytest-benchmark | ||
tool: 'pytest' | ||
output-file-path: output.json | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
alert-threshold: '130%' | ||
comment-on-alert: true | ||
summary-always: true | ||
fail-on-alert: true | ||
alert-comment-cc-users: '@andnp' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: Style | ||
|
||
on: | ||
pull_request: | ||
branches: [ main ] | ||
|
||
jobs: | ||
check: | ||
runs-on: ubuntu-latest | ||
steps: | ||
# setup the repository | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
cache: 'pip' | ||
|
||
- run: | | ||
python -m venv .venv | ||
source .venv/bin/activate | ||
pip install uv | ||
uv pip compile --extra=dev pyproject.toml -o requirements.txt | ||
uv pip sync requirements.txt | ||
- run: echo "$PWD/.venv/bin" >> $GITHUB_PATH | ||
|
||
# linting | ||
- uses: chartboost/ruff-action@v1 | ||
|
||
# type checking | ||
- uses: jakebailey/pyright-action@v2 | ||
with: | ||
pylance-version: latest-release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: PR Tests | ||
|
||
on: | ||
pull_request: | ||
branches: [ main ] | ||
|
||
jobs: | ||
test: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, macos-latest] | ||
python-version: ["3.10", "3.11", "3.12"] | ||
|
||
steps: | ||
# setup the repository | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
cache: 'pip' | ||
|
||
- run: | | ||
python -m venv .venv | ||
source .venv/bin/activate | ||
pip install uv | ||
uv pip compile --extra=dev pyproject.toml -o requirements.txt | ||
uv pip sync requirements.txt | ||
- run: echo "$PWD/.venv/bin" >> $GITHUB_PATH | ||
|
||
- run: pytest tests/ --junitxml=junit/test-results-${{ matrix.os }}-${{ matrix.python-version }}.xml --cov=recommence --cov-report=html:coverage/cov-${{ matrix.os }}-${{ matrix.python-version }}.html | ||
|
||
- name: Upload pytest test results | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: pytest-results-${{ matrix.os }}-${{ matrix.python-version }} | ||
path: | | ||
junit/test-results-${{ matrix.os }}-${{ matrix.python-version }}.xml | ||
coverage/cov-${{ matrix.os }}-${{ matrix.python-version }}.html | ||
# Use always() to always run this step to publish test results when there are test failures | ||
if: ${{ always() }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
requirements.txt | ||
.python-version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
repos: | ||
- repo: https://github.com/commitizen-tools/commitizen | ||
rev: v2.21.2 | ||
hooks: | ||
- id: commitizen | ||
stages: | ||
- commit-msg | ||
- repo: https://github.com/astral-sh/ruff-pre-commit | ||
# Ruff version. | ||
rev: v0.2.2 | ||
hooks: | ||
# Run the linter. | ||
- id: ruff |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
[tool] | ||
[tool.commitizen] | ||
name = "cz_conventional_commits" | ||
version = "0.0.0" | ||
tag_format = "$version" | ||
version_files = ["pyproject.toml"] | ||
|
||
[tool.ruff.lint] | ||
select = ['F', 'E', 'W', 'B'] | ||
ignore = ['E501', 'E701'] | ||
|
||
[tool.pyright] | ||
include = ['ml-experiment-definition'] | ||
venvPath = '.' | ||
venv = '.venv' | ||
typeCheckingMode = 'standard' | ||
useLibraryCodeForTypes = true | ||
|
||
[project] | ||
name = "ml-experiment-definition" | ||
version = "0.0.0" | ||
description = "" | ||
authors = [ | ||
{name = "Parham Panahi", email = "[email protected]"}, | ||
{name = "Andy Patterson", email = "[email protected]"}, | ||
] | ||
dependencies = [] | ||
requires-python = ">=3.10,<3.13" | ||
readme = "README.md" | ||
license = {text = "MIT"} | ||
|
||
classifiers = [ | ||
"Programming Language :: Python :: Implementation :: CPython", | ||
"Programming Language :: Python :: Implementation :: PyPy", | ||
] | ||
|
||
[project.optional-dependencies] | ||
dev = [ | ||
"pip", | ||
"ruff", | ||
"pytest", | ||
"pytest-cov", | ||
"pyright", | ||
"commitizen", | ||
"pre-commit", | ||
] |