Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
-e .
linkify-it-py
myst-parser
nbsphinx
Expand Down
6 changes: 4 additions & 2 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
# conf.py
# Configuration file for the Sphinx documentation builder.
import setuptools_scm
from importlib.metadata import version as get_version


project = "python-cookiecutter"
copyright = "2025, University College London"
author = "Neuroinformatics Unit"

try:
full_version = setuptools_scm.get_version(root="../..", relative_to=__file__)
full_version = get_version(project)
# Splitting the release on '+' to remove the commit hash
release = full_version.split('+', 1)[0]
except LookupError:
Expand Down Expand Up @@ -84,6 +85,7 @@
},
],
"logo": {
# The release version can be included here if desired later by using f"{project} {release}"
"text": f"{project}",
},
"footer_start": ["footer_start"],
Expand Down
19 changes: 19 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
[project]
name = "python-cookiecutter"
authors = [{ name = "Neuroinformatics Unit" }]
description = "A tool to automatically create a Python project structure ready to release via GitHub and PyPI."
readme = "README.md"
dynamic = ["version"]

license = { text = "BSD-3-Clause" }

[build-system]
requires = [
"setuptools>=64",
"wheel",
"setuptools-scm[toml]>=8",
]
build-backend = "setuptools.build_meta"

[tool.setuptools_scm]

[tool.ruff]
line-length = 79
exclude = ["__init__.py", "build", ".eggs"]
Expand Down
1 change: 1 addition & 0 deletions {{cookiecutter.package_name}}/docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
-e .
linkify-it-py
myst-parser
nbsphinx
Expand Down
6 changes: 4 additions & 2 deletions {{cookiecutter.package_name}}/docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import os
import sys

import setuptools_scm
from importlib.metadata import version as get_version

# Used when building API docs, put the dependencies
# of any class you are documenting here
Expand All @@ -24,7 +24,9 @@
copyright = "2022, {{cookiecutter.full_name}}"
author = "{{cookiecutter.full_name}}"
try:
release = setuptools_scm.get_version(root="../..", relative_to=__file__)
full_version = get_version(project)
# Splitting the release on '+' to remove the commit hash
release = full_version.split('+', 1)[0]
except LookupError:
# if git is not initialised, still allow local build
# with a dummy version
Expand Down
Loading