-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Draft usage of pixi in ci.yml. * Add names. * Wrap values in quotes. * Convert item to list. * Fix typo. * Add missing action. * Move pchs to pixi. * Fix syntax error. * Add missing tasks. * Fix mypy job. * Bring back mypy pch. * Bring back mypy pch. * Remove redundant dependency. * Adapt readthedocs configuration. * Create docs environment. * Fix docs task. * Update .pre-commit-config.yaml Co-authored-by: Pavel Zwerschke <[email protected]> * Update pixi.toml Co-authored-by: Pavel Zwerschke <[email protected]> * Update .github/workflows/ci.yml Co-authored-by: Pavel Zwerschke <[email protected]> * Update pixi.toml Co-authored-by: Pavel Zwerschke <[email protected]> * Update pixi.toml Co-authored-by: Pavel Zwerschke <[email protected]> * Update lock. * Remove redundant mypy step. * Fix unit test name. * Also update benchmark action. * Fix typo. * Disable Windows tests. * Remove redundant reference to lint environment. * Update .pre-commit-config.yaml Co-authored-by: Pavel Zwerschke <[email protected]> * Update .github/workflows/ci.yml Co-authored-by: Pavel Zwerschke <[email protected]> * Replace license headers. * Replace double quotes by single quotes. --------- Co-authored-by: Pavel Zwerschke <[email protected]>
- Loading branch information
Showing
34 changed files
with
22,791 additions
and
205 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 |
---|---|---|
|
@@ -13,20 +13,14 @@ jobs: | |
name: Run benchmarks | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
- name: Checkout branch | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: main | ||
fetch-depth: 0 | ||
- name: Setup conda | ||
uses: mamba-org/setup-micromamba@v1 | ||
with: | ||
condarc-file: .github/assets/.condarc | ||
environment-file: benchmarks/environment.yml | ||
- name: Install package | ||
run: python -m pip install -e . | ||
- name: Run benchmark.py | ||
run: python benchmarks/benchmark.py | ||
- name: Set up pixi | ||
uses: prefix-dev/[email protected] | ||
- name: Install repository | ||
run: | | ||
pixi run -e default postinstall | ||
pixi run -e default python benchmarks/benchmark.py | ||
- name: Update readme.md | ||
run: | | ||
line_number=`grep "| T-learner" benchmarks/readme.md -n | cut -f1 -d:` | ||
|
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 |
---|---|---|
|
@@ -18,68 +18,41 @@ jobs: | |
steps: | ||
- name: Checkout branch | ||
uses: actions/checkout@v4 | ||
- name: Set up pixi | ||
uses: prefix-dev/[email protected] | ||
with: | ||
ref: ${{ github.head_ref }} | ||
# needed for 'pre-commit-mirrors-insert-license' | ||
fetch-depth: 0 | ||
- name: Run pre-commit-conda | ||
uses: quantco/pre-commit-conda@v1 | ||
|
||
mypy-type-checks: | ||
name: Mypy Type Checks | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout branch | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.head_ref }} | ||
fetch-depth: 0 | ||
- name: Set up Conda env | ||
uses: mamba-org/setup-micromamba@422500192359a097648154e8db4e39bdb6c6eed7 | ||
with: | ||
condarc-file: .github/assets/.condarc | ||
environment-file: environment.yml | ||
cache-environment: true | ||
- name: Install repository | ||
run: python -m pip install --no-build-isolation --no-deps --disable-pip-version-check -e . | ||
- name: Run mypy | ||
run: mypy . | ||
environments: default lint | ||
- name: pre-commit | ||
run: pixi run pre-commit-run --color=always --show-diff-on-failure | ||
|
||
unit-tests: | ||
name: Unit Tests - ${{ matrix.os == 'ubuntu-latest' && 'Linux' || 'Windows' }} - Python ${{ matrix.python-version }} | ||
name: Unit Tests | ||
timeout-minutes: 30 | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest] | ||
python-version: ["3.10", "3.11", "3.12"] | ||
os: [ubuntu-latest, macos-latest] | ||
env: ["py310", "py311", "py312"] | ||
steps: | ||
- name: Checkout branch | ||
uses: actions/checkout@v4 | ||
- name: Set up pixi | ||
uses: prefix-dev/[email protected] | ||
with: | ||
ref: ${{ github.head_ref }} | ||
fetch-depth: 0 | ||
- name: Set up Conda env | ||
uses: mamba-org/setup-micromamba@422500192359a097648154e8db4e39bdb6c6eed7 | ||
with: | ||
condarc-file: .github/assets/.condarc | ||
environment-file: environment.yml | ||
cache-environment: true | ||
create-args: >- | ||
python=${{ matrix.python-version }} | ||
pytest-md | ||
pytest-emoji | ||
environments: ${{ matrix.env }} | ||
- name: Install repository | ||
run: python -m pip install --no-build-isolation --no-deps --disable-pip-version-check -e . | ||
- name: Run unittests | ||
uses: quantco/pytest-action@v2 | ||
run: | | ||
pixi run -e ${{ matrix.env }} postinstall | ||
pixi run -e ${{ matrix.env }} coverage | ||
- name: Generate code coverage report | ||
if: matrix.python-version == '3.12' | ||
uses: codecov/[email protected] | ||
with: | ||
report-title: Unit Tests - ${{ matrix.os == 'ubuntu-latest' && 'Linux' || 'Windows' }} - Python ${{ matrix.python-version }} | ||
custom-arguments: --cov=metalearners --cov-report=xml --cov-report term-missing --color=yes | ||
file: ./coverage.xml | ||
- name: Upload coverage reports to Codecov | ||
if: matrix.python-version == '3.12' | ||
uses: codecov/codecov-action@125fc84a9a348dbcf27191600683ec096ec9021c | ||
if: matrix.env == 'py312' | ||
uses: codecov/codecov-action@v3.1.3 | ||
env: | ||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | ||
file: ./coverage.xml |
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 |
---|---|---|
@@ -1,45 +1,81 @@ | ||
exclude: ^\.pixi | ||
repos: | ||
- repo: https://github.com/Quantco/pre-commit-mirrors-insert-license | ||
rev: 1.3.0 | ||
- repo: local | ||
hooks: | ||
# ensure pixi environments are up to date | ||
# workaround for https://github.com/prefix-dev/pixi/issues/1482 | ||
- id: pixi-install | ||
name: pixi-install | ||
entry: pixi install -e default -e lint | ||
language: system | ||
always_run: true | ||
require_serial: true | ||
pass_filenames: false | ||
- id: insert-license | ||
name: insert-license | ||
entry: pixi run -e lint insert-license | ||
types: [python] | ||
language: system | ||
args: | ||
- --license-base64 | ||
- IyBDb3B5cmlnaHQgKGMpIFF1YW50Q28gMjAyNC0yMDI0CiMgU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IEJTRC0zLUNsYXVzZQo= | ||
- Q29weXJpZ2h0IChjKSBRdWFudENvIDIwMjQtMjAyNApTUERYLUxpY2Vuc2UtSWRlbnRpZmllcjogQlNELTMtQ2xhdXNl | ||
- --dynamic-years | ||
- --comment-style | ||
- "#" | ||
- repo: https://github.com/Quantco/pre-commit-mirrors-docformatter | ||
rev: 1.7.5 | ||
hooks: | ||
- id: docformatter-conda | ||
- repo: https://github.com/Quantco/pre-commit-mirrors-ruff | ||
rev: 0.4.7 | ||
hooks: | ||
- id: ruff-conda | ||
- repo: https://github.com/Quantco/pre-commit-mirrors-black | ||
rev: 24.4.2 | ||
hooks: | ||
- id: docformatter | ||
name: docformatter | ||
entry: pixi run -e lint docformatter | ||
args: [-i] | ||
types: [python] | ||
language: system | ||
- id: ruff | ||
name: ruff | ||
entry: pixi run -e lint ruff check --fix --exit-non-zero-on-fix --force-exclude | ||
language: system | ||
types_or: [python, pyi] | ||
require_serial: true | ||
- id: black-conda | ||
- repo: https://github.com/Quantco/pre-commit-mirrors-mypy | ||
rev: 1.10.0 | ||
hooks: | ||
- id: mypy-conda | ||
additional_dependencies: [-c, conda-forge, types-setuptools] | ||
- repo: https://github.com/Quantco/pre-commit-mirrors-prettier | ||
rev: 3.2.5 | ||
hooks: | ||
- id: prettier-conda | ||
name: black-conda | ||
entry: pixi run -e lint black | ||
language: system | ||
require_serial: true | ||
types: [python] | ||
- id: mypy | ||
name: mypy | ||
entry: pixi run -e default mypy | ||
language: system | ||
types: [python] | ||
args: ["--ignore-missing-imports", "--scripts-are-modules"] | ||
require_serial: true | ||
- id: prettier | ||
name: prettier | ||
entry: pixi run -e lint prettier | ||
language: system | ||
files: \.(md|yml|yaml)$ | ||
- repo: https://github.com/Quantco/pre-commit-mirrors-pre-commit-hooks | ||
rev: 4.6.0 | ||
hooks: | ||
- id: trailing-whitespace-conda | ||
- id: end-of-file-fixer-conda | ||
- id: check-merge-conflict-conda | ||
types: [text] | ||
args: ["--write", "--list-different", "--ignore-unknown"] | ||
- id: trailing-whitespace | ||
name: trim trailing whitespace | ||
language: system | ||
entry: pixi run -e lint trailing-whitespace-fixer | ||
types: [text] | ||
stages: [commit, push, manual] | ||
- id: end-of-file-fixer | ||
name: fix end of files | ||
language: system | ||
entry: pixi run -e lint end-of-file-fixer | ||
types: [text] | ||
stages: [commit, push, manual] | ||
- id: check-merge-conflict | ||
name: check for merge conflicts | ||
language: system | ||
entry: pixi run -e lint check-merge-conflict | ||
types: [text] | ||
args: ["--assume-in-merge"] | ||
- repo: https://github.com/Quantco/pre-commit-mirrors-typos | ||
rev: 1.21.0 | ||
hooks: | ||
- id: typos-conda | ||
- id: typos | ||
name: typos | ||
entry: pixi run -e lint typos --force-exclude | ||
language: system | ||
types: [text] | ||
exclude: "\\.csv$" | ||
require_serial: 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
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
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
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
This file was deleted.
Oops, something went wrong.
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
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
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
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
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
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
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
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
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
Oops, something went wrong.