diff --git a/.copier-answers.yml b/.copier-answers.yml new file mode 100644 index 0000000..7d8e3ac --- /dev/null +++ b/.copier-answers.yml @@ -0,0 +1,7 @@ +# This file is managed by Copier; DO NOT EDIT OR REMOVE. +_commit: v0.1.4 +_src_path: git@github.com:quantco/copier-template-pre-commit-mirrors +description: Jupyter notebooks as Markdown documents, Julia, Python or R scripts +entry: jupytext +tool: jupytext +url: https://github.com/mwouts/jupytext diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index ce4b487..15204fd 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1 +1 @@ -* @Quantco/ci +* @quantco/ci diff --git a/.github/dependabot.yml b/.github/dependabot.yml index a2a06ab..5a74cb9 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -3,7 +3,7 @@ updates: - package-ecosystem: github-actions directory: / schedule: - interval: weekly + interval: monthly reviewers: - quantco/ci groups: diff --git a/.github/workflows/autoupdate.yml b/.github/workflows/autoupdate.yml index 622c172..920451b 100644 --- a/.github/workflows/autoupdate.yml +++ b/.github/workflows/autoupdate.yml @@ -1,8 +1,9 @@ name: Autoupdate + on: - workflow_dispatch: - schedule: - - cron: "0 */6 * * *" + workflow_dispatch: + schedule: + - cron: "0 0 * * 0" defaults: run: @@ -16,10 +17,8 @@ jobs: steps: - name: Checkout branch uses: actions/checkout@v4 - with: - ref: ${{ github.head_ref }} - name: Set up Conda env - uses: mamba-org/setup-micromamba@e820223f89c8720d6c740ca154a7adf32fcd278a + uses: mamba-org/setup-micromamba@8767fb704bd78032e9392f0386bf46950bdd1194 with: environment-file: environment.yml environment-name: check-env @@ -32,8 +31,8 @@ jobs: new_version=$(micromamba list -n check-env "$pkgname" --json | jq -r '.[0].version') if [[ "$new_version" != "$old_version" ]]; then sed -i "s/$old_version/$new_version/g" environment.yml - echo "pkgname=$pkgname" >> "$GITHUB_OUTPUT" - echo "new-version=$new_version" >> "$GITHUB_OUTPUT" + echo "pkgname=$pkgname" >> $GITHUB_OUTPUT + echo "new-version=$new_version" >> $GITHUB_OUTPUT fi - uses: peter-evans/create-pull-request@153407881ec5c347639a548ade7d8ad1d6740e38 if: steps.versions.outputs.pkgname diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 27b57b5..a2d7155 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,7 +16,7 @@ jobs: with: ref: ${{ github.head_ref }} - name: Set up Conda env - uses: mamba-org/setup-micromamba@e820223f89c8720d6c740ca154a7adf32fcd278a + uses: mamba-org/setup-micromamba@8767fb704bd78032e9392f0386bf46950bdd1194 with: environment-file: environment.yml environment-name: test-env diff --git a/.github/workflows/keep-alive.yml b/.github/workflows/keep-alive.yml index b6d789e..d36d27e 100644 --- a/.github/workflows/keep-alive.yml +++ b/.github/workflows/keep-alive.yml @@ -1,8 +1,7 @@ name: Keep on: - # pull_request: schedule: - - cron: "0 6 * * SUN" # Once weekly on Sunday @ 0600 UTC + - cron: 0 6 * * SUN jobs: keep-alive: @@ -10,9 +9,9 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: gautamkrishnar/keepalive-workflow@60b13c92aeda855e493b83aaf482c25da7e0043b + - uses: gautamkrishnar/keepalive-workflow@5b3128727d02fe1a892d0a2987517c9ec8ca7425 with: - commit_message: "Ah ah ah, stayin' alive" + commit_message: Ah ah ah, stayin' alive committer_username: ForrestQuant - committer_email: "forrestquant@users.noreply.github.com" - time_elapsed: 50 # days + committer_email: forrestquant@users.noreply.github.com + time_elapsed: 50 # days diff --git a/.pre-commit-hooks.yaml b/.pre-commit-hooks.yaml index c39faaf..6ce59da 100644 --- a/.pre-commit-hooks.yaml +++ b/.pre-commit-hooks.yaml @@ -1,6 +1,6 @@ - id: jupytext-conda name: jupytext-conda - description: Jupyter notebooks as Markdown documents, Julia, Python or R scripts + description: 'Jupyter notebooks as Markdown documents, Julia, Python or R scripts' entry: jupytext language: conda types: [jupyter] diff --git a/LICENSE.txt b/LICENSE similarity index 98% rename from LICENSE.txt rename to LICENSE index 18bd882..1f66540 100644 --- a/LICENSE.txt +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright 2019 QuantCo, Inc. +Copyright 2024 QuantCo, Inc. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: diff --git a/README.md b/README.md index da142fe..0d20fb9 100644 --- a/README.md +++ b/README.md @@ -1,22 +1,18 @@ -# Jupytext pre-commit hook -Hook for Jupytext with conda as a language. -Currently the main Jupytext-repo doesn't have pre-commit hooks defined, so -this repo is called `mirror` only for consistency. +# jupytext mirror -* For pre-commit: see https://github.com/pre-commit/pre-commit -* For Jupytext: see https://github.com/mwouts/jupytext +Mirror of jupytext for pre-commit with conda as a language. -### Using Jupytext with pre-commit and conda: -Add this to your `.pre-commit-config.yaml`: +For pre-commit: see [here](https://github.com/pre-commit/pre-commit) + +For jupytext: see [here](https://github.com/mwouts/jupytext) + +## Using jupytext with pre-commit and conda: + +Add this to your `.pre-commit-config.yaml` ```yaml -- repo: https://github.com/Quantco/pre-commit-mirrors-jupytext - rev: '' # The git sha / tag you want to point to - hooks: - - id: jupytext-conda - args: - - --to=py:percent + - repo: https://github.com/quantco/pre-commit-mirrors-jupytext + rev: '' # Use the sha / tag you want to point at + hooks: + - id: jupytext-conda ``` -`args` is optional and allows passing further parameters to `jupytext`. -By default only `--to=py:percent` is passed which converts all Jupyter notebooks to Python -scripts using the [`percent` formatting](https://jupytext.readthedocs.io/en/latest/formats.html). diff --git a/environment.yml b/environment.yml index e4db2a3..b696c28 100644 --- a/environment.yml +++ b/environment.yml @@ -1,4 +1,5 @@ channels: - conda-forge + - nodefaults dependencies: - jupytext=1.16.1