Skip to content

Commit 76a5d35

Browse files
authored
Modernize the template. (#10)
1 parent e1be7de commit 76a5d35

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+478
-1318
lines changed

.github/workflows/main.yml

+11-8
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
3333

3434
steps:
35-
- uses: actions/checkout@v2
35+
- uses: actions/checkout@v3
3636
- uses: conda-incubator/setup-miniconda@v2
3737
with:
3838
auto-update-conda: false
@@ -60,14 +60,17 @@ jobs:
6060
runs-on: ubuntu-latest
6161

6262
steps:
63-
- uses: actions/checkout@v2
64-
- uses: conda-incubator/setup-miniconda@v2
63+
- uses: actions/checkout@v3
64+
- uses: mamba-org/provision-with-micromamba@main
6565
with:
66-
auto-update-conda: false
67-
68-
- name: Install core dependencies.
69-
shell: bash -l {0}
70-
run: conda install -c conda-forge tox-conda
66+
environment-file: false
67+
environment-name: gha-docs
68+
channels: conda-forge,nodefaults
69+
extra-specs: |
70+
python=3.11
71+
mamba
72+
tox-conda
73+
cache-downloads: true
7174

7275
- name: Build docs
7376
shell: bash -l {0}

.gitignore

-2
Original file line numberDiff line numberDiff line change
@@ -148,5 +148,3 @@ _generated
148148

149149
build
150150
dist
151-
152-
version.py

.pre-commit-config.yaml

+64-43
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,23 @@
1-
exclude: "{{cookiecutter.package_name}}"
1+
exclude: |
2+
(?x)^(
3+
{{cookiecutter.package_name}}/tests/test_import.py
4+
)$
25
36
repos:
47
- repo: https://github.com/pre-commit/pre-commit-hooks
5-
rev: v4.1.0
8+
rev: v4.4.0
69
hooks:
710
- id: check-added-large-files
811
args: ['--maxkb=25']
912
- id: check-case-conflict
1013
- id: check-merge-conflict
1114
- id: check-vcs-permalinks
1215
- id: check-yaml
16+
exclude: |
17+
(?x)^(
18+
{{cookiecutter.package_name}}/environment.yml|
19+
{{cookiecutter.package_name}}/.pre-commit-config.yaml
20+
)$
1321
- id: debug-statements
1422
- id: end-of-file-fixer
1523
- id: fix-byte-order-marker
@@ -25,81 +33,94 @@ repos:
2533
- id: python-no-eval
2634
- id: python-no-log-warn
2735
- id: python-use-type-annotations
28-
- id: rst-backticks
29-
- id: rst-directive-colons
30-
- id: rst-inline-touching-normal
3136
- id: text-unicode-replacement-char
3237
- repo: https://github.com/asottile/pyupgrade
33-
rev: v2.31.0
38+
rev: v3.3.1
3439
hooks:
3540
- id: pyupgrade
3641
args: [--py37-plus]
3742
- repo: https://github.com/asottile/reorder_python_imports
38-
rev: v2.7.1
43+
rev: v3.9.0
3944
hooks:
4045
- id: reorder-python-imports
4146
args: [--py37-plus, --add-import, 'from __future__ import annotations']
47+
- repo: https://github.com/asottile/setup-cfg-fmt
48+
rev: v2.2.0
49+
hooks:
50+
- id: setup-cfg-fmt
51+
exclude: |
52+
(?x)^(
53+
{{cookiecutter.package_name}}/setup.cfg
54+
)$
4255
- repo: https://github.com/psf/black
43-
rev: 22.6.0
56+
rev: 22.12.0
4457
hooks:
4558
- id: black
4659
- repo: https://github.com/myint/docformatter
47-
rev: v1.3.1
60+
rev: v1.5.1
4861
hooks:
4962
- id: docformatter
5063
args: [--in-place, --wrap-summaries, "88", --wrap-descriptions, "88", --blank]
51-
- repo: https://github.com/asottile/blacken-docs
52-
rev: v1.12.1
53-
hooks:
54-
- id: blacken-docs
55-
additional_dependencies: [black]
56-
- repo: https://github.com/PyCQA/flake8
57-
rev: 4.0.1
64+
- repo: https://github.com/charliermarsh/ruff-pre-commit
65+
rev: v0.0.205
5866
hooks:
59-
- id: flake8
60-
additional_dependencies: [
61-
flake8-alfred,
62-
flake8-bugbear,
63-
flake8-builtins,
64-
flake8-comprehensions,
65-
flake8-docstrings,
66-
flake8-eradicate,
67-
flake8-print,
68-
flake8-pytest-style,
69-
flake8-todo,
70-
flake8-typing-imports,
71-
flake8-unused-arguments,
72-
pep8-naming,
73-
pydocstyle,
74-
Pygments,
75-
]
76-
- repo: https://github.com/PyCQA/doc8
77-
rev: 0.10.1
67+
- id: ruff
68+
args: [hooks, tests]
69+
pass_filenames: false
70+
- repo: https://github.com/dosisod/refurb
71+
rev: v1.9.1
7872
hooks:
79-
- id: doc8
73+
- id: refurb
74+
args: [--ignore, FURB126]
75+
exclude: ({{cookiecutter.package_name}})
8076
- repo: https://github.com/econchick/interrogate
8177
rev: 1.5.0
8278
hooks:
8379
- id: interrogate
8480
args: [-v, --fail-under=40]
81+
- repo: https://github.com/executablebooks/mdformat
82+
rev: 0.7.16
83+
hooks:
84+
- id: mdformat
85+
additional_dependencies: [
86+
mdformat-gfm,
87+
mdformat-black,
88+
]
89+
args: [--wrap, "88"]
90+
files: (README\.md)
91+
exclude: |
92+
(?x)^(
93+
{{cookiecutter.package_name}}/README.md
94+
)$
95+
- repo: https://github.com/executablebooks/mdformat
96+
rev: 0.7.16
97+
hooks:
98+
- id: mdformat
99+
additional_dependencies: [
100+
mdformat-myst,
101+
mdformat-black,
102+
]
103+
args: [--wrap, "88"]
104+
files: (docs/.)
105+
# Exclude files with admonitions.
106+
# exclude: |
107+
# (?x)^(
108+
# path/to/file.py
109+
# )$
85110
- repo: https://github.com/codespell-project/codespell
86-
rev: v2.1.0
111+
rev: v2.2.2
87112
hooks:
88113
- id: codespell
89-
- repo: https://github.com/guilatrova/tryceratops
90-
rev: v1.0.1
91-
hooks:
92-
- id: tryceratops
114+
additional_dependencies: [tomli]
93115
- repo: https://github.com/pre-commit/mirrors-mypy
94-
rev: 'v0.931'
116+
rev: 'v0.991'
95117
hooks:
96118
- id: mypy
97119
args: [
98120
--no-strict-optional,
99121
--ignore-missing-imports,
100122
]
101123
pass_filenames: false
102-
language_version: "3.9"
103124
- repo: meta
104125
hooks:
105126
- id: check-hooks-apply

CHANGES.md

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Changes
2+
3+
This is a record of all past cookiecutter-pytask-plugin releases and what went into them
4+
in reverse chronological order.
5+
6+
## 1.2.0 - 2023-xx-xx
7+
8+
- {pull}`10` modernizes the template.
9+
10+
## 1.1.0 - 2022-02-08
11+
12+
- {pull}`2` fixes the readme.
13+
- {pull}`4` skips concurrent CI builds.
14+
- {pull}`5` deprecates Python 3.6 and adds support for Python 3.10.
15+
16+
## 1.0.0 - 2022-01-14
17+
18+
- {pull}`1` converts the template to a cookiecutter.

CHANGES.rst

-18
This file was deleted.

README.md

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# cookiecutter-pytask-plugin
2+
3+
[![MIT license](https://img.shields.io/github/license/pytask-dev/cookiecutter-pytask-plugin)](https://github.com/pytask-dev/cookiecutter-pytask-plugin)
4+
[![image](https://readthedocs.org/projects/cookiecutter-pytask-plugin/badge/?version=latest)](https://cookiecutter-pytask-plugin.readthedocs.io/en/latest)
5+
[![image](https://img.shields.io/github/actions/workflow/status/pytask-dev/cookiecutter-pytask-plugin/main.yml?branch=main)](https://github.com/pytask-dev/cookiecutter-pytask-plugin/actions?query=branch%3Amain)
6+
[![image](https://codecov.io/gh/pytask-dev/cookiecutter-pytask-plugin/branch/main/graph/badge.svg)](https://codecov.io/gh/pytask-dev/cookiecutter-pytask-plugin)
7+
[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/pytask-dev/cookiecutter-pytask-plugin/main.svg)](https://results.pre-commit.ci/latest/github/pytask-dev/cookiecutter-pytask-plugin/main)
8+
[![image](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
9+
10+
This repository contains a minimal cookiecutter template for a plugin for
11+
[pytask](https://github.com/pytask-dev/pytask) .
12+
13+
## Usage
14+
15+
First, install cookiecutter.
16+
17+
```console
18+
$ pip install cookiecutter
19+
20+
$ conda install -c conda-forge cookiecutter
21+
```
22+
23+
Then, set up the template for the new plugin with
24+
25+
```console
26+
$ cookiecutter https://github.com/pytask-dev/cookiecutter-pytask-plugin
27+
```
28+
29+
## FAQ
30+
31+
Q: Why are the source files nested in `src/<{{ cookiecutter.__package_name }}>`?
32+
33+
A: This is called the src layout. This
34+
[article by Hynek Schlawack](https://hynek.me/articles/testing-packaging/) discusses the
35+
advantages of this layout in detail.

README.rst

-53
This file was deleted.

TODO.rst

-7
This file was deleted.

codecov.yml

-1
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,3 @@ coverage:
2424

2525
ignore:
2626
- ".tox/**/*"
27-
- "setup.py"

cookiecutter.json

+10-13
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,25 @@
11
{
22
"author": "Arianna W. Rosenbluth",
33
"email": "{{ cookiecutter.author.lower().replace(' ', '') }}@mail.edu",
4-
"github_username": "{{ cookiecutter.author.lower().replace(' ', '') }}",
5-
"github_email": "{{ cookiecutter.email }}",
64
"package_name": "pytask-plugin",
75
"package_description": "A pytask plugin for ...",
8-
"version": "0.0.1",
9-
"python_version": "3.9",
10-
"keep_code_for_wrapping_subprocess_run": ["no", "yes"],
11-
"if_yes_tool_pretty_name": "LaTeX",
12-
"if_yes_command_line_tool": "latexmk",
13-
"if_yes_marker_name": "latex",
14-
"if_yes_executable_file_ending": ".tex",
6+
"github_username": "{{ cookiecutter.author.lower().replace(' ', '') }}",
7+
"github_email": "{{ cookiecutter.email }}",
8+
"python_version": "3.10",
159
"add_tox": ["yes", "no"],
1610
"add_github_actions": ["yes", "no"],
1711
"add_readthedocs": ["yes", "no"],
1812
"add_codecov": ["yes", "no"],
19-
"create_changelog": ["yes", "no"],
2013
"open_source_license": [
21-
"MIT", "BSD", "ISC", "Apache Software License 2.0",
22-
"GNU General Public License v3", "Not open source"
14+
"MIT",
15+
"BSD",
16+
"ISC",
17+
"Apache Software License 2.0",
18+
"GNU General Public License v3",
19+
"Not open source"
2320
],
2421
"make_initial_commit": ["no", "yes"],
25-
"conda_environment_name": "{{ cookiecutter.package_name.lower().replace(' ', '-') }}",
22+
"conda_environment_name": "{{ cookiecutter.package_name }}",
2623
"create_conda_environment_at_finish": ["no", "yes"],
2724
"_copy_without_render": [
2825
".github/workflows/main.yml", ".github/workflows/publish-to-pypi.yml"

docs/rtd_environment.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ channels:
33
- nodefaults
44

55
dependencies:
6-
- python >= 3.7
6+
- python >= 3.8
77
- pip
88
- setuptools_scm
99
- toml
@@ -19,4 +19,5 @@ dependencies:
1919
- sphinx-panels
2020

2121
- pip:
22-
- -e ..
22+
- ../
23+
- sphinxext-opengraph

0 commit comments

Comments
 (0)