Skip to content

Commit

Permalink
Change dependency manager to poetry 🖤
Browse files Browse the repository at this point in the history
  • Loading branch information
Markus Bilz committed Oct 27, 2023
1 parent 975c468 commit 748a2dc
Show file tree
Hide file tree
Showing 53 changed files with 13,675 additions and 13,729 deletions.
114 changes: 57 additions & 57 deletions .github/workflows/action_python.yaml
Original file line number Diff line number Diff line change
@@ -1,57 +1,57 @@
name: Python package

on:
push:
paths:
- 'src/**'

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Create application default credentials
run: |
mkdir -p $HOME/.config/gcloud/
echo "$APP_CRED" >> $HOME/.config/gcloud/application_default_credentials.json
chmod 600 $HOME/.config/gcloud/application_default_credentials.json
shell: bash
env:
APP_CRED: ${{secrets.APPLICATION_DEFAULT_CREDENTIALS}}
- name: Set up wandb api key
run: |
echo "$WANDB_API_KEY" >> $HOME/.netrc
chmod 600 $HOME/.netrc
shell: bash
env:
WANDB_API_KEY: ${{secrets.WANDB_API_KEY}}
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .
pip install .[dev]
- name: Test with pytest
run: |
pytest --cov=src tests/ --doctest-modules --junitxml=cover/xunit-result.xml --cov-report xml:cover/coverage.xml
# convert to json
coverage json -o cover/coverage.json
- name: "Extract numbers from cov report"
run: |
export TOTAL=$(python -c "import json;print(json.load(open('cover/coverage.json'))['totals']['percent_covered_display'])")
echo "total=$TOTAL" >> $GITHUB_ENV
echo "### Total coverage: ${TOTAL}%" >> $GITHUB_STEP_SUMMARY
- name: "Make badge"
uses: schneegans/[email protected]
with:
auth: ${{ secrets.GIST_TOKEN }}
gistID: e2578f2f3e6322d299f1cb2e294d6b0b
filename: covbadge.json
label: Coverage
message: ${{ env.total }}%
minColorRange: 50
maxColorRange: 90
valColorRange: ${{ env.total }}
name: Python package

on:
push:
paths:
- 'src/**'

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Create application default credentials
run: |
mkdir -p $HOME/.config/gcloud/
echo "$APP_CRED" >> $HOME/.config/gcloud/application_default_credentials.json
chmod 600 $HOME/.config/gcloud/application_default_credentials.json
shell: bash
env:
APP_CRED: ${{secrets.APPLICATION_DEFAULT_CREDENTIALS}}
- name: Set up wandb api key
run: |
echo "$WANDB_API_KEY" >> $HOME/.netrc
chmod 600 $HOME/.netrc
shell: bash
env:
WANDB_API_KEY: ${{secrets.WANDB_API_KEY}}
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .
pip install .[dev]
- name: Test with pytest
run: |
pytest --cov=src tests/ --doctest-modules --junitxml=cover/xunit-result.xml --cov-report xml:cover/coverage.xml
# convert to json
coverage json -o cover/coverage.json
- name: "Extract numbers from cov report"
run: |
export TOTAL=$(python -c "import json;print(json.load(open('cover/coverage.json'))['totals']['percent_covered_display'])")
echo "total=$TOTAL" >> $GITHUB_ENV
echo "### Total coverage: ${TOTAL}%" >> $GITHUB_STEP_SUMMARY
- name: "Make badge"
uses: schneegans/[email protected]
with:
auth: ${{ secrets.GIST_TOKEN }}
gistID: e2578f2f3e6322d299f1cb2e294d6b0b
filename: covbadge.json
label: Coverage
message: ${{ env.total }}%
minColorRange: 50
maxColorRange: 90
valColorRange: ${{ env.total }}
92 changes: 42 additions & 50 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,50 +1,42 @@
---
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/kynan/nbstripout
rev: 0.6.1
hooks:
- id: nbstripout
- repo: https://github.com/cmhughes/latexindent.pl.git
rev: V3.19.1
hooks:
- id: latexindent
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
hooks:
- id: trailing-whitespace
- id: check-added-large-files
- id: check-builtin-literals
- id: check-byte-order-marker
- id: check-merge-conflict
- id: check-symlinks
- id: check-toml
- id: check-yaml
- id: debug-statements
- id: end-of-file-fixer
- id: mixed-line-ending
- id: trailing-whitespace
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.991
hooks:
- id: mypy
# yaml requires additional stubs.
# Similar to: https://stackoverflow.com/a/73603491/5755604
additional_dependencies: ['types-PyYAML']
- repo: https://github.com/psf/black.git
rev: 22.10.0
hooks:
- id: black
exclude: ^(docs)
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.0.284
hooks:
- id: ruff
args:
- --fix
- repo: https://github.com/kynan/nbstripout
rev: 0.6.0
hooks:
- id: nbstripout
exclude: "^(references|reports)"
---
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/kynan/nbstripout
rev: 0.6.1
hooks:
- id: nbstripout
- repo: https://github.com/cmhughes/latexindent.pl.git
rev: V3.19.1
hooks:
- id: latexindent
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
hooks:
- id: trailing-whitespace
- id: check-added-large-files
- id: check-builtin-literals
- id: check-byte-order-marker
- id: check-merge-conflict
- id: check-symlinks
- id: check-toml
- id: check-yaml
- id: debug-statements
- id: end-of-file-fixer
- id: mixed-line-ending
- id: trailing-whitespace
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.991
hooks:
- id: mypy
# yaml requires additional stubs.
# Similar to: https://stackoverflow.com/a/73603491/5755604
additional_dependencies: ['types-PyYAML']
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.3
hooks:
- id: ruff
args:
- --fix
- id: ruff-format
exclude: "^(references|reports)"
Loading

0 comments on commit 748a2dc

Please sign in to comment.