Skip to content

Commit

Permalink
Remove cookiecutter (#149)
Browse files Browse the repository at this point in the history
Complete re-write of how to obtain templates, making things much simpler in many dimensions.


---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Hans-Martin von Gaudecker <hmgaudecker@gmail.com>
  • Loading branch information
3 people committed Jul 15, 2024
1 parent eda143b commit be74854
Show file tree
Hide file tree
Showing 133 changed files with 6,086 additions and 2,948 deletions.
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
---

name: Bug Report
about: Create a bug report to help us improve {{ cookiecutter.project_slug }}
about: Create a bug report to help us improve template_project
title: "BUG:"
labels: "bug"

---

- [ ] I have checked that this issue has not already been reported.

- [ ] I have confirmed this bug exists on the latest version of {{
cookiecutter.project_slug }}.
- [ ] I have confirmed this bug exists on the latest version of template_project.

- [ ] (optional) I have confirmed this bug exists on the `main` branch of {{
cookiecutter.project_slug }}.
- [ ] (optional) I have confirmed this bug exists on the `main` branch of template_project.

---

Expand Down
16 changes: 16 additions & 0 deletions .github/ISSUE_TEMPLATE/documentation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---

name: Documentation Improvement
about: Report wrong or missing documentation in template_project
title: "DOC:"
labels: "documentation"

---

#### Documentation problem

Provide a description of what documentation you believe needs to be fixed/improved.

#### Suggested fix for documentation

Explain the suggested fix and **why** it's better than the existing documentation.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---

name: Enhancement
about: Suggest an idea for {{ cookiecutter.project_slug }}
about: Suggest an idea for template_project
title: "ENH:"
labels: "enhancement"

Expand All @@ -10,7 +10,7 @@ labels: "enhancement"
#### Is your feature request related to a problem?

Provide a description of what the problem is, e.g. "I wish I could use
{{ cookiecutter.project_slug }} to do [...]".
template_project to do [...]".

#### Describe the solution you'd like

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
---

name: Submit Question
about: Ask a general question about {{ cookiecutter.project_slug }}
about: Ask a general question about template_project
title: "QST:"
labels: "question"

---

#### Question about {{ cookiecutter.project_slug }}
#### Question about template_project

**Note**: If you'd still like to submit a question, please read [this guide](
https://matthewrocklin.com/blog/work/2018/02/28/minimal-bug-reports) detailing how to
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,3 @@ Provide a description and/or bullet points to describe the changes in this PR.

- [ ] Reference issues which can be closed due to this PR with "Closes #x".
- [ ] Review whether the documentation needs to be updated.
- [ ] Document PR in docs/changes.rst.
34 changes: 22 additions & 12 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
# yamllint disable rule:line-length
name: main
# Automatically cancel a previous run.
concurrency:
group: ${{ github.head_ref || github.run_id }}
cancel-in-progress: true
# yamllint disable-line rule:truthy
# yamllint disable rule:line-length
on:
push:
branches: [main]
Expand All @@ -18,24 +18,34 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ['3.11']
python-version: ['3.12']
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install TinyTex
uses: r-lib/actions/setup-tinytex@v2
- name: Install additional LaTeX packages
run: |
tlmgr install a4wide beamer biber biblatex caption eurosym grfext minibox moreverb ntgclass relsize setspace
tlmgr update --self
tlmgr install a4wide beamer biber biblatex caption eurosym grfext minibox moreverb ntgclass relsize setspace xfrac
tlmgr list --only-installed
- name: Install conda environment with micromamba
uses: mamba-org/provision-with-micromamba@main
uses: mamba-org/setup-micromamba@v1
with:
environment-file: environment.yml
environment-name: gha-testing
extra-specs: python=${{ matrix.python-version }}
cache-downloads: true
- name: Run tests
run: micromamba run -n gha-testing pytest -v --cov=./ --cov-report=xml
create-args: python=${{ matrix.python-version }}
cache-environment: true
- name: Run full test suite on MacOS and Linux
shell: bash -l {0}
run: |
micromamba activate template_project
pytest -v --cov=./ --cov-report=xml
if: runner.os != 'Windows'
- name: Run test suite except for pytask build on Windows
shell: bash -l {0}
run: |
micromamba activate template_project
pytest -v -k "not pytask"
if: runner.os == 'Windows'
- name: Upload coverage reports
if: runner.os == 'Linux' && matrix.python-version == '3.11'
if: runner.os == 'Linux' && matrix.python-version == '3.12'
uses: codecov/codecov-action@v3
88 changes: 30 additions & 58 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,69 +1,41 @@
docs/scripts/latex/*.png
*-blx.bib
*.asv
# python
*.egg-info
*_version.py
*.pyc
*__pycache__

# python tools
.pytest_cache
.ruff_cache
.pytask.sqlite3
.pytask

# R
.RData
.Rhistory

# bld
bld/

# latex
*.aux
*.bbl
*.bcf
*.bib_*.utf8
*.bcf*
*.blg
*.dvi
*.ent
*.fff
*.fdb_latexmk
*.fls
*.glo
*.idx
*.ilg
*.ind
*.lof
*.log
*.lot
*.mod
*.nav
*.o
*.out
*.pdf
*.pdfsync
*.prj
*.pyc
*.run.xml
*.synctex.gz
*.nav
*.snm
*.sublime-*
*.svn
*.tmproj
*.toc
*.ttt
*.vrb
.waf*
waf-*
waf3-*
*latexmk
*synctex.gz
.*
!.github
.*pdfsvn
*__pycache__
analysis_out
bld
build
debug
Debug
final_out
formatted_data
project_documentation
scons.py
test
Test
textmatetostata.do
fake
full
~$*
Thumbs.db
___*

# documentation
docs_template/build/
docs_template/scripts/latex/*.png

# local
.vscode
!.gitignore
!.pre-commit-config.yaml
!.readthedocs.yml
hooks.egg-info
coverage.xml
tmp*
pytest-of-hmg
106 changes: 64 additions & 42 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
exclude: ^(\.|{{cookiecutter\.project_slug}})/.+
repos:
- repo: meta
hooks:
Expand All @@ -11,7 +10,7 @@ repos:
hooks:
- id: yamlfix
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v4.6.0
hooks:
- id: check-added-large-files
args: [--maxkb=25]
Expand All @@ -30,74 +29,97 @@ repos:
description: Forces to replace line ending by the UNIX 'lf' character.
- id: name-tests-test
args: [--pytest-test-first]
- id: no-commit-to-branch
args: [--branch, main]
- id: trailing-whitespace
- id: check-ast
- id: check-docstring-first
- repo: https://github.com/adrienverge/yamllint.git
rev: v1.33.0
rev: v1.35.1
hooks:
- id: yamllint
- repo: https://github.com/psf/black
rev: 23.11.0
hooks:
- id: black
language_version: python3.11
- repo: https://github.com/asottile/blacken-docs
rev: 1.16.0
hooks:
- id: blacken-docs
- repo: https://github.com/PyCQA/docformatter
rev: v1.7.5
hooks:
- id: docformatter
args:
- --in-place
- --wrap-summaries
- '88'
- --wrap-descriptions
- '88'
- --blank
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.6
rev: v0.5.1
hooks:
# Run the linter.
- id: ruff
# args:
# - --verbose
types_or: [python, jupyter]
args:
- --fix
# Run the formatter.
- id: ruff-format
types_or: [python, jupyter]
- repo: https://github.com/kynan/nbstripout
rev: 0.6.1
rev: 0.7.1
hooks:
- id: nbstripout
args:
- --extra-keys
- metadata.kernelspec metadata.language_info.version metadata.vscode
- repo: https://github.com/nbQA-dev/nbQA
rev: 1.7.1
hooks:
- id: nbqa-black
additional_dependencies: [black==23.11.0]
- id: nbqa-ruff
additional_dependencies: [ruff==v0.1.6]
args: ['--ignore=B018,T201']
- repo: https://github.com/executablebooks/mdformat
rev: 0.7.17
hooks:
- id: mdformat
additional_dependencies: [mdformat-gfm, mdformat-black]
additional_dependencies: [mdformat-gfm, mdformat-gfm-alerts, mdformat-ruff]
args: [--wrap, '88']
files: (README\.md)
- repo: https://github.com/executablebooks/mdformat
rev: 0.7.17
hooks:
- id: mdformat
additional_dependencies: [mdformat-myst, mdformat-black]
additional_dependencies: [mdformat-myst, mdformat-ruff]
args: [--wrap, '88']
files: (docs/.)
files: (docs_template/.)
- repo: https://github.com/codespell-project/codespell
rev: v2.2.6
rev: v2.3.0
hooks:
- id: codespell
args: [--skip="**.ipynb"]

# R specific hooks: https://github.com/lorenzwalthert/precommit
- repo: https://github.com/lorenzwalthert/precommit
rev: v0.4.2
hooks:
- id: style-files
args: [--style_pkg=styler, --style_fun=tidyverse_style]
- id: spell-check
exclude: >
(?x)^(
.*\.[rR]|
.*\.feather|
.*\.jpeg|
.*\.pdf|
.*\.png|
.*\.py|
.*\.RData|
.*\.rds|
.*\.Rds|
.*\.Rproj|
.*\.sh|
(.*/|)\.gitignore|
(.*/|)\.gitlab-ci\.yml|
(.*/|)\.lintr|
(.*/|)\.pre-commit-.*|
(.*/|)\.Rbuildignore|
(.*/|)\.Renviron|
(.*/|)\.Rprofile|
(.*/|)\.travis\.yml|
(.*/|)appveyor\.yml|
(.*/|)NAMESPACE|
(.*/|)renv/settings\.dcf|
(.*/|)renv\.lock|
(.*/|)WORDLIST|
\.github/workflows/.*|
data/.*|
)$
- id: readme-rmd-rendered
- id: parsable-R
- id: no-browser-statement
- id: no-debug-statement
- repo: local
hooks:
- id: forbid-to-commit
name: Don't commit common R artifacts
entry: Cannot commit .Rhistory, .RData, .Rds or .rds.
language: fail
files: \.(Rhistory|RData|Rds|rds)$
# `exclude: <regex>` to allow committing specific files{% endif %}
ci:
autoupdate_schedule: monthly
File renamed without changes.
6 changes: 6 additions & 0 deletions CITATION
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
@Unpublished{DOE2024,
Title = "EXAMPLE PROJECT",
Author = "JANE DOE",
Year = "2024",
Url = "https://github.com/opensourceeconomics/econ-project-templates",
}
Loading

0 comments on commit be74854

Please sign in to comment.