From a414adda9987f292be511e5c1c2dd169c9d01261 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 20 Nov 2023 18:03:06 +0000 Subject: [PATCH 01/17] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/pre-commit-hooks: v4.4.0 → v4.5.0](https://github.com/pre-commit/pre-commit-hooks/compare/v4.4.0...v4.5.0) - https://github.com/asottile/reorder_python_imports → https://github.com/asottile/reorder-python-imports - [github.com/asottile/reorder-python-imports: v3.9.0 → v3.12.0](https://github.com/asottile/reorder-python-imports/compare/v3.9.0...v3.12.0) - [github.com/asottile/setup-cfg-fmt: v2.2.0 → v2.5.0](https://github.com/asottile/setup-cfg-fmt/compare/v2.2.0...v2.5.0) - [github.com/psf/black: 23.1.0 → 23.11.0](https://github.com/psf/black/compare/23.1.0...23.11.0) - https://github.com/charliermarsh/ruff-pre-commit → https://github.com/astral-sh/ruff-pre-commit - [github.com/astral-sh/ruff-pre-commit: v0.0.241 → v0.1.6](https://github.com/astral-sh/ruff-pre-commit/compare/v0.0.241...v0.1.6) - [github.com/dosisod/refurb: v1.10.0 → v1.24.0](https://github.com/dosisod/refurb/compare/v1.10.0...v1.24.0) - [github.com/executablebooks/mdformat: 0.7.16 → 0.7.17](https://github.com/executablebooks/mdformat/compare/0.7.16...0.7.17) - [github.com/executablebooks/mdformat: 0.7.16 → 0.7.17](https://github.com/executablebooks/mdformat/compare/0.7.16...0.7.17) - [github.com/codespell-project/codespell: v2.2.2 → v2.2.6](https://github.com/codespell-project/codespell/compare/v2.2.2...v2.2.6) - [github.com/pre-commit/mirrors-mypy: v0.991 → v1.7.0](https://github.com/pre-commit/mirrors-mypy/compare/v0.991...v1.7.0) --- .pre-commit-config.yaml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 74e785d..840570b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,7 +5,7 @@ exclude: | repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.4.0 + rev: v4.5.0 hooks: - id: check-added-large-files args: ['--maxkb=25'] @@ -34,12 +34,12 @@ repos: - id: python-no-log-warn - id: python-use-type-annotations - id: text-unicode-replacement-char -- repo: https://github.com/asottile/reorder_python_imports - rev: v3.9.0 +- repo: https://github.com/asottile/reorder-python-imports + rev: v3.12.0 hooks: - id: reorder-python-imports - repo: https://github.com/asottile/setup-cfg-fmt - rev: v2.2.0 + rev: v2.5.0 hooks: - id: setup-cfg-fmt exclude: | @@ -47,17 +47,17 @@ repos: {{cookiecutter.project_slug}}/setup.cfg )$ - repo: https://github.com/psf/black - rev: 23.1.0 + rev: 23.11.0 hooks: - id: black -- repo: https://github.com/charliermarsh/ruff-pre-commit - rev: v0.0.241 +- repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.1.6 hooks: - id: ruff args: [hooks, tests] pass_filenames: false - repo: https://github.com/dosisod/refurb - rev: v1.10.0 + rev: v1.24.0 hooks: - id: refurb args: [--ignore, FURB126] @@ -77,7 +77,7 @@ repos: ] pass_filenames: false - repo: https://github.com/executablebooks/mdformat - rev: 0.7.16 + rev: 0.7.17 hooks: - id: mdformat additional_dependencies: [ @@ -91,7 +91,7 @@ repos: {{cookiecutter.project_slug}}/README.md )$ - repo: https://github.com/executablebooks/mdformat - rev: 0.7.16 + rev: 0.7.17 hooks: - id: mdformat additional_dependencies: [ @@ -106,12 +106,12 @@ repos: # path/to/file.py # )$ - repo: https://github.com/codespell-project/codespell - rev: v2.2.2 + rev: v2.2.6 hooks: - id: codespell additional_dependencies: [tomli] - repo: https://github.com/pre-commit/mirrors-mypy - rev: 'v0.991' + rev: 'v1.7.0' hooks: - id: mypy args: [ From 0ae1d8704da96f054aa9cd6ba641e3cf22445375 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 20 Nov 2023 18:04:51 +0000 Subject: [PATCH 02/17] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index de71e78..2a34310 100644 --- a/setup.cfg +++ b/setup.cfg @@ -7,7 +7,7 @@ url = https://cookiecutter-pytask-project.readthedocs.io/en/latest author = Tobias Raabe author_email = raabe@posteo.de license = MIT -license_file = LICENSE +license_files = LICENSE platforms = unix, linux, osx, cygwin, win32 classifiers = Development Status :: 3 - Alpha From dee4355ef531ff55256998b987187dfcfd2b1ad2 Mon Sep 17 00:00:00 2001 From: Tobias Raabe Date: Wed, 22 Nov 2023 23:05:31 +0100 Subject: [PATCH 03/17] Fix. --- .github/workflows/main.yml | 18 ++--- .pre-commit-config.yaml | 38 +-------- .readthedocs.yaml | 17 ++-- docs/docs_environment.yml | 23 ------ hooks/post_gen_project.py | 9 ++- hooks/pre_gen_project.py | 7 +- pyproject.toml | 84 ++++++++++++++++---- setup.cfg | 35 -------- tox.ini | 35 +------- {{cookiecutter.project_slug}}/pyproject.toml | 30 ++++--- {{cookiecutter.project_slug}}/tox.ini | 15 ---- 11 files changed, 122 insertions(+), 189 deletions(-) delete mode 100644 docs/docs_environment.yml delete mode 100644 setup.cfg diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 67c338d..8e5df26 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -27,20 +27,16 @@ jobs: fail-fast: false matrix: os: ['ubuntu-latest', 'macos-latest', 'windows-latest'] - python-version: ['3.8', '3.9', '3.10', '3.11'] + python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] steps: - - uses: actions/checkout@v3 - - uses: mamba-org/provision-with-micromamba@main + - uses: actions/checkout@v4 + - uses: actions/setup-python@v4 with: - environment-file: false - environment-name: gha-testing - channels: conda-forge,nodefaults - extra-specs: | - python=${{ matrix.python-version }} - mamba - tox-conda - cache-downloads: true + python-version: ${{ matrix.python-version }} + cache: pip + allow-prereleases: true + - run: pip install tox - name: Run end-to-end tests. shell: bash -l {0} diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 840570b..70a3168 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -34,48 +34,20 @@ repos: - id: python-no-log-warn - id: python-use-type-annotations - id: text-unicode-replacement-char -- repo: https://github.com/asottile/reorder-python-imports - rev: v3.12.0 - hooks: - - id: reorder-python-imports -- repo: https://github.com/asottile/setup-cfg-fmt - rev: v2.5.0 - hooks: - - id: setup-cfg-fmt - exclude: | - (?x)^( - {{cookiecutter.project_slug}}/setup.cfg - )$ -- repo: https://github.com/psf/black - rev: 23.11.0 - hooks: - - id: black - repo: https://github.com/astral-sh/ruff-pre-commit rev: v0.1.6 hooks: - id: ruff - args: [hooks, tests] + args: [--config, pyproject.toml, hooks, tests] pass_filenames: false + - id: ruff-format + args: [--config, pyproject.toml] - repo: https://github.com/dosisod/refurb rev: v1.24.0 hooks: - id: refurb args: [--ignore, FURB126] exclude: ({{cookiecutter.project_slug}}) -- repo: https://github.com/econchick/interrogate - rev: 1.5.0 - hooks: - - id: interrogate - args: [ - -v, - --fail-under=40, - --config, - pyproject.toml, - "{{cookiecutter.project_slug}}", - --exclude, - "{{cookiecutter.project_slug}}/tests/test_import.py" - ] - pass_filenames: false - repo: https://github.com/executablebooks/mdformat rev: 0.7.17 hooks: @@ -114,10 +86,6 @@ repos: rev: 'v1.7.0' hooks: - id: mypy - args: [ - --no-strict-optional, - --ignore-missing-imports, - ] pass_filenames: false - repo: meta hooks: diff --git a/.readthedocs.yaml b/.readthedocs.yaml index c0065fa..1478786 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -1,10 +1,17 @@ version: 2 build: - image: latest + os: ubuntu-22.04 + tools: + python: "3.10" -python: - version: 3.8 +sphinx: + configuration: docs/source/conf.py + fail_on_warning: true -conda: - environment: docs/docs_environment.yml +python: + install: + - method: pip + path: . + extra_requirements: + - docs diff --git a/docs/docs_environment.yml b/docs/docs_environment.yml deleted file mode 100644 index 06269f1..0000000 --- a/docs/docs_environment.yml +++ /dev/null @@ -1,23 +0,0 @@ -channels: - - conda-forge - - nodefaults - -dependencies: - - python >= 3.8 - - pip >=21.1 - - setuptools_scm - - toml - - # Documentation - - furo - - ipython - - nbsphinx - - myst-parser - - sphinx - - sphinx-autoapi - - sphinx-copybutton - - sphinx-panels - - - pip: - - ../ - - sphinxext-opengraph diff --git a/hooks/post_gen_project.py b/hooks/post_gen_project.py index efe9511..1268299 100644 --- a/hooks/post_gen_project.py +++ b/hooks/post_gen_project.py @@ -1,4 +1,4 @@ -"""This module contains hooks which are executed after the template is rendered.""" +"""Contains hooks which are executed after the template is rendered.""" from __future__ import annotations import shutil @@ -39,7 +39,9 @@ def main() -> None: remove_file(project_path, ".readthedocs.yaml") subprocess.run( - ("git", "init", "--initial-branch", "main"), check=True, capture_output=True + ("git", "init", "--initial-branch", "main"), + check=True, + capture_output=True, ) if "{{ cookiecutter.make_initial_commit }}" == "yes": @@ -81,7 +83,8 @@ def main() -> None: else: warnings.warn( "conda environment could not be created since no conda or mamba " - "executable was found." + "executable was found.", + stacklevel=1, ) diff --git a/hooks/pre_gen_project.py b/hooks/pre_gen_project.py index 66e93ac..803aa36 100644 --- a/hooks/pre_gen_project.py +++ b/hooks/pre_gen_project.py @@ -1,4 +1,4 @@ -"""This module contains hooks which are executed before the template is rendered.""" +"""Contains hooks which are executed before the template is rendered.""" import re MODULE_REGEX = r"^[_a-zA-Z][_a-zA-Z0-9]*$" @@ -36,7 +36,7 @@ def main() -> None: if not re.match(ENVIRON_REGEX, environment_name): raise ValueError( - EXCEPTION_MSG_ENVIRON_NAME.format(environment_name=environment_name) + EXCEPTION_MSG_ENVIRON_NAME.format(environment_name=environment_name), ) python_version = "{{ cookiecutter.python_version }}" @@ -44,7 +44,8 @@ def main() -> None: if not re.match(PYTHONVERSION_REGEX, python_version): raise ValueError( EXCEPTION_MSG_PYTHONVERSION.format( - min_python_version=PYTHONVERSION_MIN, python_version=python_version + min_python_version=PYTHONVERSION_MIN, + python_version=python_version, ), ) diff --git a/pyproject.toml b/pyproject.toml index 0d65a3a..ca0af6d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,6 +7,53 @@ build-backend = "setuptools.build_meta" write_to = "version.py" +[project] +name = "cookiecutter_pytask_project" +description = "A minimal cookiecutter template for a project with pytask." +classifiers = [ "Development Status :: 3 - Alpha", "Environment :: Console", "Intended Audience :: Science/Research", "License :: OSI Approved :: MIT License", "Operating System :: MacOS :: MacOS X", "Operating System :: Microsoft :: Windows", "Operating System :: POSIX", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3 :: Only", "Topic :: Scientific/Engineering", "Topic :: Software Development :: Build Tools",] +requires-python = ">=3.8" +dynamic = ["version"] +dependencies = ["cookiecutter"] + +[[project.authors]] +name = "Tobias Raabe" +email = "raabe@posteo.de" + +[project.optional-dependencies] +tests = ["pytest", "pytest-cookies", "pytest-cov", "pytest-xdist"] +docs = [ + "furo", + "ipython", + "myst-parser", + "nbsphinx", + "sphinx", + "sphinx-click", + "sphinx-copybutton", + "sphinx-design>=0.3", + "sphinx-toolbox", + "sphinxext-opengraph", +] + +[project.readme] +file = "README.md" +content-type = "text/markdown" + +[project.license] +text = "MIT" + +[project.urls] +Homepage = "https://cookiecutter-pytask-project.readthedocs.io/en/latest" +Changelog = "https://cookiecutter-pytask-project.readthedocs.io/en/latest/changes.html" +Documentation = "https://cookiecutter-pytask-project.readthedocs.io/en/latest" +Github = "https://github.com/pytask-dev/cookiecutter-pytask-project" +Tracker = "https://github.com/pytask-dev/cookiecutter-pytask-project/issues" + +[tool.setuptools] +platforms = [ "unix", "linux", "osx", "cygwin", "win32",] +license-files = [ "LICENSE"] +include-package-data = false + + [tool.mypy] files = ["hooks", "tests"] exclude = "{{cookiecutter.project_slug}}" @@ -26,7 +73,7 @@ ignore_errors = true [tool.ruff] -target-version = "py37" +target-version = "py38" select = ["ALL"] fix = true extend-ignore = [ @@ -41,26 +88,33 @@ extend-ignore = [ "D416", "D417", # Others. - "D404", # Do not start module docstring with "This". - "RET504", # unnecessary variable assignment before return. - "S101", # raise errors for asserts. - "B905", # strict parameter for zip that was implemented in py310. "I", # ignore isort - "ANN101", # type annotating self - "ANN102", # type annotating cls - "FBT", # flake8-boolean-trap - "EM", # flake8-errmsg - "ANN401", # flake8-annotate typing.Any - "PD", # pandas-vet - "COM812", # trailing comma missing, but black takes care of that + "COM812", # Comply with ruff-format. + "ISC001", # Comply with ruff-format. ] [tool.ruff.per-file-ignores] -"tests/*" = ["D", "ANN"] -"hooks/post_gen_project.py" = ["PLR0133"] -"hooks/*" = ["INP001"] +"tests/*" = ["D", "ANN", "S101", "S603"] +"hooks/post_gen_project.py" = ["PLR0133", "S603"] [tool.ruff.pydocstyle] convention = "numpy" + + +[tool.pytest.ini_options] +addopts = ["--doctest-modules"] +testpaths = ["tests"] +filterwarnings = [ + "ignore: the imp module is deprecated in favour of importlib", + "ignore: Using or importing the ABCs from 'collections' instead of from", + "ignore: The (parser|symbol) module is deprecated and will be removed in future", +] +markers = [ + "wip: Tests that are work-in-progress.", + "unit: Flag for unit tests which target mainly a single function.", + "integration: Flag for integration tests which may comprise of multiple unit tests.", + "end_to_end: Flag for tests that cover the whole program.", +] +norecursedirs = [".idea", ".tox"] diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 2a34310..0000000 --- a/setup.cfg +++ /dev/null @@ -1,35 +0,0 @@ -[metadata] -name = cookiecutter_pytask_project -description = A minimal cookiecutter template for a project with pytask. -long_description = file: README.md -long_description_content_type = text/markdown -url = https://cookiecutter-pytask-project.readthedocs.io/en/latest -author = Tobias Raabe -author_email = raabe@posteo.de -license = MIT -license_files = LICENSE -platforms = unix, linux, osx, cygwin, win32 -classifiers = - Development Status :: 3 - Alpha - Environment :: Console - Intended Audience :: Science/Research - License :: OSI Approved :: MIT License - Operating System :: MacOS :: MacOS X - Operating System :: Microsoft :: Windows - Operating System :: POSIX - Programming Language :: Python :: 3 - Programming Language :: Python :: 3 :: Only - Topic :: Scientific/Engineering - Topic :: Software Development :: Build Tools -project_urls = - Changelog = https://cookiecutter-pytask-project.readthedocs.io/en/latest/changes.html - Documentation = https://cookiecutter-pytask-project.readthedocs.io/en/latest - Github = https://github.com/pytask-dev/cookiecutter-pytask-project - Tracker = https://github.com/pytask-dev/cookiecutter-pytask-project/issues - -[options] -python_requires = >=3.8 - -[check-manifest] -ignore = - version.py diff --git a/tox.ini b/tox.ini index 470470c..507e5c3 100644 --- a/tox.ini +++ b/tox.ini @@ -6,45 +6,14 @@ usedevelop = true passenv = CI [testenv:pytest] -conda_channels = - conda-forge - nodefaults -conda_deps = - # pytest - pytest - ; pytest-cookies>=0.6.2 - pytest-cov - pytest-xdist - - # Package dependencies - cookiecutter - -deps = - git+https://github.com/andriihomiak/pytest-cookies.git@fix/quotes_in_user_config +extras = test commands = pytest {posargs} [testenv:sphinx] +extras = docs changedir = docs/source -conda_env = docs/docs_environment.yml commands = sphinx-build -T -b html -d {envtmpdir}/doctrees . {envtmpdir}/html - sphinx-build -T -b linkcheck -d {envtmpdir}/doctrees . {envtmpdir}/linkcheck - -[pytest] -addopts = --doctest-modules -testpaths = - tests -filterwarnings = - ignore: the imp module is deprecated in favour of importlib - ignore: Using or importing the ABCs from 'collections' instead of from - ignore: The (parser|symbol) module is deprecated and will be removed in future -markers = - wip: Tests that are work-in-progress. - unit: Flag for unit tests which target mainly a single function. - integration: Flag for integration tests which may comprise of multiple unit tests. - end_to_end: Flag for tests that cover the whole program. -norecursedirs = - .idea - .tox diff --git a/{{cookiecutter.project_slug}}/pyproject.toml b/{{cookiecutter.project_slug}}/pyproject.toml index 05f08af..bdc6d15 100644 --- a/{{cookiecutter.project_slug}}/pyproject.toml +++ b/{{cookiecutter.project_slug}}/pyproject.toml @@ -44,18 +44,9 @@ extend-ignore = [ "D416", "D417", # Others. - "D404", # Do not start module docstring with "This". - "RET504", # unnecessary variable assignment before return. - "S101", # raise errors for asserts. - "B905", # strict parameter for zip that was implemented in py310. "I", # ignore isort - "ANN101", # type annotating self - "ANN102", # type annotating cls - "FBT", # flake8-boolean-trap - "EM", # flake8-errmsg - "ANN401", # flake8-annotate typing.Any - "PD", # pandas-vet - "COM812", # trailing comma missing, but black takes care of that + "COM812", # Comply with ruff-format. + "ISC001", # Comply with ruff-format. ] @@ -66,3 +57,20 @@ extend-ignore = [ [tool.ruff.pydocstyle] convention = "numpy" + + +[tool.pytest.ini_options] +addopts = ["--doctest-modules"] +testpaths = ["tests"] +filterwarnings = [ + "ignore: the imp module is deprecated in favour of importlib", + "ignore: Using or importing the ABCs from 'collections' instead of from", + "ignore: The (parser|symbol) module is deprecated and will be removed in future", +] +markers = [ + "wip: Tests that are work-in-progress.", + "unit: Flag for unit tests which target mainly a single function.", + "integration: Flag for integration tests which may comprise of multiple unit tests.", + "end_to_end: Flag for tests that cover the whole program.", +] +norecursedirs = [".idea", ".tox"] diff --git a/{{cookiecutter.project_slug}}/tox.ini b/{{cookiecutter.project_slug}}/tox.ini index a39f6d0..2071010 100644 --- a/{{cookiecutter.project_slug}}/tox.ini +++ b/{{cookiecutter.project_slug}}/tox.ini @@ -20,18 +20,3 @@ conda_deps = commands = pytest {posargs} - -[pytest] -addopts = --doctest-modules -filterwarnings = - ignore: the imp module is deprecated in favour of importlib - ignore: Using or importing the ABCs from 'collections' instead of from - ignore: The (parser|symbol) module is deprecated and will be removed in future -markers = - wip: Tests that are work-in-progress. - unit: Flag for unit tests which target mainly a single function. - integration: Flag for integration tests which may comprise of multiple unit tests. - end_to_end: Flag for tests that cover the whole program. -norecursedirs = - .idea - .tox From ad7e854085a23f2a28315fab989658fad1711ceb Mon Sep 17 00:00:00 2001 From: Tobias Raabe Date: Wed, 22 Nov 2023 23:23:13 +0100 Subject: [PATCH 04/17] fix. --- .github/workflows/main.yml | 2 +- tox.ini | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8e5df26..6d26ba1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -43,6 +43,6 @@ jobs: run: tox -e pytest -- tests -m end_to_end --cov=./ --cov-report=xml -n auto - name: Upload coverage reports of end-to-end tests. - if: runner.os == 'Linux' && matrix.python-version == '3.9' + if: runner.os == 'Linux' && matrix.python-version == '3.10' shell: bash -l {0} run: bash <(curl -s https://codecov.io/bash) -F end_to_end -c diff --git a/tox.ini b/tox.ini index 507e5c3..8131d70 100644 --- a/tox.ini +++ b/tox.ini @@ -6,6 +6,7 @@ usedevelop = true passenv = CI [testenv:pytest] +allowlist_externals = pytest extras = test commands = From 5abb94306c20fe8195fdd12aa04bc0f65f8dfa82 Mon Sep 17 00:00:00 2001 From: Tobias Raabe Date: Wed, 22 Nov 2023 23:26:03 +0100 Subject: [PATCH 05/17] fix. --- .github/workflows/main.yml | 2 +- pyproject.toml | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6d26ba1..de0d9f8 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -40,7 +40,7 @@ jobs: - name: Run end-to-end tests. shell: bash -l {0} - run: tox -e pytest -- tests -m end_to_end --cov=./ --cov-report=xml -n auto + run: tox -e pytest -- tests -m end_to_end --cov=./ --cov-report=xml - name: Upload coverage reports of end-to-end tests. if: runner.os == 'Linux' && matrix.python-version == '3.10' diff --git a/pyproject.toml b/pyproject.toml index ca0af6d..7f30513 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -20,7 +20,7 @@ name = "Tobias Raabe" email = "raabe@posteo.de" [project.optional-dependencies] -tests = ["pytest", "pytest-cookies", "pytest-cov", "pytest-xdist"] +tests = ["pytest", "pytest-cookies", "pytest-cov"] docs = [ "furo", "ipython", @@ -95,6 +95,7 @@ extend-ignore = [ [tool.ruff.per-file-ignores] +"hooks/*" = ["INP001"] "tests/*" = ["D", "ANN", "S101", "S603"] "hooks/post_gen_project.py" = ["PLR0133", "S603"] From f27b546023c6497faeba446c7cb85c5db84528b5 Mon Sep 17 00:00:00 2001 From: Tobias Raabe Date: Wed, 22 Nov 2023 23:27:42 +0100 Subject: [PATCH 06/17] fix. --- docs/source/conf.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index 53bf489..67c5fb7 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -35,9 +35,8 @@ "sphinxext.opengraph", "sphinx.ext.viewcode", "sphinx_copybutton", - "sphinx_panels", - "autoapi.extension", "myst_parser", + "sphinx_design", ] # Add any paths that contain templates here, relative to this directory. From 8f3bda739acbb6f202b04b4cdd5c3576e28bbe1d Mon Sep 17 00:00:00 2001 From: Tobias Raabe Date: Wed, 22 Nov 2023 23:30:27 +0100 Subject: [PATCH 07/17] fix. --- .github/workflows/main.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index de0d9f8..058dcbb 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -38,11 +38,11 @@ jobs: allow-prereleases: true - run: pip install tox - - name: Run end-to-end tests. + - name: Run tests. shell: bash -l {0} - run: tox -e pytest -- tests -m end_to_end --cov=./ --cov-report=xml + run: tox -e pytest -- --cov=./ --cov-report=xml - - name: Upload coverage reports of end-to-end tests. + - name: Upload coverage reports of tests. if: runner.os == 'Linux' && matrix.python-version == '3.10' shell: bash -l {0} - run: bash <(curl -s https://codecov.io/bash) -F end_to_end -c + run: bash <(curl -s https://codecov.io/bash) From 7ad4b657231d997abc336c41fda2296fd0ece700 Mon Sep 17 00:00:00 2001 From: Tobias Raabe Date: Thu, 23 Nov 2023 11:52:27 +0100 Subject: [PATCH 08/17] fix. --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 058dcbb..bf19a04 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -40,7 +40,7 @@ jobs: - name: Run tests. shell: bash -l {0} - run: tox -e pytest -- --cov=./ --cov-report=xml + run: tox -e pytest - name: Upload coverage reports of tests. if: runner.os == 'Linux' && matrix.python-version == '3.10' From 78f433865b68431fee42e8f2dcbd961fdef03ccd Mon Sep 17 00:00:00 2001 From: Tobias Raabe Date: Thu, 23 Nov 2023 11:56:11 +0100 Subject: [PATCH 09/17] Fix. --- .github/workflows/main.yml | 2 +- pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index bf19a04..058dcbb 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -40,7 +40,7 @@ jobs: - name: Run tests. shell: bash -l {0} - run: tox -e pytest + run: tox -e pytest -- --cov=./ --cov-report=xml - name: Upload coverage reports of tests. if: runner.os == 'Linux' && matrix.python-version == '3.10' diff --git a/pyproject.toml b/pyproject.toml index 7f30513..9e94d80 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -20,7 +20,6 @@ name = "Tobias Raabe" email = "raabe@posteo.de" [project.optional-dependencies] -tests = ["pytest", "pytest-cookies", "pytest-cov"] docs = [ "furo", "ipython", @@ -33,6 +32,7 @@ docs = [ "sphinx-toolbox", "sphinxext-opengraph", ] +test = ["pytest", "pytest-cookies", "pytest-cov"] [project.readme] file = "README.md" From 1adb059e311ad28793db0bb4bce8b2cc72db89b2 Mon Sep 17 00:00:00 2001 From: Tobias Raabe Date: Thu, 23 Nov 2023 11:58:21 +0100 Subject: [PATCH 10/17] fix. --- docs/source/api.md | 12 ------------ docs/source/index.md | 1 - 2 files changed, 13 deletions(-) delete mode 100644 docs/source/api.md diff --git a/docs/source/api.md b/docs/source/api.md deleted file mode 100644 index c63fd9c..0000000 --- a/docs/source/api.md +++ /dev/null @@ -1,12 +0,0 @@ -# API Reference - -The following documents are auto-generated and not carefully edited. They provide direct -access to the source code and the docstrings. - -```{toctree} ---- -titlesonly: true ---- -/autoapi/pre_gen_project/index -/autoapi/post_gen_project/index -``` diff --git a/docs/source/index.md b/docs/source/index.md index ffb6e99..0093590 100644 --- a/docs/source/index.md +++ b/docs/source/index.md @@ -47,5 +47,4 @@ maxdepth: 1 --- faq changes -api ``` From 428e494f26087e38132b30171fb72a8a8b617cc6 Mon Sep 17 00:00:00 2001 From: Tobias Raabe Date: Thu, 23 Nov 2023 12:06:50 +0100 Subject: [PATCH 11/17] Fix. --- .github/workflows/main.yml | 2 +- docs/source/conf.py | 19 ++++--------------- tox.ini | 6 +++--- 3 files changed, 8 insertions(+), 19 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 058dcbb..27413a5 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -40,7 +40,7 @@ jobs: - name: Run tests. shell: bash -l {0} - run: tox -e pytest -- --cov=./ --cov-report=xml + run: tox -e test -- --cov=./ --cov-report=xml - name: Upload coverage reports of tests. if: runner.os == 'Linux' && matrix.python-version == '3.10' diff --git a/docs/source/conf.py b/docs/source/conf.py index 67c5fb7..d57a7a9 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -47,12 +47,6 @@ # html_extra_path. exclude_patterns = ["build", "Thumbs.db", ".DS_Store", "**.ipynb_checkpoints"] -# Configuration for autoapi to generate and API page. -autoapi_type = "python" -autoapi_dirs = ["../../hooks"] -autoapi_keep_files = False -autoapi_add_toctree_entry = False - # Remove prefixed $ for bash, >>> for Python prompts, and In [1]: for IPython prompts. copybutton_prompt_text = r"\$ |>>> |In \[\d\]: " copybutton_prompt_is_regexp = True @@ -60,10 +54,10 @@ # Use these roles to create links to github users and pull requests. _repo = "https://github.com/pytask-dev/cookiecutter-pytask-project" extlinks = { - "pypi": ("https://pypi.org/project/%s/", ""), - "issue": (f"{_repo}/issues/%s", "issue #"), - "pull": (f"{_repo}/pull/%s", "pull request #"), - "user": ("https://github.com/%s", "@"), + "pypi": ("https://pypi.org/project/%s/", "%s"), + "issue": (f"{_repo}/issues/%s", "issue #%s"), + "pull": (f"{_repo}/pull/%s", "pull request #%s"), + "user": ("https://github.com/%s", "@%s"), } # Link objects to other documentations. @@ -84,8 +78,3 @@ pygments_style = "sphinx" pygments_dark_style = "monokai" - -# Add any paths that contain custom static files (such as style sheets) here, relative -# to this directory. They are copied after the builtin static files, so a file named -# "default.css" will overwrite the builtin "default.css". -html_static_path = ["_static"] diff --git a/tox.ini b/tox.ini index 8131d70..dd200b0 100644 --- a/tox.ini +++ b/tox.ini @@ -1,18 +1,18 @@ [tox] -envlist = pytest, sphinx +envlist = test, docs [testenv] usedevelop = true passenv = CI -[testenv:pytest] +[testenv:test] allowlist_externals = pytest extras = test commands = pytest {posargs} -[testenv:sphinx] +[testenv:docs] extras = docs changedir = docs/source commands = From 4d445101cd1df17eab5104bc5e5d9ae6918525d3 Mon Sep 17 00:00:00 2001 From: Tobias Raabe Date: Thu, 23 Nov 2023 12:19:42 +0100 Subject: [PATCH 12/17] Fix. --- .pre-commit-config.yaml | 4 ++ .../.github/workflows/main.yml | 8 ++-- .../.pre-commit-config.yaml | 43 ++++++------------- {{cookiecutter.project_slug}}/pyproject.toml | 2 +- .../{{cookiecutter.project_slug}}/__init__.py | 2 +- .../{{cookiecutter.project_slug}}/config.py | 2 +- 6 files changed, 23 insertions(+), 38 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 70a3168..1a98e2c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -34,6 +34,10 @@ repos: - id: python-no-log-warn - id: python-use-type-annotations - id: text-unicode-replacement-char +- repo: https://github.com/asottile/reorder_python_imports + rev: v3.9.0 + hooks: + - id: reorder-python-imports - repo: https://github.com/astral-sh/ruff-pre-commit rev: v0.1.6 hooks: diff --git a/{{cookiecutter.project_slug}}/.github/workflows/main.yml b/{{cookiecutter.project_slug}}/.github/workflows/main.yml index d38e20e..45adfcc 100644 --- a/{{cookiecutter.project_slug}}/.github/workflows/main.yml +++ b/{{cookiecutter.project_slug}}/.github/workflows/main.yml @@ -27,7 +27,7 @@ jobs: fail-fast: false matrix: os: ['ubuntu-latest', 'macos-latest', 'windows-latest'] - python-version: ['3.8', '3.9', '3.10', '3.11'] + python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] steps: - uses: actions/checkout@v3 @@ -49,7 +49,7 @@ jobs: run: tox -e pytest -- src tests -m "unit or (not integration and not end_to_end)" --cov=./ --cov-report=xml -n auto - name: Upload coverage report for unit tests and doctests. - if: runner.os == 'Linux' && matrix.python-version == '3.9' + if: runner.os == 'Linux' && matrix.python-version == '3.10' shell: bash -l {0} run: bash <(curl -s https://codecov.io/bash) -F unit -c @@ -58,7 +58,7 @@ jobs: run: tox -e pytest -- src tests -m integration --cov=./ --cov-report=xml -n auto - name: Upload coverage reports of integration tests. - if: runner.os == 'Linux' && matrix.python-version == '3.9' + if: runner.os == 'Linux' && matrix.python-version == '3.10' shell: bash -l {0} run: bash <(curl -s https://codecov.io/bash) -F integration -c @@ -67,6 +67,6 @@ jobs: run: tox -e pytest -- src tests -m end_to_end --cov=./ --cov-report=xml -n auto - name: Upload coverage reports of end-to-end tests. - if: runner.os == 'Linux' && matrix.python-version == '3.9' + if: runner.os == 'Linux' && matrix.python-version == '3.10' shell: bash -l {0} run: bash <(curl -s https://codecov.io/bash) -F end_to_end -c diff --git a/{{cookiecutter.project_slug}}/.pre-commit-config.yaml b/{{cookiecutter.project_slug}}/.pre-commit-config.yaml index 4d341aa..1dcb601 100644 --- a/{{cookiecutter.project_slug}}/.pre-commit-config.yaml +++ b/{{cookiecutter.project_slug}}/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.4.0 + rev: v4.5.0 hooks: - id: check-added-large-files args: ['--maxkb=25'] @@ -16,7 +16,7 @@ repos: args: [--branch, main] - id: trailing-whitespace - repo: https://github.com/pre-commit/pygrep-hooks - rev: v1.9.0 + rev: v1.10.0 hooks: - id: python-check-blanket-noqa - id: python-check-mock-methods @@ -24,46 +24,27 @@ repos: - id: python-no-log-warn - id: python-use-type-annotations - id: text-unicode-replacement-char -- repo: https://github.com/asottile/pyupgrade - rev: v3.3.1 - hooks: - - id: pyupgrade - args: [--py37-plus] - repo: https://github.com/asottile/reorder_python_imports rev: v3.9.0 hooks: - id: reorder-python-imports{% if cookiecutter.add_mypy == "yes" %} - args: [--py37-plus, --add-import, 'from __future__ import annotations']{% endif %} + args: [--py38-plus, --add-import, 'from __future__ import annotations']{% endif %} - repo: https://github.com/asottile/setup-cfg-fmt rev: v2.2.0 hooks: - id: setup-cfg-fmt -- repo: https://github.com/psf/black - rev: 23.1.0 - hooks: - - id: black -- repo: https://github.com/PyCQA/docformatter - rev: v1.5.1 - hooks: - - id: docformatter - args: [--in-place, --wrap-summaries, "88", --wrap-descriptions, "88", --blank] -{% if cookiecutter.python_version in ["3.10", "3.11", "3.12"] %}- repo: https://github.com/charliermarsh/ruff-pre-commit - rev: v0.0.241 +- repo: https://github.com/charliermarsh/ruff-pre-commit + rev: v0.1.6 hooks: - id: ruff -- repo: https://github.com/dosisod/refurb - rev: v1.10.0 + - id: ruff-format +{% if cookiecutter.python_version in ["3.10", "3.11", "3.12"] %}- repo: https://github.com/dosisod/refurb + rev: v1.24.0 hooks: - id: refurb - args: [--ignore, FURB126] {% endif %} -- repo: https://github.com/econchick/interrogate - rev: 1.5.0 - hooks: - - id: interrogate - args: [-v, --fail-under=40] - repo: https://github.com/executablebooks/mdformat - rev: 0.7.16 + rev: 0.7.17 hooks: - id: mdformat additional_dependencies: [ @@ -73,7 +54,7 @@ repos: args: [--wrap, "88"] files: (README\.md) - repo: https://github.com/executablebooks/mdformat - rev: 0.7.16 + rev: 0.7.17 hooks: - id: mdformat additional_dependencies: [ @@ -88,7 +69,7 @@ repos: # path/to/file.py # )$ {% if cookiecutter.add_mypy == "yes" %}- repo: https://github.com/pre-commit/mirrors-mypy - rev: 'v0.991' + rev: 'v1.7.0' hooks: - id: mypy args: [ @@ -97,7 +78,7 @@ repos: ] pass_filenames: false {% endif %}- repo: https://github.com/codespell-project/codespell - rev: v2.2.2 + rev: v2.2.6 hooks: - id: codespell - repo: meta diff --git a/{{cookiecutter.project_slug}}/pyproject.toml b/{{cookiecutter.project_slug}}/pyproject.toml index bdc6d15..6894f22 100644 --- a/{{cookiecutter.project_slug}}/pyproject.toml +++ b/{{cookiecutter.project_slug}}/pyproject.toml @@ -51,7 +51,7 @@ extend-ignore = [ [tool.ruff.per-file-ignores] -"tests/*" = ["D", "ANN"] +"tests/*" = ["D", "ANN", "S101"] "docs/source/conf.py" = ["INP001"] diff --git a/{{cookiecutter.project_slug}}/src/{{cookiecutter.project_slug}}/__init__.py b/{{cookiecutter.project_slug}}/src/{{cookiecutter.project_slug}}/__init__.py index 075592e..6e5ee2d 100644 --- a/{{cookiecutter.project_slug}}/src/{{cookiecutter.project_slug}}/__init__.py +++ b/{{cookiecutter.project_slug}}/src/{{cookiecutter.project_slug}}/__init__.py @@ -1,4 +1,4 @@ -"""This module contains the main namespace of {{ cookiecutter.project_slug }}.""" +"""Contains the main namespace of {{ cookiecutter.project_slug }}.""" # Import the version from _version.py which is dynamically created by setuptools-scm # when the project is installed with ``pip install -e .``. Do not put it into version # control! diff --git a/{{cookiecutter.project_slug}}/src/{{cookiecutter.project_slug}}/config.py b/{{cookiecutter.project_slug}}/src/{{cookiecutter.project_slug}}/config.py index cb77e44..20862ce 100644 --- a/{{cookiecutter.project_slug}}/src/{{cookiecutter.project_slug}}/config.py +++ b/{{cookiecutter.project_slug}}/src/{{cookiecutter.project_slug}}/config.py @@ -1,4 +1,4 @@ -"""This module contains the general configuration of the project.""" +"""Contains the general configuration of the project.""" from pathlib import Path From 337b0639c2a995ffc76d9d56cdd65a9d07c02aaf Mon Sep 17 00:00:00 2001 From: Tobias Raabe Date: Thu, 23 Nov 2023 12:45:24 +0100 Subject: [PATCH 13/17] fix. --- .pre-commit-config.yaml | 4 ++++ {{cookiecutter.project_slug}}/.pre-commit-config.yaml | 4 ++++ {{cookiecutter.project_slug}}/.readthedocs.yaml | 2 +- .../docs/docs_environment.yml | 5 ++--- {{cookiecutter.project_slug}}/docs/source/api.md | 11 ----------- {{cookiecutter.project_slug}}/docs/source/conf.py | 3 ++- {{cookiecutter.project_slug}}/docs/source/index.md | 1 - {{cookiecutter.project_slug}}/tests/__init__.py | 2 +- {{cookiecutter.project_slug}}/tox.ini | 1 - 9 files changed, 14 insertions(+), 19 deletions(-) delete mode 100644 {{cookiecutter.project_slug}}/docs/source/api.md diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1a98e2c..668bff7 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -38,6 +38,10 @@ repos: rev: v3.9.0 hooks: - id: reorder-python-imports +- repo: https://github.com/aio-libs/sort-all + rev: v1.2.0 + hooks: + - id: sort-all - repo: https://github.com/astral-sh/ruff-pre-commit rev: v0.1.6 hooks: diff --git a/{{cookiecutter.project_slug}}/.pre-commit-config.yaml b/{{cookiecutter.project_slug}}/.pre-commit-config.yaml index 1dcb601..073e902 100644 --- a/{{cookiecutter.project_slug}}/.pre-commit-config.yaml +++ b/{{cookiecutter.project_slug}}/.pre-commit-config.yaml @@ -33,6 +33,10 @@ repos: rev: v2.2.0 hooks: - id: setup-cfg-fmt +- repo: https://github.com/aio-libs/sort-all + rev: v1.2.0 + hooks: + - id: sort-all - repo: https://github.com/charliermarsh/ruff-pre-commit rev: v0.1.6 hooks: diff --git a/{{cookiecutter.project_slug}}/.readthedocs.yaml b/{{cookiecutter.project_slug}}/.readthedocs.yaml index c0065fa..b508b44 100644 --- a/{{cookiecutter.project_slug}}/.readthedocs.yaml +++ b/{{cookiecutter.project_slug}}/.readthedocs.yaml @@ -4,7 +4,7 @@ build: image: latest python: - version: 3.8 + version: 3.10 conda: environment: docs/docs_environment.yml diff --git a/{{cookiecutter.project_slug}}/docs/docs_environment.yml b/{{cookiecutter.project_slug}}/docs/docs_environment.yml index d1b83ca..690a754 100644 --- a/{{cookiecutter.project_slug}}/docs/docs_environment.yml +++ b/{{cookiecutter.project_slug}}/docs/docs_environment.yml @@ -3,7 +3,7 @@ channels: - nodefaults dependencies: - - python >= 3.8 + - python >= 3.10 - pip - setuptools_scm - toml @@ -14,9 +14,8 @@ dependencies: - nbsphinx - myst-parser - sphinx - - sphinx-autoapi + - sphinx-design - sphinx-copybutton - - sphinx-panels - pip: - ../ diff --git a/{{cookiecutter.project_slug}}/docs/source/api.md b/{{cookiecutter.project_slug}}/docs/source/api.md deleted file mode 100644 index 929543a..0000000 --- a/{{cookiecutter.project_slug}}/docs/source/api.md +++ /dev/null @@ -1,11 +0,0 @@ -# API Reference - -The following documents are auto-generated and not carefully edited. They provide direct -access to the source code and the docstrings. - -```{toctree} ---- -titlesonly: true ---- -/autoapi/{{ cookiecutter.project_slug }}/index -``` diff --git a/{{cookiecutter.project_slug}}/docs/source/conf.py b/{{cookiecutter.project_slug}}/docs/source/conf.py index 2dddfa3..a2bf086 100644 --- a/{{cookiecutter.project_slug}}/docs/source/conf.py +++ b/{{cookiecutter.project_slug}}/docs/source/conf.py @@ -12,7 +12,8 @@ project = "{{ cookiecutter.project_name }}" project_slug = "{{ cookiecutter.project_slug }}" author = "{{ cookiecutter.author }}" -copyright = f"2022, {author}" # noqa: A001 +year = "{% now 'utc', '%Y' %}" +copyright = f"{year}, {author}" # noqa: A001 # The version, including alpha/beta/rc tags, but not commit hash and datestamps release = version(project_slug) diff --git a/{{cookiecutter.project_slug}}/docs/source/index.md b/{{cookiecutter.project_slug}}/docs/source/index.md index de2601b..0880e27 100644 --- a/{{cookiecutter.project_slug}}/docs/source/index.md +++ b/{{cookiecutter.project_slug}}/docs/source/index.md @@ -6,5 +6,4 @@ caption: 'Contents:' maxdepth: 1 --- changes -api ``` diff --git a/{{cookiecutter.project_slug}}/tests/__init__.py b/{{cookiecutter.project_slug}}/tests/__init__.py index 4045499..c3dc044 100644 --- a/{{cookiecutter.project_slug}}/tests/__init__.py +++ b/{{cookiecutter.project_slug}}/tests/__init__.py @@ -1 +1 @@ -"""This module is necessary to configure mypy's behavior for the tests.""" +"""Is module is necessary to configure mypy's behavior for the tests.""" diff --git a/{{cookiecutter.project_slug}}/tox.ini b/{{cookiecutter.project_slug}}/tox.ini index 2071010..1f2169e 100644 --- a/{{cookiecutter.project_slug}}/tox.ini +++ b/{{cookiecutter.project_slug}}/tox.ini @@ -11,7 +11,6 @@ conda_channels = conda_deps = # pytest pytest - pytest-cookies pytest-cov pytest-xdist From 305ceb310d0ec5fffb77863c901afc71610b101e Mon Sep 17 00:00:00 2001 From: Tobias Raabe Date: Thu, 23 Nov 2023 12:51:08 +0100 Subject: [PATCH 14/17] fix. --- hooks/post_gen_project.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/hooks/post_gen_project.py b/hooks/post_gen_project.py index 1268299..ba7511a 100644 --- a/hooks/post_gen_project.py +++ b/hooks/post_gen_project.py @@ -80,6 +80,30 @@ def main() -> None: check=True, capture_output=True, ) + # Install pre-commit hooks and run them. + subprocess.run( # noqa: PLW1510 + ( + conda_exe, + "run", + "-n", + "{{ cookiecutter.conda_environment_name }}", + "pre-commit", + "install", + ), + capture_output=True, + ) + subprocess.run( # noqa: PLW1510 + ( + conda_exe, + "run", + "-n", + "{{ cookiecutter.conda_environment_name }}", + "pre-commit", + "run", + "--all-files", + ), + capture_output=True, + ) else: warnings.warn( "conda environment could not be created since no conda or mamba " From 39e400193fd4d30b5395d7a6423c837f15344f41 Mon Sep 17 00:00:00 2001 From: Tobias Raabe Date: Thu, 23 Nov 2023 12:52:08 +0100 Subject: [PATCH 15/17] fix. --- {{cookiecutter.project_slug}}/docs/source/conf.py | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/{{cookiecutter.project_slug}}/docs/source/conf.py b/{{cookiecutter.project_slug}}/docs/source/conf.py index a2bf086..c80d432 100644 --- a/{{cookiecutter.project_slug}}/docs/source/conf.py +++ b/{{cookiecutter.project_slug}}/docs/source/conf.py @@ -62,10 +62,10 @@ # Use these roles to create links to github users and pull requests. _repo = "https://github.com/{{ cookiecutter.github_username }}/" + project_slug extlinks = { - "pypi": ("https://pypi.org/project/%s/", ""), - "issue": (f"{_repo}/issues/%s", "issue #"), - "pull": (f"{_repo}/pull/%s", "pull request #"), - "user": ("https://github.com/%s", "@"), + "pypi": ("https://pypi.org/project/%s/", "%s"), + "issue": (f"{_repo}/issues/%s", "issue #%s"), + "pull": (f"{_repo}/pull/%s", "pull request #%s"), + "user": ("https://github.com/%s", "@%s"), } # Link objects to other documentations. @@ -86,8 +86,3 @@ pygments_style = "sphinx" pygments_dark_style = "monokai" - -# Add any paths that contain custom static files (such as style sheets) here, relative -# to this directory. They are copied after the builtin static files, so a file named -# "default.css" will overwrite the builtin "default.css". -html_static_path = ["_static"] From bf6e42ff521a157bd7ae1e39f11b2b1932f0ab53 Mon Sep 17 00:00:00 2001 From: Tobias Raabe Date: Thu, 23 Nov 2023 12:52:39 +0100 Subject: [PATCH 16/17] fix. --- environment.yml | 1 - {{cookiecutter.project_slug}}/docs/source/conf.py | 7 ------- {{cookiecutter.project_slug}}/environment.yml | 1 - 3 files changed, 9 deletions(-) diff --git a/environment.yml b/environment.yml index eee9c8a..6090cbf 100644 --- a/environment.yml +++ b/environment.yml @@ -30,7 +30,6 @@ dependencies: - myst-parser - nbsphinx - sphinx - - sphinx-autoapi - sphinx-copybutton - sphinx-panels diff --git a/{{cookiecutter.project_slug}}/docs/source/conf.py b/{{cookiecutter.project_slug}}/docs/source/conf.py index c80d432..6f3c8dc 100644 --- a/{{cookiecutter.project_slug}}/docs/source/conf.py +++ b/{{cookiecutter.project_slug}}/docs/source/conf.py @@ -37,7 +37,6 @@ "sphinx.ext.viewcode", "sphinx_copybutton", "sphinx_panels", - "autoapi.extension", "myst_parser", ] @@ -49,12 +48,6 @@ # html_extra_path. exclude_patterns = ["build", "Thumbs.db", ".DS_Store", "**.ipynb_checkpoints"] -# Configuration for autoapi to generate and API page. -autoapi_type = "python" -autoapi_dirs = ["../../src"] -autoapi_keep_files = False -autoapi_add_toctree_entry = False - # Remove prefixed $ for bash, >>> for Python prompts, and In [1]: for IPython prompts. copybutton_prompt_text = r"\$ |>>> |In \[\d\]: " copybutton_prompt_is_regexp = True diff --git a/{{cookiecutter.project_slug}}/environment.yml b/{{cookiecutter.project_slug}}/environment.yml index 8bd4daa..ff1f71c 100644 --- a/{{cookiecutter.project_slug}}/environment.yml +++ b/{{cookiecutter.project_slug}}/environment.yml @@ -30,7 +30,6 @@ dependencies: - myst-parser - nbsphinx - sphinx - - sphinx-autoapi - sphinx-copybutton - sphinx-panels From 953a7d30523a71618fd8c3277a26f9fb00297a5a Mon Sep 17 00:00:00 2001 From: Tobias Raabe Date: Thu, 23 Nov 2023 14:04:26 +0100 Subject: [PATCH 17/17] Fix. --- docs/source/changes.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/source/changes.md b/docs/source/changes.md index 2ce32cc..ccc10d9 100644 --- a/docs/source/changes.md +++ b/docs/source/changes.md @@ -3,6 +3,10 @@ This is a record of all past cookiecutter-pytask-project releases and what went into them in reverse chronological order. +## 1.6.0 - 2023-11-23 + +- {pull}`35` modernizes the template. + ## 1.5.0 - 2023-02-04 - {pull}`33` fixes some small things. (Thanks to @hmgaudecker!)