Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
22 changes: 19 additions & 3 deletions .github/workflows/pypi-publish.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,32 @@
name: Publish to PyPi

permissions:
contents: read

on:
push:
tags:
- "v*"

jobs:
lint:
uses: prosegrinder/.github/.github/workflows/poetry-lint.yaml@main
black:
uses: prosegrinder/.github/.github/workflows/poetry-black.yaml@main

pylint:
uses: prosegrinder/.github/.github/workflows/poetry-pylint.yaml@main

mypy:
uses: prosegrinder/.github/.github/workflows/poetry-mypy.yaml@main

bandit:
uses: prosegrinder/.github/.github/workflows/poetry-bandit.yaml@main

test:
needs: lint
needs:
- pylint
- black
- mypy
- bandit
uses: prosegrinder/.github/.github/workflows/poetry-test.yaml@main

publish:
Expand Down
74 changes: 15 additions & 59 deletions .github/workflows/python-ci.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
name: Python Poetry CI

permissions:
contents: read

on:
pull_request:

Expand All @@ -8,75 +11,28 @@ concurrency:
cancel-in-progress: true

jobs:
lint:
uses: prosegrinder/.github/.github/workflows/poetry-lint.yaml@main
black:
uses: prosegrinder/.github/.github/workflows/poetry-black.yaml@main

pylint:
uses: prosegrinder/.github/.github/workflows/poetry-pylint.yaml@main

mypy:
runs-on: ubuntu-latest
steps:
- name: Check Out
uses: actions/checkout@v4
with:
submodules: true
- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
- name: Setup Python
uses: actions/setup-python@v5
with:
cache: "poetry"
python-version: "3.x"
- name: Install project
run: poetry install --with dev --no-interaction
- name: MyPy
run: |
poetry run mypy src/**/*.py --config-file pyproject.toml
uses: prosegrinder/.github/.github/workflows/poetry-mypy.yaml@main

bandit:
runs-on: ubuntu-latest
steps:
- name: Check Out
uses: actions/checkout@v4
with:
submodules: true
- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
- name: Setup Python
uses: actions/setup-python@v5
with:
cache: "poetry"
python-version: "3.x"
- name: Install project
run: poetry install --with dev --no-interaction
- name: Bandit
run: |
poetry run bandit --configfile pyproject.toml --recursive src/**/*.py
uses: prosegrinder/.github/.github/workflows/poetry-bandit.yaml@main

test:
needs:
- lint
- pylint
- black
- mypy
- bandit
uses: prosegrinder/.github/.github/workflows/poetry-test.yaml@main

cz-dry-run:
needs: test
name: "Dry run Commitizen bump"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Create bump and changelog
uses: commitizen-tools/commitizen-action@0.24.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
check_consistency: true
dry_run: true
uses: prosegrinder/.github/.github/workflows/poetry-cz-dry-run.yaml@main
secrets:
VERSION_BUMP_TAG_TOKEN: "${{ secrets.VERSION_BUMP_TAG_TOKEN }}"
28 changes: 27 additions & 1 deletion .github/workflows/python-release.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
name: Bump Version and Create Release

permissions:
contents: write

on:
push:
branches:
Expand All @@ -10,9 +13,32 @@ concurrency:
cancel-in-progress: true

jobs:
black:
uses: prosegrinder/.github/.github/workflows/poetry-black.yaml@main

pylint:
uses: prosegrinder/.github/.github/workflows/poetry-pylint.yaml@main

mypy:
uses: prosegrinder/.github/.github/workflows/poetry-mypy.yaml@main

bandit:
uses: prosegrinder/.github/.github/workflows/poetry-bandit.yaml@main

test:
needs:
- pylint
- black
- mypy
- bandit
uses: prosegrinder/.github/.github/workflows/poetry-test.yaml@main

release:
if: "!startsWith(github.event.head_commit.message, 'bump:')"
needs: test
if: ${{ !startsWith(github.event.head_commit.message, 'bump:') }}
# Don't run 'bump:'
permissions:
contents: write
uses: prosegrinder/.github/.github/workflows/poetry-release.yaml@main
secrets:
VERSION_BUMP_TAG_TOKEN: "${{ secrets.VERSION_BUMP_TAG_TOKEN }}"
24 changes: 13 additions & 11 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,16 +1,6 @@
[tool.commitizen]
version = "1.1.1"
tag_format = "v$version"
update_changelog_on_bump = true
changelog_incremental = true
bump_message = "bump: $current_version → $new_version"
version_files = [
"pyproject.toml:version",
]

[project]
name = "syllables"
version = "1.1.1"
dynamic = ["version"]
description = "A Python package for estimating the number of syllables in a word."
license = { text = "GPLv3" }
readme = "README.md"
Expand Down Expand Up @@ -39,6 +29,18 @@ homepage = "https://github.com/prosegrinder/python-syllables"
repository = "https://github.com/prosegrinder/python-syllables"
"Bug Tracker" = "https://github.com/prosegrinder/python-syllables/issues"

[tool.commitizen]
version = "1.1.1"
tag_format = "v$version"
update_changelog_on_bump = true
changelog_incremental = true
bump_message = "bump: $current_version → $new_version"
version_files = [
"pyproject.toml:version",
]

[tool.poetry]
version = "1.1.1"

[tool.poetry.group.dev.dependencies]
pytest = "^7.2.0"
Expand Down