From 3e7b60bf9f4c7f367e3750f84f082817a78cd8ce Mon Sep 17 00:00:00 2001 From: Waldek Herka Date: Fri, 28 Mar 2025 22:16:54 +0100 Subject: [PATCH] chore(config): issue templates + correcting the release pypi + dependabot + + docs --- .github/ISSUE_TEMPLATE/bug_report.md | 33 +++++++++++++++++ .github/ISSUE_TEMPLATE/feature_request.md | 20 +++++++++++ .github/dependabot.yml | 10 ++++++ .github/workflows/release-pypi.yml | 7 ++-- README.md | 11 ++++++ pyproject.toml | 43 ++++++++++++++++++----- 6 files changed, 114 insertions(+), 10 deletions(-) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/feature_request.md create mode 100644 .github/dependabot.yml diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..6a17e1d --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,33 @@ + +--- +name: Bug report +about: Create a report to help us improve +title: "[BUG]" +labels: bug +assignees: '' + +--- + +**Describe the bug** +A clear and concise description of what the bug is. + +**To Reproduce** +Steps to reproduce the behavior: +1. Go to '...' +2. Click on '....' +3. Scroll down to '....' +4. See error + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Screenshots** +If applicable, add screenshots to help explain your problem. + +**Desktop (please complete the following information):** + - OS: [e.g. iOS] + - Browser [e.g. chrome, safari] + - Version [e.g. 22] + +**Additional context** +Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000..6628750 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,20 @@ +--- +name: Feature request +about: Suggest an idea for this project +title: "[FEATURE]" +labels: enhancement +assignees: '' + +--- + +**Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. + +**Additional context** +Add any other context or screenshots about the feature request here. \ No newline at end of file diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..269639a --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,10 @@ +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" + - package-ecosystem: "pip" + directory: "/" + schedule: + interval: "weekly" \ No newline at end of file diff --git a/.github/workflows/release-pypi.yml b/.github/workflows/release-pypi.yml index c6c79d4..f72d384 100644 --- a/.github/workflows/release-pypi.yml +++ b/.github/workflows/release-pypi.yml @@ -38,8 +38,11 @@ jobs: id: build_artifacts run: | python3 -m build - package_name=$(hatchling metadata name) - package_version=$(hatchling version) + # In case you decide to use chatchling with pyproject.toml only: + # package_name=$(hatchling metadata name) + # package_version=$(hatchling version) + package_name=$(python setup.py --name) + package_version=$(python setup.py --name) echo "package_name=$package_name" >> $GITHUB_OUTPUT echo "package_version=$package_version" >> $GITHUB_OUTPUT - name: Store the distribution packages diff --git a/README.md b/README.md index 1c2799e..ef678c2 100644 --- a/README.md +++ b/README.md @@ -37,3 +37,14 @@ $ ls dist/ Packaging uses [`setuptools-scm`](https://github.com/pypa/setuptools-scm), so the version of the software is based on git tags. To run the linting, we recommend `ruff`, a standard configuration is in the repo in `pyproject.toml`. + +# Releasing +To release a new version of the package, you can create a pre-release from the main branch using GitHub UI, which will then trigger the release workflow. Alternatively, you can use the `gh` command line tool to create a release: + +```bash +gh release create v[a.b.c] --prerelease --title "Kick starting the release" --target main +``` + + +# Contributing +We welcome contributions to this project! If you have an idea for a new feature, bug fix, or improvement, please open an issue or submit a pull request. Before contributing, please read our [contributing guidelines](./CONTRIBUTING.md). \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 330a33f..37ba116 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,11 +1,3 @@ -[build-system] -requires = ["setuptools>=71", "setuptools-scm>=8"] -build-backend = "setuptools.build_meta" - -[tool.setuptools_scm] -write_to = "package/_version.py" -write_to_template = "__version__ = \"{version}\"\n" - [tool.pytest.ini_options] minversion = "6.0" addopts = "--strict-markers --doctest-modules --doctest-glob='*.rst' --ignore=setup.py" @@ -62,3 +54,38 @@ disallow_untyped_defs = "True" no_implicit_optional = "True" show_error_codes = "True" warn_unused_ignores = "True" + +# --- Buildsystem based on setuptools + pyproject.toml : --- + +[build-system] +requires = ["setuptools>=71", "setuptools-scm>=8"] +build-backend = "setuptools.build_meta" + + +[tool.setuptools_scm] +write_to = "package/_version.py" +write_to_template = "__version__ = \"{version}\"\n" + + +# --- Alternative with hatchling with pyproject.toml only: --- +#[project] +#name = "Squarer" +#dynamic = ["version"] + +#[build-system] +#requires = ["hatchling>=1.24.2", "hatch-vcs>=0.3.0"] +#build-backend = "hatchling.build" + +#[tool.hatch.version] +#source = "vcs" + +#[tool.hatch.version.raw-options] +#version_scheme = "python-simplified-semver" +#local_scheme = "no-local-version" +#parentdir_prefix_version = "v" +#git_describe_command = ["git", "describe", "--dirty", "--tags", "--long", "--match", "v*"] + +#[tool.hatch.build.hooks.vcs] +#version-file = "package/_version.py" + +# -------------------------------------------------------------