diff --git a/.github/workflows/bump.yml b/.github/workflows/bump.yml new file mode 100644 index 0000000..4f27b62 --- /dev/null +++ b/.github/workflows/bump.yml @@ -0,0 +1,52 @@ +name: bump-workflow-name +run-name: bump workflow run name +on: + workflow_dispatch: + inputs: + semantic-version-identifier: + description: name of protected semantic version + required: true + type: choice + options: + - major + - minor + - patch +defaults: + run: + shell: bash +jobs: + bump-job-identifier: + name: bump job name + runs-on: ubuntu-latest + environment: ${{ inputs.github-environment-identifier }} + steps: + - name: checkout commit + uses: actions/checkout@v4 + - name: set up python + uses: actions/setup-python@v5 + with: + python-version: "3.10" + check-latest: true + architecture: x64 + cache: pip + - id: install-step-identifier + name: install bump-my-version + run: python3 -m pip install bump-my-version + shell: bash + - id: branch-step-identifier + name: create new branch + run: git switch --create bump-package-version + shell: bash + - id: bump-step-identifier + name: bump package version + env: + GIT_AUTHOR_NAME: ${{ secrets.GIT_USER_NAME }} + GIT_AUTHOR_EMAIL: ${{ secrets.GIT_USER_EMAIL }} + run: bump-my-version bump ${{ inputs.semantic-version-identifier }} + shell: bash + - id: pull-request-step-identifier + name: create new pull-request + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: gh pr create --base main --fill --head bump-package-version --label maintenance --label bump-package + shell: bash diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 87bf9da..21f7a26 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -28,19 +28,23 @@ repos: - id: requirements-txt-fixer - id: trailing-whitespace - repo: https://github.com/asottile/pyupgrade - rev: v3.15.0 + rev: v3.15.2 hooks: - id: pyupgrade args: - --keep-runtime-typing - --py310-plus + stages: + - manual - repo: https://github.com/pycqa/autoflake - rev: v2.2.1 + rev: v2.3.1 hooks: - id: autoflake args: - src pass_filenames: false + stages: + - manual - repo: https://github.com/pycqa/isort rev: 5.13.2 hooks: @@ -48,8 +52,10 @@ repos: args: - src pass_filenames: false + stages: + - manual - repo: https://github.com/psf/black - rev: 24.1.1 + rev: 24.3.0 hooks: - id: black additional_dependencies: @@ -57,8 +63,10 @@ repos: args: - src pass_filenames: false + stages: + - manual - repo: https://github.com/pycqa/bandit - rev: 1.7.7 + rev: 1.7.8 hooks: - id: bandit args: @@ -76,8 +84,10 @@ repos: args: - src pass_filenames: false + stages: + - manual - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.8.0 + rev: v1.9.0 hooks: - id: mypy additional_dependencies: @@ -89,7 +99,7 @@ repos: stages: - manual - repo: https://github.com/PyCQA/pylint - rev: v3.0.3 + rev: v3.1.0 hooks: - id: pylint args: @@ -100,14 +110,14 @@ repos: stages: - manual - repo: https://github.com/RobertCraigie/pyright-python - rev: v1.1.350 + rev: v1.1.357 hooks: - id: pyright pass_filenames: false stages: - manual - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.2.1 + rev: v0.3.5 hooks: - id: ruff args: @@ -118,7 +128,7 @@ repos: - src pass_filenames: false - repo: https://github.com/jendrikseipp/vulture - rev: v2.10 + rev: v2.11 hooks: - id: vulture pass_filenames: false @@ -149,7 +159,7 @@ repos: - src pass_filenames: false - repo: https://github.com/numpy/numpydoc - rev: v1.6.0 + rev: v1.7.0 hooks: - id: numpydoc-validation stages: @@ -173,7 +183,7 @@ repos: stages: - manual - repo: https://github.com/crate-ci/typos - rev: v1.18.2 + rev: v1.20.4 hooks: - id: typos args: diff --git a/README.md b/README.md index e7ef565..bfe4b65 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ - [x] ~~Hypotheses Testing~~ - [x] ~~Pydantic Validation~~ - [x] ~~Support Expressions~~ -- [ ] Bump Workflow +- [x] ~~Bump Workflow~~ ## Tools Used @@ -64,10 +64,16 @@ - [Hypothesis](https://hypothesis.works/) - [pytest](https://docs.pytest.org/en/latest/) - Documentation + - [autodoc_pydantic](https://github.com/mansenfranzen/autodoc_pydantic) - [Furo](https://github.com/pradyunsg/furo) - [Read the Docs](https://readthedocs.org/) - [Sphinx](https://www.sphinx-doc.org/) - [sphinx-copybutton](https://github.com/executablebooks/sphinx-copybutton) +- Release + - [Bump My Version](https://github.com/callowayproject/bump-my-version) + - [build](https://build.pypa.io/) + - [setuptools](https://github.com/pypa/setuptools) + - [Twine](https://twine.readthedocs.io/) [bandit-badge-image]: https://img.shields.io/badge/security-bandit-yellow.svg [bandit-badge-url]: https://github.com/PyCQA/bandit diff --git a/pyproject.toml b/pyproject.toml index 6a57d6f..f5c6472 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -59,12 +59,13 @@ dependencies = [ ] [project.optional-dependencies] all = [ - "autodoc-pydantic", + "autodoc_pydantic", "autoflake", "bandit", "black", "blacken-docs", "build", + "bump-my-version", "codespell[toml]", "coverage[toml]", "docformatter[tomli]", @@ -99,7 +100,7 @@ dev = [ "typos", ] doc = [ - "autodoc-pydantic", + "autodoc_pydantic", "furo", "myst-parser[linkify]", "Sphinx", @@ -126,6 +127,7 @@ lint = [ ] release = [ "build", + "bump-my-version", "twine", ] test = [ @@ -387,6 +389,24 @@ directory = "coverage_html_report" [tool.coverage.xml] output = "coverage_xml_report.xml" +[tool.bumpversion] +allow_dirty = false +commit = true +current_version = "0.0.5" +ignore_missing_files = false +ignore_missing_version = false +message = "Bump version: {current_version} → {new_version}" +parse = "(?P0|[1-9]\\d*)\\.(?P0|[1-9]\\d*)\\.(?P0|[1-9]\\d*)" +regex = false +replace = "{new_version}" +search = "{current_version}" +serialize = [ + "{major}.{minor}.{patch}", +] +tag = false +[[tool.bumpversion.files]] +filename = "src/package_name_to_import_with/metadata.json" + [tool.mypy] files = [ "src", diff --git a/requirements/requirements.doc.txt b/requirements/requirements.doc.txt index e189173..cc844f7 100644 --- a/requirements/requirements.doc.txt +++ b/requirements/requirements.doc.txt @@ -1,4 +1,4 @@ -autodoc-pydantic +autodoc_pydantic furo myst-parser[linkify] Sphinx diff --git a/requirements/requirements.release.txt b/requirements/requirements.release.txt index e47b6e9..8043445 100644 --- a/requirements/requirements.release.txt +++ b/requirements/requirements.release.txt @@ -1,2 +1,3 @@ build +bump-my-version twine diff --git a/src/package_name_to_import_with/simplify.py b/src/package_name_to_import_with/simplify.py index e1d21ac..f7b710b 100644 --- a/src/package_name_to_import_with/simplify.py +++ b/src/package_name_to_import_with/simplify.py @@ -1,6 +1,6 @@ """Evaluate simplification expressions.""" -import collections.abc # noqa: TCH003 +import collections.abc import enum import re import string