Skip to content

Commit

Permalink
add towncrier
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastian-goeldi committed Aug 31, 2023
1 parent 6132f73 commit 662e893
Show file tree
Hide file tree
Showing 3 changed files with 115 additions and 1 deletion.
1 change: 1 addition & 0 deletions changelog.d/+dba8ce0b.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed jupyter module
15 changes: 15 additions & 0 deletions changelog.d/changelog_template.jinja
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{% if sections[""] %}
{% for category, val in definitions.items() if category in sections[""] %}

### {{ definitions[category]['name'] }}

{% for text, values in sections[""][category].items() %}
- {{ text }} {{ values|join(', ') }}
{% endfor %}

{% endfor %}
{% else %}
No significant changes.


{% endif %}
100 changes: 99 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,15 @@ dependencies = [
]

[project.optional-dependencies]
dev = ["mypy", "pre-commit", "commitizen", "gitpython", "pylsp-mypy", "types-cachetools"]
dev = [
"mypy",
"pre-commit",
"gitpython",
"pylsp-mypy",
"types-cachetools",
"towncrier",
"tbump"
]
tests = ["pytest", "pytest-cov"]
docs = [
"sphinx",
Expand Down Expand Up @@ -105,3 +113,93 @@ norecursedirs = ["extra/*.py"]
# "tests",
# "integration",
# ]

[tool.tbump]
# Uncomment this if your project is hosted on GitHub:
# github_url = "https://github.com/<user or organization>/<project>/"

[tool.tbump.version]
current = "1.1.4"

# Example of a semver regexp.
# Make sure this matches current_version before
# using tbump
regex = '''
(?P<major>\d+)
\.
(?P<minor>\d+)
\.
(?P<patch>\d+)
'''


[tool.towncrier]
directory = "changelog.d"
filename = "CHANGELOG.md"
start_string = "<!-- towncrier release notes start -->\n"
underlines = ["", "", ""]
template = "changelog.d/changelog_template.jinja"
title_format = "## [{version}](https://github.com/gdsfactory/kweb/tree/{version}) - {project_date}"
issue_format = "[#{issue}](https://github.com/gdsfactory/kweb/issues/{issue})"

[[tool.towncrier.type]]
directory = "security"
name = "Security"
showcontent = true

[[tool.towncrier.type]]
directory = "removed"
name = "Removed"
showcontent = true

[[tool.towncrier.type]]
directory = "deprecated"
name = "Deprecated"
showcontent = true

[[tool.towncrier.type]]
directory = "added"
name = "Added"
showcontent = true

[[tool.towncrier.type]]
directory = "changed"
name = "Changed"
showcontent = true

[[tool.towncrier.type]]
directory = "fixed"
name = "Fixed"
showcontent = true


[tool.tbump.git]
message_template = "Bump to {new_version}"
tag_template = "v{new_version}"

# For each file to patch, add a [[file]] config
# section containing the path of the file, relative to the
# tbump.toml location.
[[tool.tbump.file]]
src = "README.md"

[[tool.tbump.file]]
src = "pyproject.toml"

[[tool.tbump.file]]
src = "src/kweb/__init__.py"
# You can specify a list of commands to
# run after the files have been patched
# and before the git commit is made

[[tool.tbump.before_commit]]
name = "create & check changelog"
cmd = "towncrier build --yes --version {new_version}"

[[tool.tbump.before_commit]]
name = "create & check changelog"
cmd = "git add CHANGELOG.md"

[[tool.tbump.before_commit]]
name = "create & check changelog"
cmd = "grep -q -F {new_version} CHANGELOG.md"

0 comments on commit 662e893

Please sign in to comment.