Skip to content

Commit 9726bc6

Browse files
authored
migrate to copier template (#37)
1 parent 8aaaa10 commit 9726bc6

10 files changed

+38
-36
lines changed

.copier-answers.yml

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# This file is managed by Copier; DO NOT EDIT OR REMOVE.
2+
_commit: v0.1.4
3+
_src_path: git@github.com:quantco/copier-template-pre-commit-mirrors
4+
description: Jupyter notebooks as Markdown documents, Julia, Python or R scripts
5+
entry: jupytext
6+
tool: jupytext
7+
url: https://github.com/mwouts/jupytext

.github/CODEOWNERS

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
* @Quantco/ci
1+
* @quantco/ci

.github/dependabot.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ updates:
33
- package-ecosystem: github-actions
44
directory: /
55
schedule:
6-
interval: weekly
6+
interval: monthly
77
reviewers:
88
- quantco/ci
99
groups:

.github/workflows/autoupdate.yml

+7-8
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
name: Autoupdate
2+
23
on:
3-
workflow_dispatch:
4-
schedule:
5-
- cron: "0 */6 * * *"
4+
workflow_dispatch:
5+
schedule:
6+
- cron: "0 0 * * 0"
67

78
defaults:
89
run:
@@ -16,10 +17,8 @@ jobs:
1617
steps:
1718
- name: Checkout branch
1819
uses: actions/checkout@v4
19-
with:
20-
ref: ${{ github.head_ref }}
2120
- name: Set up Conda env
22-
uses: mamba-org/setup-micromamba@e820223f89c8720d6c740ca154a7adf32fcd278a
21+
uses: mamba-org/setup-micromamba@8767fb704bd78032e9392f0386bf46950bdd1194
2322
with:
2423
environment-file: environment.yml
2524
environment-name: check-env
@@ -32,8 +31,8 @@ jobs:
3231
new_version=$(micromamba list -n check-env "$pkgname" --json | jq -r '.[0].version')
3332
if [[ "$new_version" != "$old_version" ]]; then
3433
sed -i "s/$old_version/$new_version/g" environment.yml
35-
echo "pkgname=$pkgname" >> "$GITHUB_OUTPUT"
36-
echo "new-version=$new_version" >> "$GITHUB_OUTPUT"
34+
echo "pkgname=$pkgname" >> $GITHUB_OUTPUT
35+
echo "new-version=$new_version" >> $GITHUB_OUTPUT
3736
fi
3837
- uses: peter-evans/create-pull-request@153407881ec5c347639a548ade7d8ad1d6740e38
3938
if: steps.versions.outputs.pkgname

.github/workflows/ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
with:
1717
ref: ${{ github.head_ref }}
1818
- name: Set up Conda env
19-
uses: mamba-org/setup-micromamba@e820223f89c8720d6c740ca154a7adf32fcd278a
19+
uses: mamba-org/setup-micromamba@8767fb704bd78032e9392f0386bf46950bdd1194
2020
with:
2121
environment-file: environment.yml
2222
environment-name: test-env

.github/workflows/keep-alive.yml

+5-6
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
name: Keep
22
on:
3-
# pull_request:
43
schedule:
5-
- cron: "0 6 * * SUN" # Once weekly on Sunday @ 0600 UTC
4+
- cron: 0 6 * * SUN
65

76
jobs:
87
keep-alive:
98
name: Alive
109
runs-on: ubuntu-latest
1110
steps:
1211
- uses: actions/checkout@v4
13-
- uses: gautamkrishnar/keepalive-workflow@60b13c92aeda855e493b83aaf482c25da7e0043b
12+
- uses: gautamkrishnar/keepalive-workflow@5b3128727d02fe1a892d0a2987517c9ec8ca7425
1413
with:
15-
commit_message: "Ah ah ah, stayin' alive"
14+
commit_message: Ah ah ah, stayin' alive
1615
committer_username: ForrestQuant
17-
committer_email: "forrestquant@users.noreply.github.com"
18-
time_elapsed: 50 # days
16+
committer_email: forrestquant@users.noreply.github.com
17+
time_elapsed: 50 # days

.pre-commit-hooks.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
- id: jupytext-conda
22
name: jupytext-conda
3-
description: Jupyter notebooks as Markdown documents, Julia, Python or R scripts
3+
description: 'Jupyter notebooks as Markdown documents, Julia, Python or R scripts'
44
entry: jupytext
55
language: conda
66
types: [jupyter]

LICENSE.txt LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright 2019 QuantCo, Inc.
1+
Copyright 2024 QuantCo, Inc.
22

33
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
44

README.md

+13-17
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,18 @@
1-
# Jupytext pre-commit hook
2-
Hook for Jupytext with conda as a language.
3-
Currently the main Jupytext-repo doesn't have pre-commit hooks defined, so
4-
this repo is called `mirror` only for consistency.
1+
# jupytext mirror
52

6-
* For pre-commit: see https://github.com/pre-commit/pre-commit
7-
* For Jupytext: see https://github.com/mwouts/jupytext
3+
Mirror of jupytext for pre-commit with conda as a language.
84

9-
### Using Jupytext with pre-commit and conda:
10-
Add this to your `.pre-commit-config.yaml`:
5+
For pre-commit: see [here](https://github.com/pre-commit/pre-commit)
6+
7+
For jupytext: see [here](https://github.com/mwouts/jupytext)
8+
9+
## Using jupytext with pre-commit and conda:
10+
11+
Add this to your `.pre-commit-config.yaml`
1112

1213
```yaml
13-
- repo: https://github.com/Quantco/pre-commit-mirrors-jupytext
14-
rev: '' # The git sha / tag you want to point to
15-
hooks:
16-
- id: jupytext-conda
17-
args:
18-
- --to=py:percent
14+
- repo: https://github.com/quantco/pre-commit-mirrors-jupytext
15+
rev: '' # Use the sha / tag you want to point at
16+
hooks:
17+
- id: jupytext-conda
1918
```
20-
`args` is optional and allows passing further parameters to `jupytext`.
21-
By default only `--to=py:percent` is passed which converts all Jupyter notebooks to Python
22-
scripts using the [`percent` formatting](https://jupytext.readthedocs.io/en/latest/formats.html).

environment.yml

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
channels:
22
- conda-forge
3+
- nodefaults
34
dependencies:
45
- jupytext=1.16.1

0 commit comments

Comments
 (0)