Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxHalford committed Sep 22, 2024
1 parent 82dd89a commit 5eb46a0
Show file tree
Hide file tree
Showing 11 changed files with 515 additions and 219 deletions.
45 changes: 45 additions & 0 deletions .github/actions/install-env.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Install Python env

runs:
using: "composite"
steps:
- name: Check out repository
uses: actions/checkout@v3

- name: Set up python
id: setup-python
uses: actions/setup-python@v5
with:
python-version: "3.11"

- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v4
with:
path: .venv
key: venv-${{ runner.os }}-${{ hashFiles('poetry.lock') }}-${{ hashFiles('.github/actions/install-env/action.yml') }}-${{ steps.setup-python.outputs.python-version }}

- name: Load cached .local
id: cached-dotlocal
uses: actions/cache@v4
with:
path: ~/.local
key: dotlocal-${{ runner.os }}-${{ hashFiles('.github/actions/install-env/action.yml') }}-${{ steps.setup-python.outputs.python-version }}

- name: Install Python poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
virtualenvs-path: .venv
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'

- name: Install dependencies
shell: bash
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction

- name: Activate environment
shell: bash
run: source .venv/bin/activate
18 changes: 18 additions & 0 deletions .github/workflows/code-quality.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Code quality

on:
pull_request:
branches:
- "*"
push:
branches:
- main

jobs:
run:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/install-env
- name: Run pre-commit on all files
run: poetry run pre-commit run --all-files
31 changes: 0 additions & 31 deletions .github/workflows/docs.yml

This file was deleted.

17 changes: 17 additions & 0 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Unit tests

on:
pull_request:
branches:
- "*"
push:
branches:
- main

jobs:
run:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/install-env
- run: poetry run pytest
38 changes: 38 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
files: icanexplain
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-json
- id: check-yaml

- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.5.7
hooks:
# Run the linter.
- id: ruff
types_or: [python, pyi, jupyter]
args: [--fix]
# Run the formatter.
- id: ruff-format
types_or: [python, pyi, jupyter]

- repo: https://github.com/pre-commit/mirrors-mypy
rev: "v1.1.1"
hooks:
- id: mypy
args:
- "--config-file=pyproject.toml"
- "--python-version=3.11"
additional_dependencies:
- pandera[mypy]
- types-python-slugify
- types-paramiko
- types-requests

# strip output from jupyter notebooks
- repo: https://github.com/kynan/nbstripout
rev: 0.7.1
hooks:
- id: nbstripout
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# icanexplain ~ explain why metrics change
# icanexplain

_Explain why metrics change by unpacking them_

This library is here to help with the difficult task of explaining why a metric changes. It's particularly useful for analysts, data scientists, analytics engineers, and business intelligence professionals who need to understand the drivers of a metric's change.

Expand Down
Loading

0 comments on commit 5eb46a0

Please sign in to comment.