-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bump dependencies, update docs and workflows.
- Loading branch information
Showing
10 changed files
with
168 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,18 +5,26 @@ on: | |
branches: | ||
- main | ||
|
||
env: | ||
bot-name: nekit[bot] | ||
bot-email: [email protected] | ||
python-version: "3.12" | ||
|
||
jobs: | ||
docs: | ||
name: Docs | ||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
contents: write | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Python 3.12 | ||
- name: Setup Python ${{ env.python-version }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.12" | ||
python-version: ${{ env.python-version }} | ||
|
||
- name: Install Poetry | ||
run: pipx install poetry | ||
|
@@ -30,8 +38,10 @@ jobs: | |
- name: Install dependencies | ||
run: poetry install --with docs | ||
|
||
- name: Pull | ||
run: git pull | ||
- name: Setup bot user | ||
run: | | ||
git config --local user.name ${{ env.bot-name }} | ||
git config --local user.email ${{ env.bot-email }} | ||
- name: Deploy the documentation | ||
run: poetry run mkdocs gh-deploy | ||
run: poetry run mkdocs gh-deploy --force |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,105 @@ | ||
name: release | ||
|
||
on: | ||
push: | ||
tags: | ||
- v* | ||
workflow_dispatch: | ||
inputs: | ||
version: | ||
description: The version to release, without the leading `v`. | ||
type: string | ||
required: true | ||
|
||
env: | ||
bot-name: nekit[bot] | ||
bot-email: [email protected] | ||
changelog: CHANGELOG-${{ inputs.version }}.md | ||
python-version: "3.12" | ||
|
||
jobs: | ||
release: | ||
name: Release | ||
changelog: | ||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
contents: write | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Python ${{ env.python-version }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ env.python-version }} | ||
|
||
- name: Install Poetry | ||
run: pipx install poetry | ||
|
||
- name: Configure Poetry | ||
run: poetry config virtualenvs.in-project true | ||
|
||
- name: Specify the version | ||
run: poetry env use python | ||
|
||
- name: Install dependencies | ||
run: poetry install --with release | ||
|
||
- name: Build changelog ${{ inputs.version }} | ||
run: poetry run changelogging preview > ${{ env.changelog }} | ||
|
||
- name: Upload changelog ${{ inputs.version }} | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: changelog | ||
path: ${{ env.changelog }} | ||
|
||
- name: Build changelog | ||
run: poetry run changelogging build --stage --remove | ||
|
||
- name: Setup bot user | ||
run: | | ||
git config --local user.name ${{ env.bot-name }} | ||
git config --local user.email ${{ env.bot-email }} | ||
- name: Commit and push | ||
run: | | ||
git commit -m "Add ${{ inputs.version }} to the changelog." | ||
git push | ||
tag: | ||
runs-on: ubuntu-latest | ||
needs: changelog | ||
|
||
permissions: | ||
contents: write | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Python 3.12 | ||
- name: Setup bot user | ||
run: | | ||
git config --local user.name ${{ env.bot-name }} | ||
git config --local user.email ${{ env.bot-email }} | ||
- name: Tag and push | ||
run: | | ||
git tag v${{ inputs.version }} | ||
git push --tags | ||
publish: | ||
runs-on: ubuntu-latest | ||
needs: tag | ||
|
||
permissions: | ||
id-token: write | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Python ${{ env.python-version }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.12" | ||
python-version: ${{ env.python-version }} | ||
|
||
- name: Install Poetry | ||
run: pipx install poetry | ||
|
@@ -32,7 +113,39 @@ jobs: | |
- name: Build | ||
run: poetry build | ||
|
||
- name: Upload packages | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: packages | ||
path: dist | ||
|
||
- name: Publish to PyPI | ||
run: poetry publish | ||
env: | ||
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }} | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
skip-existing: true | ||
|
||
release: | ||
runs-on: ubuntu-latest | ||
needs: publish | ||
|
||
steps: | ||
- name: Download changelog | ||
uses: actions/download-artifact@v4 | ||
with: | ||
pattern: changelog | ||
merge-multiple: true | ||
|
||
- name: Download packages | ||
uses: actions/download-artifact@v4 | ||
with: | ||
pattern: packages | ||
path: dist | ||
merge-multiple: true | ||
|
||
- name: Publish to GitHub | ||
uses: softprops/action-gh-release@v2 | ||
with: | ||
body_path: ${{ env.changelog }} | ||
files: dist/* | ||
tag_name: v${{ inputs.version }} | ||
token: ${{ secrets.BOT_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
[tool.poetry] | ||
name = "entrypoint" | ||
version = "2.0.3" | ||
version = "2.1.0" | ||
description = "Decorated functions as entry points." | ||
authors = ["nekitdev"] | ||
authors = ["nekitdev <[email protected]>"] | ||
license = "MIT" | ||
|
||
readme = "README.md" | ||
|
@@ -35,39 +35,39 @@ python = ">= 3.8" | |
attrs = ">= 23.2.0" | ||
named = ">= 1.4.2" | ||
|
||
typing-aliases = ">= 1.8.0" | ||
typing-aliases = ">= 1.10.1" | ||
|
||
[tool.poetry.group.format.dependencies] | ||
ruff = "0.3.3" | ||
ruff = "0.4.9" | ||
|
||
[tool.poetry.group.check.dependencies] | ||
mypy = "1.9.0" | ||
mypy = "1.10.0" | ||
|
||
[tool.poetry.group.check.dependencies.pre-commit] | ||
version = "3.6.2" | ||
version = "3.7.1" | ||
python = ">= 3.9" | ||
|
||
[tool.poetry.group.test.dependencies] | ||
coverage = "7.4.4" | ||
pytest = "8.1.1" | ||
pytest-cov = "4.1.0" | ||
coverage = "7.5.3" | ||
pytest = "8.2.2" | ||
pytest-cov = "5.0.0" | ||
|
||
[tool.poetry.group.docs] | ||
optional = true | ||
|
||
[tool.poetry.group.docs.dependencies] | ||
mkdocs = "1.5.3" | ||
mkdocs-material = "9.5.13" | ||
mkdocs = "1.6.0" | ||
mkdocs-material = "9.5.27" | ||
|
||
[tool.poetry.group.docs.dependencies.mkdocstrings] | ||
version = "0.24.0" | ||
version = "0.25.1" | ||
extras = ["python"] | ||
|
||
[tool.poetry.group.release] | ||
optional = true | ||
|
||
[tool.poetry.group.release.dependencies] | ||
changelogging = "1.4.2" | ||
changelogging = "2.3.0" | ||
|
||
[tool.ruff] | ||
line-length = 100 | ||
|
@@ -98,23 +98,14 @@ directory = "coverage" | |
[tool.mypy] | ||
strict = true | ||
|
||
[tool.changelogging] | ||
[tool.changelogging.context] | ||
name = "entrypoint" | ||
version = "2.0.3" | ||
version = "2.1.0" | ||
url = "https://github.com/nekitdev/entrypoint" | ||
directory = "changes" | ||
output = "CHANGELOG.md" | ||
|
||
start_string = "<!-- changelogging: start -->" | ||
|
||
title_format = "{version} ({date})" | ||
issue_format = "[#{issue}]({url}/pull/{issue})" | ||
|
||
bullet = "-" | ||
wrap = true | ||
wrap_size = 100 | ||
|
||
display = ["feature", "change", "fix", "security", "deprecation", "removal", "internal"] | ||
[tool.changelogging.formats] | ||
title = "[{{version}}]({{url}}/tree/v{{version}}) ({{date}})" | ||
fragment = "{{content}} ([#{{id}}]({{url}}/pull/{{id}}))" | ||
|
||
[build-system] | ||
requires = ["poetry-core >= 1.9.0"] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
from entrypoint import entrypoint | ||
|
||
CALLED = 0 | ||
called = 0 | ||
|
||
|
||
@entrypoint() | ||
def main() -> None: | ||
global CALLED | ||
global called | ||
|
||
CALLED += 1 | ||
called += 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters