Skip to content

Commit

Permalink
chore: remove unnecessary git-changelog related stuff (#552)
Browse files Browse the repository at this point in the history
  • Loading branch information
huxuan authored May 20, 2024
1 parent 0614cf9 commit eacd368
Show file tree
Hide file tree
Showing 23 changed files with 28 additions and 136 deletions.
5 changes: 0 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,11 @@ jobs:
cache: true
python-version: ${{ matrix.python-version }}
version: 2.15.2
- id: pages
name: Setup pages
uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b # v5.0.0
- run: env | sort
- run: make dev
- run: make lint
- run: make test
- run: make doc
env:
CI_PAGES_URL: ${{ steps.pages.outputs.base_url }}
- run: make build
strategy:
matrix:
Expand Down
5 changes: 0 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,9 @@ jobs:
cache: true
python-version: '3.12'
version: 2.15.2
- id: pages
name: Setup pages
uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b # v5.0.0
- run: env | sort
- run: make dev-doc
- run: make doc
env:
CI_PAGES_URL: ${{ steps.pages.outputs.base_url }}
- name: Upload pages artifact
uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3.0.1
with:
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
.copier-answers.yml
Pipfile
public
release-notes.md

# Byte-compiled / optimized / DLL files
__pycache__/
Expand Down
4 changes: 1 addition & 3 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,11 @@ build:
- asdf global pdm 2.15.2
post_install:
- VIRTUAL_ENV=$READTHEDOCS_VIRTUALENV_PATH make dev-doc
pre_build:
- VIRTUAL_ENV=$READTHEDOCS_VIRTUALENV_PATH CI_PAGES_URL=https://${READTHEDOCS_PROJECT}.readthedocs.io/${READTHEDOCS_LANGUAGE}/stable make changelog
post_build:
- VIRTUAL_ENV=$READTHEDOCS_VIRTUALENV_PATH make doc-mypy doc-coverage
os: ubuntu-22.04
tools:
python: "3.12"
python: '3.12'
sphinx:
fail_on_warning: true
version: 2
24 changes: 3 additions & 21 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.PHONY: clean deepclean install dev mypy ruff ruff-format toml-sort lint pre-commit test-run test build publish doc-autobuild changelog doc-gen doc-mypy doc-coverage doc consistency
.PHONY: clean deepclean install dev mypy ruff ruff-format toml-sort lint pre-commit test-run test build publish doc-autobuild doc-gen doc-mypy doc-coverage doc consistency

########################################################################################
# Variables
Expand All @@ -7,10 +7,6 @@
# Documentation target directory, will be adapted to specific folder for readthedocs.
PUBLIC_DIR := $(shell [ "$$READTHEDOCS" = "True" ] && echo "$${READTHEDOCS_OUTPUT}html" || echo "public")

# URL and Path of changelog source code.
CHANGELOG_URL := $(shell echo $${CI_PAGES_URL:-https://serious-scaffold.github.io/ss-python}/_sources/changelog.md.txt)
CHANGELOG_PATH := docs/changelog.md

########################################################################################
# Development Environment Management
########################################################################################
Expand All @@ -29,8 +25,7 @@ clean:
__pypackages__ \
build \
coverage.xml \
dist \
release-notes.md
dist
find . -name '*.egg-info' -print0 | xargs -0 rm -rf
find . -name '*.pyc' -print0 | xargs -0 rm -f
find . -name '*.swp' -print0 | xargs -0 rm -f
Expand Down Expand Up @@ -120,19 +115,6 @@ doc-autobuild:
--watch src \
-a

# Generate changelog from git commits.
# NOTE(xuan.hu): Need to be run before document generation to take effect.
changelog:
@if wget -q --spider $(CHANGELOG_URL); then \
echo "Existing Changelog found at '$(CHANGELOG_URL)', download for incremental generation."; \
wget -q -O $(CHANGELOG_PATH) $(CHANGELOG_URL); \
fi
pdm run git-changelog -ETrio $(CHANGELOG_PATH) -c conventional -s build,chore,ci,doc,feat,fix,perf,refactor,revert,style,test

# Generate release notes from changelog.
release-notes:
@pdm run git-changelog --input $(CHANGELOG_PATH) --release-notes

# Build documentation only from src.
doc-gen:
pdm run python -m sphinx.cmd.build docs $(PUBLIC_DIR)
Expand All @@ -147,7 +129,7 @@ doc-coverage: test-run
pdm run bash scripts/generate-coverage-badge.sh $(PUBLIC_DIR)/_static/badges

# Generate all documentation with reports.
doc: changelog doc-gen doc-mypy doc-coverage
doc: doc-gen doc-mypy doc-coverage

########################################################################################
# Template
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ An evolving Python project template that covers the full development lifecycle.
[![Release](https://github.com/serious-scaffold/ss-python/actions/workflows/release.yml/badge.svg)](https://github.com/serious-scaffold/ss-python/actions/workflows/release.yml)
[![Renovate](https://github.com/serious-scaffold/ss-python/actions/workflows/renovate.yml/badge.svg)](https://github.com/serious-scaffold/ss-python/actions/workflows/renovate.yml)
[![Coverage](https://img.shields.io/endpoint?url=https://serious-scaffold.github.io/ss-python/_static/badges/coverage.json)](https://serious-scaffold.github.io/ss-python/reports/coverage)
[![Release](https://img.shields.io/github/v/release/serious-scaffold/ss-python)](https://github.com/serious-scaffold/ss-python/releases)
[![PyPI](https://img.shields.io/pypi/v/ss-python)](https://pypi.org/project/ss-python/)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/ss-python)](https://pypi.org/project/ss-python/)
[![GitHub](https://img.shields.io/github/license/serious-scaffold/ss-python)](https://github.com/serious-scaffold/ss-python/blob/main/LICENSE)
Expand Down
5 changes: 0 additions & 5 deletions docs/changelog.md

This file was deleted.

4 changes: 0 additions & 4 deletions docs/development/commit.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,6 @@ Scope [Optional]

A "breaking change" refers to any modification that disrupts the existing functionality in a way that may affect users. It can be denoted using an exclamation mark (`!`) before the colon, like `refactor!: Stuff`.

```{note}
For more details, please refer to [the Angular convention](https://pawamoy.github.io/git-changelog/usage/#angularkarma-convention) and [the Conventional Commit convention](https://pawamoy.github.io/git-changelog/usage/#conventional-commit-convention) described in the documentation of `git-changelog`.
```

## Commit in Development Branches

While the commit convention seems strict, we aim for flexibility during the development phase.
Expand Down
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ advanced/index
cli/index
api/index
reports/index
changelog
Changelog <https://github.com/serious-scaffold/ss-python/releases>
```

```{include} ../README.md
Expand Down
2 changes: 1 addition & 1 deletion docs/management/release.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Release Process

The release process is primarily automated to ensure consistency and efficiency. The automation is mostly handled by GitHub Actions or GitLab CI/CD, with the help of tools like `git-changelog`. To ensure seamless execution, maintainers should follow specific guidelines and conventions throughout the development and release cycles.
The release process is primarily automated to ensure consistency and efficiency. The automation is mostly handled by GitHub Actions or GitLab CI/CD, with the help of [semantic-release](https://github.com/semantic-release/semantic-release). To ensure seamless execution, maintainers should follow specific guidelines and conventions throughout the development and release cycles.

The release process includes the following tasks:

Expand Down
15 changes: 13 additions & 2 deletions includes/variable.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,21 @@
[%- endif %]
[%- endmacro %]

[% macro releases_url() -%]
[% if repo_platform == 'github' -%]
https://{{ repo_url() }}/releases
[%- elif repo_platform == 'gitlab' or repo_platform == 'gitlab-self-managed' -%]
https://{{ repo_url() }}/-/releases
[%- endif -%]
[%- endmacro %]

[% macro release_badge() -%]
[%- if repo_platform == 'gitlab' or repo_platform == 'gitlab-self-managed' -%]
[![Latest Release](https://{{ repo_url() }}/-/badges/release.svg)](https://{{ repo_url() }}/-/releases)
[% if repo_platform == 'github' -%]
[![Release](https://img.shields.io/github/v/release/{{ repo_namespace }}/{{ repo_name }})]
[%- elif repo_platform == 'gitlab' or repo_platform == 'gitlab-self-managed' -%]
[![Latest Release](https://{{ repo_url() }}/-/badges/release.svg)]
[%- endif -%]
({{ releases_url()}})
[![PyPI](https://img.shields.io/pypi/v/{{ package_name }})](https://pypi.org/project/{{ package_name }}/)
[%- endmacro %]

Expand Down
41 changes: 1 addition & 40 deletions pdm.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ doc = [
"autodoc-pydantic",
"coverage",
"furo",
"git-changelog",
"mypy[reports]",
"myst-parser",
"pytest",
Expand Down
1 change: 0 additions & 1 deletion template/.gitignore.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
[%- endif %]
Pipfile
public
release-notes.md

# Byte-compiled / optimized / DLL files
__pycache__/
Expand Down
4 changes: 1 addition & 3 deletions template/.readthedocs.yaml.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,11 @@ build:
- asdf global pdm 2.15.2
post_install:
- VIRTUAL_ENV=$READTHEDOCS_VIRTUALENV_PATH make dev-doc
pre_build:
- VIRTUAL_ENV=$READTHEDOCS_VIRTUALENV_PATH CI_PAGES_URL=https://${READTHEDOCS_PROJECT}.readthedocs.io/${READTHEDOCS_LANGUAGE}/stable make changelog
post_build:
- VIRTUAL_ENV=$READTHEDOCS_VIRTUALENV_PATH make doc-mypy doc-coverage
os: ubuntu-22.04
tools:
python: "{{ default_py }}"
python: '{{ default_py }}'
sphinx:
fail_on_warning: true
version: 2
24 changes: 3 additions & 21 deletions template/Makefile.jinja
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[% from pathjoin("includes", "variable.jinja") import page_url with context -%]
.PHONY: clean deepclean install dev mypy ruff ruff-format toml-sort lint pre-commit test-run test build publish doc-autobuild changelog doc-gen doc-mypy doc-coverage doc
.PHONY: clean deepclean install dev mypy ruff ruff-format toml-sort lint pre-commit test-run test build publish doc-autobuild doc-gen doc-mypy doc-coverage doc
[%- if project_name == "Serious Scaffold Python" %] consistency[% endif %]

########################################################################################
Expand All @@ -9,10 +9,6 @@
# Documentation target directory, will be adapted to specific folder for readthedocs.
PUBLIC_DIR := $(shell [ "$$READTHEDOCS" = "True" ] && echo "$${READTHEDOCS_OUTPUT}html" || echo "public")

# URL and Path of changelog source code.
CHANGELOG_URL := $(shell echo $${CI_PAGES_URL:-https://{{ page_url() }}}/_sources/changelog.md.txt)
CHANGELOG_PATH := docs/changelog.md

########################################################################################
# Development Environment Management
########################################################################################
Expand All @@ -31,8 +27,7 @@ clean:
__pypackages__ \
build \
coverage.xml \
dist \
release-notes.md
dist
find . -name '*.egg-info' -print0 | xargs -0 rm -rf
find . -name '*.pyc' -print0 | xargs -0 rm -f
find . -name '*.swp' -print0 | xargs -0 rm -f
Expand Down Expand Up @@ -122,19 +117,6 @@ doc-autobuild:
--watch src \
-a

# Generate changelog from git commits.
# NOTE(xuan.hu): Need to be run before document generation to take effect.
changelog:
@if wget -q --spider $(CHANGELOG_URL); then \
echo "Existing Changelog found at '$(CHANGELOG_URL)', download for incremental generation."; \
wget -q -O $(CHANGELOG_PATH) $(CHANGELOG_URL); \
fi
pdm run git-changelog -ETrio $(CHANGELOG_PATH) -c conventional -s build,chore,ci,doc,feat,fix,perf,refactor,revert,style,test

# Generate release notes from changelog.
release-notes:
@pdm run git-changelog --input $(CHANGELOG_PATH) --release-notes

# Build documentation only from src.
doc-gen:
pdm run python -m sphinx.cmd.build docs $(PUBLIC_DIR)
Expand All @@ -149,7 +131,7 @@ doc-coverage: test-run
pdm run bash scripts/generate-coverage-badge.sh $(PUBLIC_DIR)/_static/badges

# Generate all documentation with reports.
doc: changelog doc-gen doc-mypy doc-coverage
doc: doc-gen doc-mypy doc-coverage

[% if project_name == "Serious Scaffold Python" -%]
########################################################################################
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,11 @@ jobs:
cache: true
python-version: {{ '${{ matrix.python-version }}' }}
version: 2.15.2
- id: pages
name: Setup pages
uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b # v5.0.0
- run: env | sort
- run: make dev
- run: make lint
- run: make test
- run: make doc
env:
CI_PAGES_URL: {{ '${{ steps.pages.outputs.base_url }}' }}
- run: make build
strategy:
matrix:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,9 @@ jobs:
cache: true
python-version: '{{ default_py }}'
version: 2.15.2
- id: pages
name: Setup pages
uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b # v5.0.0
- run: env | sort
- run: make dev-doc
- run: make doc
env:
CI_PAGES_URL: {{ '${{ steps.pages.outputs.base_url }}' }}
- name: Upload pages artifact
uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3.0.1
with:
Expand Down
5 changes: 0 additions & 5 deletions template/docs/changelog.md

This file was deleted.

4 changes: 0 additions & 4 deletions template/docs/development/commit.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,6 @@ Scope [Optional]

A "breaking change" refers to any modification that disrupts the existing functionality in a way that may affect users. It can be denoted using an exclamation mark (`!`) before the colon, like `refactor!: Stuff`.

```{note}
For more details, please refer to [the Angular convention](https://pawamoy.github.io/git-changelog/usage/#angularkarma-convention) and [the Conventional Commit convention](https://pawamoy.github.io/git-changelog/usage/#conventional-commit-convention) described in the documentation of `git-changelog`.
```

## Commit in Development Branches

While the commit convention seems strict, we aim for flexibility during the development phase.
Expand Down
3 changes: 2 additions & 1 deletion template/docs/index.md.jinja
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
[% from pathjoin("includes", "variable.jinja") import releases_url with context -%]
# Welcome to {{ project_name }}'s documentation

```{toctree}
Expand All @@ -9,7 +10,7 @@ advanced/index
cli/index
api/index
reports/index
changelog
Changelog <{{ releases_url() }}>
```

```{include} ../README.md
Expand Down
Loading

0 comments on commit eacd368

Please sign in to comment.