Skip to content

Commit

Permalink
Merge pull request #33 from Quantco/migrate-to-copier
Browse files Browse the repository at this point in the history
migrate to copier template
  • Loading branch information
ivergara authored Jan 29, 2024
2 parents 6fcb5e0 + 752ca47 commit a2aa9c6
Show file tree
Hide file tree
Showing 10 changed files with 34 additions and 31 deletions.
7 changes: 7 additions & 0 deletions .copier-answers.yml
Original file line number Diff line number Diff line change
@@ -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: This hook runs flake8.
entry: flake8
tool: flake8
url: https://flake8.pycqa.org
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ updates:
- package-ecosystem: github-actions
directory: /
schedule:
interval: weekly
interval: monthly
reviewers:
- quantco/ci
groups:
Expand Down
11 changes: 5 additions & 6 deletions .github/workflows/autoupdate.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
name: Autoupdate

on:
workflow_dispatch:
schedule:
- cron: "0 */6 * * *"
- cron: "0 0 * * 0"

defaults:
run:
Expand All @@ -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
Expand All @@ -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
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: CI
on:
push:
branches:
- master
- main
pull_request:

jobs:
Expand All @@ -16,6 +16,7 @@ jobs:
with:
ref: ${{ github.head_ref }}
- name: Set up Conda env
uses: mamba-org/provision-with-micromamba@3c96c0c27676490c63c18bc81f5c51895ac3e0e6
uses: mamba-org/setup-micromamba@8767fb704bd78032e9392f0386bf46950bdd1194
with:
environment-file: environment.yml
environment-name: test-env
11 changes: 5 additions & 6 deletions .github/workflows/keep-alive.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
name: Keep
on:
# pull_request:
schedule:
- cron: "0 6 * * SUN" # Once weekly on Sunday @ 0600 UTC
- cron: 0 6 * * SUN

jobs:
keep-alive:
name: Alive
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
1 change: 0 additions & 1 deletion .github/workflows/tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
push:
branches:
- main
- master

jobs:
tag:
Expand Down
12 changes: 5 additions & 7 deletions .pre-commit-hooks.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
- id: flake8-conda
name: flake8-conda
description: This hook runs flake8.
entry: flake8
language: conda
types: [python]
require_serial: true
- id: flake8-conda
name: flake8-conda
description: 'This hook runs flake8.'
entry: flake8
language: conda
2 changes: 1 addition & 1 deletion LICENSE.txt → LICENSE
Original file line number Diff line number Diff line change
@@ -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:

Expand Down
13 changes: 6 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
flake8(-conda) mirror
====================
# flake8 mirror

Mirror of flake8 for pre-commit with conda as a language.

For pre-commit: see https://github.com/pre-commit/pre-commit
For flake8: http://flake8.pycqa.org/
For pre-commit: see [here](https://github.com/pre-commit/pre-commit)

### Using flake8 with pre-commit and conda:
For flake8: see [here](https://flake8.pycqa.org)

## Using flake8 with pre-commit and conda:

Add this to your `.pre-commit-config.yaml`

```yaml
- repo: https://github.com/Quantco/pre-commit-mirrors-flake8
- repo: https://github.com/quantco/pre-commit-mirrors-flake8
rev: '' # Use the sha / tag you want to point at
hooks:
- id: flake8-conda
```
1 change: 1 addition & 0 deletions environment.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
channels:
- conda-forge
- nodefaults
dependencies:
- flake8=7.0.0

0 comments on commit a2aa9c6

Please sign in to comment.