From 09f3adbea058ec30a5126679a6511097280e1fc6 Mon Sep 17 00:00:00 2001 From: dalwar23 <5631766+dalwar23@users.noreply.github.com> Date: Tue, 10 Dec 2024 22:01:23 +0100 Subject: [PATCH 01/13] add github workflow Signed-off-by: dalwar23 <5631766+dalwar23@users.noreply.github.com> --- .github/workflows/build-python-package.yml | 23 ++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 .github/workflows/build-python-package.yml diff --git a/.github/workflows/build-python-package.yml b/.github/workflows/build-python-package.yml new file mode 100644 index 0000000..80311ae --- /dev/null +++ b/.github/workflows/build-python-package.yml @@ -0,0 +1,23 @@ +name: kumaone python package + +on: + push: + branches: + - main + - feat/dh-github-actions + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["pypy3.10", "3.9", "3.10", "3.11", "3.12"] + steps: + - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + # You can test your matrix by printing the current Python version + - name: Display Python version + run: python -c "import sys; print(sys.version)" From 3773e1ec26488136556404f46c549dad61abe411 Mon Sep 17 00:00:00 2001 From: dalwar23 <5631766+dalwar23@users.noreply.github.com> Date: Tue, 10 Dec 2024 22:08:02 +0100 Subject: [PATCH 02/13] update github workflow Signed-off-by: dalwar23 <5631766+dalwar23@users.noreply.github.com> --- .github/workflows/build-python-package.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/build-python-package.yml b/.github/workflows/build-python-package.yml index 80311ae..29add87 100644 --- a/.github/workflows/build-python-package.yml +++ b/.github/workflows/build-python-package.yml @@ -18,6 +18,15 @@ jobs: uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} + cache: pip # You can test your matrix by printing the current Python version - name: Display Python version run: python -c "import sys; print(sys.version)" + - name: Install pipenv + run: | + python -m pip install --upgrade pip + pip install pipenv + - name: Install dependencies + run: pipenv install --dev + - name: Build kumaone python package + run: hatch build From 3470af95b6f326ac5ba631fcb8d26ad05426a7aa Mon Sep 17 00:00:00 2001 From: dalwar23 <5631766+dalwar23@users.noreply.github.com> Date: Tue, 10 Dec 2024 22:10:54 +0100 Subject: [PATCH 03/13] add hatch to dev requiremnts Signed-off-by: dalwar23 <5631766+dalwar23@users.noreply.github.com> --- Pipfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Pipfile b/Pipfile index 8e59ec5..6adeb11 100644 --- a/Pipfile +++ b/Pipfile @@ -16,6 +16,7 @@ black = ">=23.12.1" bump-my-version = ">=0.17.0" coverage = ">=7.4.0" flake8 = ">=7.0.0" +hatch = ">=1.13.0" linkify-it-py = ">=2.0.2" markdown-it-py = ">=3.0.0" myst-parser = ">=2.0.0" From d060aa3c6c34c483b963a93196f49e3fe61efc1b Mon Sep 17 00:00:00 2001 From: dalwar23 <5631766+dalwar23@users.noreply.github.com> Date: Tue, 10 Dec 2024 22:16:12 +0100 Subject: [PATCH 04/13] add pipenv shell command Signed-off-by: dalwar23 <5631766+dalwar23@users.noreply.github.com> --- .github/workflows/build-python-package.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-python-package.yml b/.github/workflows/build-python-package.yml index 29add87..4b585f7 100644 --- a/.github/workflows/build-python-package.yml +++ b/.github/workflows/build-python-package.yml @@ -27,6 +27,10 @@ jobs: python -m pip install --upgrade pip pip install pipenv - name: Install dependencies - run: pipenv install --dev + run: | + pipenv shell + pipenv install --dev - name: Build kumaone python package - run: hatch build + run: | + pipenv shell + hatch build From 2c8473b4e86db9fe0b4282fe48a30559552f5dd4 Mon Sep 17 00:00:00 2001 From: dalwar23 <5631766+dalwar23@users.noreply.github.com> Date: Tue, 10 Dec 2024 22:20:32 +0100 Subject: [PATCH 05/13] try pipenv run Signed-off-by: dalwar23 <5631766+dalwar23@users.noreply.github.com> --- .github/workflows/build-python-package.yml | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build-python-package.yml b/.github/workflows/build-python-package.yml index 4b585f7..75b3c28 100644 --- a/.github/workflows/build-python-package.yml +++ b/.github/workflows/build-python-package.yml @@ -25,12 +25,8 @@ jobs: - name: Install pipenv run: | python -m pip install --upgrade pip - pip install pipenv + pip install pipenv wheel - name: Install dependencies - run: | - pipenv shell - pipenv install --dev + run: pipenv install --dev - name: Build kumaone python package - run: | - pipenv shell - hatch build + run: pipenv run hatch build From c9ee56e58ad9666ca94070ec9a465902e96f0a10 Mon Sep 17 00:00:00 2001 From: dalwar23 <5631766+dalwar23@users.noreply.github.com> Date: Tue, 10 Dec 2024 22:43:25 +0100 Subject: [PATCH 06/13] Install and run info Signed-off-by: dalwar23 <5631766+dalwar23@users.noreply.github.com> --- .github/workflows/build-python-package.yml | 4 ++++ Pipfile.lock | 2 +- src/kumaone/main.py | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-python-package.yml b/.github/workflows/build-python-package.yml index 75b3c28..4be1643 100644 --- a/.github/workflows/build-python-package.yml +++ b/.github/workflows/build-python-package.yml @@ -28,5 +28,9 @@ jobs: pip install pipenv wheel - name: Install dependencies run: pipenv install --dev + - name: Install kumaone package + run: pipenv install . + - name: Check kumaone version + run: pipenv run kumaone info - name: Build kumaone python package run: pipenv run hatch build diff --git a/Pipfile.lock b/Pipfile.lock index 2c1620b..b69ccc8 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "b6cc36065d24507f5e7ff0a4714bef7eeed24f06e8d3d930620f2bc4ed7e10b5" + "sha256": "5d2160c34f75afe5837c9fe8b56411097609479b94623b33fe706c9ccdb00311" }, "pipfile-spec": 6, "requires": {}, diff --git a/src/kumaone/main.py b/src/kumaone/main.py index e4d973d..67f0a3a 100644 --- a/src/kumaone/main.py +++ b/src/kumaone/main.py @@ -19,7 +19,7 @@ __email__ = "dalwar23@pm.me" # Create typer app and turn off debug mode by default -app = typer.Typer() +app = typer.Typer(no_args_is_help=True) app.add_typer(monitor_cli.app, name="monitor") app.add_typer(config_cli.app, name="config") app.add_typer(status_page_cli.app, name="status-page") From e665faafd788b549d8c6f546c932fbbde0471fae Mon Sep 17 00:00:00 2001 From: dalwar23 <5631766+dalwar23@users.noreply.github.com> Date: Tue, 10 Dec 2024 22:49:56 +0100 Subject: [PATCH 07/13] Ignore writing to pipfile while isntalling this package Signed-off-by: dalwar23 <5631766+dalwar23@users.noreply.github.com> --- .github/workflows/build-python-package.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-python-package.yml b/.github/workflows/build-python-package.yml index 4be1643..faa9360 100644 --- a/.github/workflows/build-python-package.yml +++ b/.github/workflows/build-python-package.yml @@ -29,7 +29,7 @@ jobs: - name: Install dependencies run: pipenv install --dev - name: Install kumaone package - run: pipenv install . + run: pipenv install --ignore-pipfile . - name: Check kumaone version run: pipenv run kumaone info - name: Build kumaone python package From 14de6ff60fc4fa8606c7fd81a70116a0f5e59d5c Mon Sep 17 00:00:00 2001 From: dalwar23 <5631766+dalwar23@users.noreply.github.com> Date: Tue, 10 Dec 2024 22:53:24 +0100 Subject: [PATCH 08/13] move pip upgrade to separate stage Signed-off-by: dalwar23 <5631766+dalwar23@users.noreply.github.com> --- .github/workflows/build-python-package.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-python-package.yml b/.github/workflows/build-python-package.yml index faa9360..cf6e893 100644 --- a/.github/workflows/build-python-package.yml +++ b/.github/workflows/build-python-package.yml @@ -22,15 +22,15 @@ jobs: # You can test your matrix by printing the current Python version - name: Display Python version run: python -c "import sys; print(sys.version)" + - name: Upgrade pip + run: python -m pip install --upgrade pip - name: Install pipenv - run: | - python -m pip install --upgrade pip - pip install pipenv wheel + run: pip install pipenv wheel - name: Install dependencies run: pipenv install --dev + - name: Build kumaone python package + run: pipenv run hatch build - name: Install kumaone package run: pipenv install --ignore-pipfile . - name: Check kumaone version run: pipenv run kumaone info - - name: Build kumaone python package - run: pipenv run hatch build From fc620f2d9c6e9882f2860d18efa4df9dea41886a Mon Sep 17 00:00:00 2001 From: dalwar23 <5631766+dalwar23@users.noreply.github.com> Date: Tue, 10 Dec 2024 22:56:07 +0100 Subject: [PATCH 09/13] remove hatch for dev dep and no more dev dep install Signed-off-by: dalwar23 <5631766+dalwar23@users.noreply.github.com> --- .github/workflows/build-python-package.yml | 4 ++-- Pipfile | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-python-package.yml b/.github/workflows/build-python-package.yml index cf6e893..f356466 100644 --- a/.github/workflows/build-python-package.yml +++ b/.github/workflows/build-python-package.yml @@ -25,9 +25,9 @@ jobs: - name: Upgrade pip run: python -m pip install --upgrade pip - name: Install pipenv - run: pip install pipenv wheel + run: pip install pipenv wheel hatch - name: Install dependencies - run: pipenv install --dev + run: pipenv install - name: Build kumaone python package run: pipenv run hatch build - name: Install kumaone package diff --git a/Pipfile b/Pipfile index 6adeb11..8e59ec5 100644 --- a/Pipfile +++ b/Pipfile @@ -16,7 +16,6 @@ black = ">=23.12.1" bump-my-version = ">=0.17.0" coverage = ">=7.4.0" flake8 = ">=7.0.0" -hatch = ">=1.13.0" linkify-it-py = ">=2.0.2" markdown-it-py = ">=3.0.0" myst-parser = ">=2.0.0" From 46d595f28424444dfcb88b232c585760864913e4 Mon Sep 17 00:00:00 2001 From: dalwar23 <5631766+dalwar23@users.noreply.github.com> Date: Tue, 10 Dec 2024 23:02:11 +0100 Subject: [PATCH 10/13] deprecate: python3.8 support Signed-off-by: dalwar23 <5631766+dalwar23@users.noreply.github.com> --- CONTRIBUTING.md | 2 +- docs/source/installation.md | 2 +- pyproject.toml | 474 ++++++++++++++++++------------------ 3 files changed, 238 insertions(+), 240 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 10ef385..41ecb5d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -92,5 +92,5 @@ Before you submit a pull request, check that it meets these guidelines: 1. If the pull request adds functionality, the docs should be updated. Put your new functionality into a function with a docstring, and add the feature to the list of TODO in README file. -2. The pull request should work for Python 3.8, 3.9, 3.10, 3.11, 3.12 and same for PyPy. +2. The pull request should work for Python 3.9, 3.10, 3.11, 3.12 and PyPy3.10. diff --git a/docs/source/installation.md b/docs/source/installation.md index 146e311..2df74e2 100644 --- a/docs/source/installation.md +++ b/docs/source/installation.md @@ -1,6 +1,6 @@ # Installation -kumaone (`kumaone`) requires Python 3.8 or above. If you do not already have a +kumaone (`kumaone`) requires Python 3.9 or above. If you do not already have a Python environment configured on your computer, please see the [Python](https://www.python.org) page for instructions on installing Python environment. diff --git a/pyproject.toml b/pyproject.toml index 89f4a87..18c8ce5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,238 +1,236 @@ -[build-system] -requires = ["hatchling"] -build-backend = "hatchling.build" - -[project] -name = "kumaone" -dynamic = ["version"] -description = 'Automation friendly bulk action CLI helper for Uptime Kuma.' -readme = "README.md" -requires-python = ">=3.8" -license = "BSD-3-Clause" -keywords = ["kumaone", "kuma", "uptime-kuma", "monitoring", "cli", "python3"] -authors = [ - { name = "Dalwar Hossain", email = "dalwar23@pm.me" }, -] -classifiers = [ - "Development Status :: 3 - Alpha", - "Environment :: Console", - "License :: OSI Approved", - "Programming Language :: Python", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", - "Programming Language :: Python :: 3.12", - "Programming Language :: Python :: Implementation :: CPython", - "Programming Language :: Python :: Implementation :: PyPy", -] -dependencies = [ - "python-socketio[client] >= 5.11.0", - "pyyaml >= 6.0.1", - "requests >= 2.31.0", - "typer >= 0.12.3", - "validators >= 0.22.0", - "colorama >= 0.4.6" -] - -[project.urls] -Documentation = "https://kumaone.rtfd.io/" -Issues = "https://github.com/dalwar23/kumaone/issues" -Source = "https://github.com/dalwar23/kumaone" - -[project.scripts] -kumaone = "src.kumaone.main:app" - -[tool.hatch.version] -path = "src/kumaone/__about__.py" - -[tool.hatch.build] -include = [ - "src/kumaone", -] - -[tool.hatch.build.targets.sdist] -exclude = [ - ".github/", - "docs/", -] - -[tool.hatch.envs.default] -dependencies = [ - "coverage[toml]>=7.4.0", - "pytest", -] -[tool.hatch.envs.default.scripts] -test = "pytest {args:tests}" -test-cov = "coverage run -m pytest {args:tests}" -cov-report = [ - "- coverage combine", - "coverage report", -] -cov = [ - "test-cov", - "cov-report", -] - -[[tool.hatch.envs.all.matrix]] -python = ["3.8", "3.9", "3.10", "3.11", "3.12"] - -[tool.hatch.envs.lint] -detached = true -dependencies = [ - "black>=23.12.1", - "mypy>=1.8.0", - "ruff>=0.1.14", - "flake8>=7.0.0", -] -[tool.hatch.envs.lint.scripts] -typing = "mypy --install-types --non-interactive {args:src/kumaone tests}" -style = [ - "ruff {args:.}", - "black --check --diff {args:.}", -] -fmt = [ - "black {args:.}", - "ruff --fix {args:.}", - "style", -] -all = [ - "style", - "typing", -] - -[tool.black] -target-version = ["py312"] -line-length = 120 -skip-string-normalization = true - -[tool.ruff] -target-version = "py312" -line-length = 130 -select = [ - "A", - "ARG", - "B", - "C", - "DTZ", - "E", - "EM", - "F", - "FBT", - "I", - "ICN", - "ISC", - "N", - "PLC", - "PLE", - "PLR", - "PLW", - "Q", - "RUF", - "S", - "T", - "TID", - "UP", - "W", - "YTT", -] -ignore = [ - # Allow non-abstract empty methods in abstract base classes - "B027", - # Allow boolean positional values in function calls, like `dict.get(... True)` - "FBT003", - # Ignore checks for possible passwords - "S105", "S106", "S107", - # Ignore complexity - "C901", "PLR0911", "PLR0912", "PLR0913", "PLR0915", - # Argument name should be lowercase - "N803", - # fString without a placeholder - "F541", - # Prefer absolute imports over relative imports - "TID252", - # Boolean default positional argument in function definition - "FBT001", "FBT002", -] -unfixable = [ - # Don't touch unused imports - "F401", -] - -[tool.ruff.isort] -known-first-party = ["kumaone"] - -[tool.ruff.flake8-tidy-imports] -ban-relative-imports = "all" - -[tool.ruff.per-file-ignores] -# Tests can use magic values, assertions, and relative imports -"tests/**/*" = ["PLR2004", "S101", "TID252"] - -[tool.coverage.run] -source_pkgs = ["kumaone", "tests"] -branch = true -parallel = true -omit = [ - "src/kumaone/__about__.py", -] - -[tool.coverage.paths] -kumaone = ["src/kumaone", "*/kumaone/src/kumaone"] -tests = ["tests", "*/kumaone/tests"] - -[tool.coverage.report] -exclude_lines = [ - "no cov", - "if __name__ == .__main__.:", - "if TYPE_CHECKING:", -] - -[tool.bumpversion] -current_version = "0.0.1-alpha.9" -#parse = "(?P\\d+)\\.(?P\\d+)\\.(?P\\d+)" -#serialize = ["{major}.{minor}.{patch}"] -parse = """(?x) - (?P[0-9]+) - \\.(?P[0-9]+) - \\.(?P[0-9]+) - (?: - -(?Palpha|beta|rc|stable) - (?:.(?P[0-9]+))? - )? -""" -serialize = [ - "{major}.{minor}.{patch}-{pre_label}.{pre_n}", - "{major}.{minor}.{patch}", -] -regex = false -ignore_missing_version = false -tag = false -sign_tags = false -tag_name = "v{new_version}" -tag_message = "Bump version: {current_version} → {new_version}" -allow_dirty = false -commit = true -message = "Bump version: {current_version} → {new_version}" -commit_args = "" - -[[tool.bumpversion.files]] -filename = "src/kumaone/__about__.py" -search = '__version__ = "{current_version}"' -replace = '__version__ = "{new_version}"' - -[[tool.bumpversion.files]] -filename = "pyproject.toml" -search = "{current_version}" -replace = "{new_version}" - -[tool.bumpversion.parts.pre_label] -optional_value = "stable" -values =[ - "alpha", - "beta", - "rc", - "stable", -] -[tool.bumpversion.parts.pre_n] -independent = true +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[project] +name = "kumaone" +dynamic = ["version"] +description = 'Automation friendly bulk action CLI helper for Uptime Kuma.' +readme = "README.md" +requires-python = ">=3.9" +license = "BSD-3-Clause" +keywords = ["kumaone", "kuma", "uptime-kuma", "monitoring", "cli", "python3"] +authors = [ + { name = "Dalwar Hossain", email = "dalwar23@pm.me" }, +] +classifiers = [ + "Development Status :: 3 - Alpha", + "Environment :: Console", + "License :: OSI Approved", + "Programming Language :: Python", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: Implementation :: PyPy", +] +dependencies = [ + "python-socketio[client] >= 5.11.0", + "pyyaml >= 6.0.1", + "requests >= 2.31.0", + "typer >= 0.12.3", + "validators >= 0.22.0", + "colorama >= 0.4.6" +] + +[project.urls] +Documentation = "https://kumaone.rtfd.io/" +Issues = "https://github.com/dalwar23/kumaone/issues" +Source = "https://github.com/dalwar23/kumaone" + +[project.scripts] +kumaone = "src.kumaone.main:app" + +[tool.hatch.version] +path = "src/kumaone/__about__.py" + +[tool.hatch.build] +include = [ + "src/kumaone", +] + +[tool.hatch.build.targets.sdist] +exclude = [ + ".github/", + "docs/", +] + +[tool.hatch.envs.default] +dependencies = [ + "coverage[toml]>=7.4.0", + "pytest", +] +[tool.hatch.envs.default.scripts] +test = "pytest {args:tests}" +test-cov = "coverage run -m pytest {args:tests}" +cov-report = [ + "- coverage combine", + "coverage report", +] +cov = [ + "test-cov", + "cov-report", +] + +[[tool.hatch.envs.all.matrix]] +python = ["3.9", "3.10", "3.11", "3.12"] + +[tool.hatch.envs.lint] +detached = true +dependencies = [ + "black>=23.12.1", + "mypy>=1.8.0", + "ruff>=0.1.14", + "flake8>=7.0.0", +] +[tool.hatch.envs.lint.scripts] +typing = "mypy --install-types --non-interactive {args:src/kumaone tests}" +style = [ + "ruff {args:.}", + "black --check --diff {args:.}", +] +fmt = [ + "black {args:.}", + "ruff --fix {args:.}", + "style", +] +all = [ + "style", + "typing", +] + +[tool.black] +target-version = ["py312"] +line-length = 120 +skip-string-normalization = true + +[tool.ruff] +target-version = "py312" +line-length = 120 +select = [ + "A", + "ARG", + "B", + "C", + "DTZ", + "E", + "EM", + "F", + "FBT", + "I", + "ICN", + "ISC", + "N", + "PLC", + "PLE", + "PLR", + "PLW", + "Q", + "RUF", + "S", + "T", + "TID", + "UP", + "W", + "YTT", +] +ignore = [ + # Allow non-abstract empty methods in abstract base classes + "B027", + # Allow boolean positional values in function calls, like `dict.get(... True)` + "FBT003", + # Ignore checks for possible passwords + "S105", "S106", "S107", + # Ignore complexity + "C901", "PLR0911", "PLR0912", "PLR0913", "PLR0915", + # Argument name should be lowercase + "N803", + # fString without a placeholder + "F541", + # Prefer absolute imports over relative imports + "TID252", + # Boolean default positional argument in function definition + "FBT001", "FBT002", +] +unfixable = [ + # Don't touch unused imports + "F401", +] + +[tool.ruff.isort] +known-first-party = ["kumaone"] + +[tool.ruff.flake8-tidy-imports] +ban-relative-imports = "all" + +[tool.ruff.per-file-ignores] +# Tests can use magic values, assertions, and relative imports +"tests/**/*" = ["PLR2004", "S101", "TID252"] + +[tool.coverage.run] +source_pkgs = ["kumaone", "tests"] +branch = true +parallel = true +omit = [ + "src/kumaone/__about__.py", +] + +[tool.coverage.paths] +kumaone = ["src/kumaone", "*/kumaone/src/kumaone"] +tests = ["tests", "*/kumaone/tests"] + +[tool.coverage.report] +exclude_lines = [ + "no cov", + "if __name__ == .__main__.:", + "if TYPE_CHECKING:", +] + +[tool.bumpversion] +current_version = "0.0.1-alpha.9" +#parse = "(?P\\d+)\\.(?P\\d+)\\.(?P\\d+)" +#serialize = ["{major}.{minor}.{patch}"] +parse = """(?x) + (?P[0-9]+) + \\.(?P[0-9]+) + \\.(?P[0-9]+) + (?: + -(?Palpha|beta|rc|stable) + (?:.(?P[0-9]+))? + )? +""" +serialize = [ + "{major}.{minor}.{patch}-{pre_label}.{pre_n}", + "{major}.{minor}.{patch}", +] +regex = false +ignore_missing_version = false +tag = false +sign_tags = false +tag_name = "v{new_version}" +tag_message = "Bump version: {current_version} → {new_version}" +allow_dirty = false +commit = true +message = "Bump version: {current_version} → {new_version}" +commit_args = "" + +[[tool.bumpversion.files]] +filename = "src/kumaone/__about__.py" +search = '__version__ = "{current_version}"' +replace = '__version__ = "{new_version}"' + +[[tool.bumpversion.files]] +filename = "pyproject.toml" +search = "{current_version}" +replace = "{new_version}" + +[tool.bumpversion.parts.pre_label] +optional_value = "stable" +values =[ + "alpha", + "beta", + "rc", + "stable", +] +[tool.bumpversion.parts.pre_n] +independent = true From c78a52026cac0b712833fe7e83d73c1b4cab9b28 Mon Sep 17 00:00:00 2001 From: dalwar23 <5631766+dalwar23@users.noreply.github.com> Date: Tue, 10 Dec 2024 23:07:43 +0100 Subject: [PATCH 11/13] add pull request github action run Signed-off-by: dalwar23 <5631766+dalwar23@users.noreply.github.com> --- .github/workflows/build-python-package.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-python-package.yml b/.github/workflows/build-python-package.yml index f356466..e9cbdb6 100644 --- a/.github/workflows/build-python-package.yml +++ b/.github/workflows/build-python-package.yml @@ -3,8 +3,11 @@ name: kumaone python package on: push: branches: + - dev + pull_request: + branches: + - dev - main - - feat/dh-github-actions jobs: build: From fa08b71ebd51aa8af38532fc5ecfb006a735a06a Mon Sep 17 00:00:00 2001 From: dalwar23 <5631766+dalwar23@users.noreply.github.com> Date: Tue, 10 Dec 2024 23:07:59 +0100 Subject: [PATCH 12/13] =?UTF-8?q?Bump=20version:=200.0.1-alpha.9=20?= =?UTF-8?q?=E2=86=92=200.0.1-alpha.10?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pyproject.toml | 472 +++++++++++++++++++-------------------- src/kumaone/__about__.py | 2 +- 2 files changed, 237 insertions(+), 237 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 18c8ce5..ba9ddad 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,236 +1,236 @@ -[build-system] -requires = ["hatchling"] -build-backend = "hatchling.build" - -[project] -name = "kumaone" -dynamic = ["version"] -description = 'Automation friendly bulk action CLI helper for Uptime Kuma.' -readme = "README.md" -requires-python = ">=3.9" -license = "BSD-3-Clause" -keywords = ["kumaone", "kuma", "uptime-kuma", "monitoring", "cli", "python3"] -authors = [ - { name = "Dalwar Hossain", email = "dalwar23@pm.me" }, -] -classifiers = [ - "Development Status :: 3 - Alpha", - "Environment :: Console", - "License :: OSI Approved", - "Programming Language :: Python", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", - "Programming Language :: Python :: 3.12", - "Programming Language :: Python :: Implementation :: PyPy", -] -dependencies = [ - "python-socketio[client] >= 5.11.0", - "pyyaml >= 6.0.1", - "requests >= 2.31.0", - "typer >= 0.12.3", - "validators >= 0.22.0", - "colorama >= 0.4.6" -] - -[project.urls] -Documentation = "https://kumaone.rtfd.io/" -Issues = "https://github.com/dalwar23/kumaone/issues" -Source = "https://github.com/dalwar23/kumaone" - -[project.scripts] -kumaone = "src.kumaone.main:app" - -[tool.hatch.version] -path = "src/kumaone/__about__.py" - -[tool.hatch.build] -include = [ - "src/kumaone", -] - -[tool.hatch.build.targets.sdist] -exclude = [ - ".github/", - "docs/", -] - -[tool.hatch.envs.default] -dependencies = [ - "coverage[toml]>=7.4.0", - "pytest", -] -[tool.hatch.envs.default.scripts] -test = "pytest {args:tests}" -test-cov = "coverage run -m pytest {args:tests}" -cov-report = [ - "- coverage combine", - "coverage report", -] -cov = [ - "test-cov", - "cov-report", -] - -[[tool.hatch.envs.all.matrix]] -python = ["3.9", "3.10", "3.11", "3.12"] - -[tool.hatch.envs.lint] -detached = true -dependencies = [ - "black>=23.12.1", - "mypy>=1.8.0", - "ruff>=0.1.14", - "flake8>=7.0.0", -] -[tool.hatch.envs.lint.scripts] -typing = "mypy --install-types --non-interactive {args:src/kumaone tests}" -style = [ - "ruff {args:.}", - "black --check --diff {args:.}", -] -fmt = [ - "black {args:.}", - "ruff --fix {args:.}", - "style", -] -all = [ - "style", - "typing", -] - -[tool.black] -target-version = ["py312"] -line-length = 120 -skip-string-normalization = true - -[tool.ruff] -target-version = "py312" -line-length = 120 -select = [ - "A", - "ARG", - "B", - "C", - "DTZ", - "E", - "EM", - "F", - "FBT", - "I", - "ICN", - "ISC", - "N", - "PLC", - "PLE", - "PLR", - "PLW", - "Q", - "RUF", - "S", - "T", - "TID", - "UP", - "W", - "YTT", -] -ignore = [ - # Allow non-abstract empty methods in abstract base classes - "B027", - # Allow boolean positional values in function calls, like `dict.get(... True)` - "FBT003", - # Ignore checks for possible passwords - "S105", "S106", "S107", - # Ignore complexity - "C901", "PLR0911", "PLR0912", "PLR0913", "PLR0915", - # Argument name should be lowercase - "N803", - # fString without a placeholder - "F541", - # Prefer absolute imports over relative imports - "TID252", - # Boolean default positional argument in function definition - "FBT001", "FBT002", -] -unfixable = [ - # Don't touch unused imports - "F401", -] - -[tool.ruff.isort] -known-first-party = ["kumaone"] - -[tool.ruff.flake8-tidy-imports] -ban-relative-imports = "all" - -[tool.ruff.per-file-ignores] -# Tests can use magic values, assertions, and relative imports -"tests/**/*" = ["PLR2004", "S101", "TID252"] - -[tool.coverage.run] -source_pkgs = ["kumaone", "tests"] -branch = true -parallel = true -omit = [ - "src/kumaone/__about__.py", -] - -[tool.coverage.paths] -kumaone = ["src/kumaone", "*/kumaone/src/kumaone"] -tests = ["tests", "*/kumaone/tests"] - -[tool.coverage.report] -exclude_lines = [ - "no cov", - "if __name__ == .__main__.:", - "if TYPE_CHECKING:", -] - -[tool.bumpversion] -current_version = "0.0.1-alpha.9" -#parse = "(?P\\d+)\\.(?P\\d+)\\.(?P\\d+)" -#serialize = ["{major}.{minor}.{patch}"] -parse = """(?x) - (?P[0-9]+) - \\.(?P[0-9]+) - \\.(?P[0-9]+) - (?: - -(?Palpha|beta|rc|stable) - (?:.(?P[0-9]+))? - )? -""" -serialize = [ - "{major}.{minor}.{patch}-{pre_label}.{pre_n}", - "{major}.{minor}.{patch}", -] -regex = false -ignore_missing_version = false -tag = false -sign_tags = false -tag_name = "v{new_version}" -tag_message = "Bump version: {current_version} → {new_version}" -allow_dirty = false -commit = true -message = "Bump version: {current_version} → {new_version}" -commit_args = "" - -[[tool.bumpversion.files]] -filename = "src/kumaone/__about__.py" -search = '__version__ = "{current_version}"' -replace = '__version__ = "{new_version}"' - -[[tool.bumpversion.files]] -filename = "pyproject.toml" -search = "{current_version}" -replace = "{new_version}" - -[tool.bumpversion.parts.pre_label] -optional_value = "stable" -values =[ - "alpha", - "beta", - "rc", - "stable", -] -[tool.bumpversion.parts.pre_n] -independent = true +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[project] +name = "kumaone" +dynamic = ["version"] +description = 'Automation friendly bulk action CLI helper for Uptime Kuma.' +readme = "README.md" +requires-python = ">=3.9" +license = "BSD-3-Clause" +keywords = ["kumaone", "kuma", "uptime-kuma", "monitoring", "cli", "python3"] +authors = [ + { name = "Dalwar Hossain", email = "dalwar23@pm.me" }, +] +classifiers = [ + "Development Status :: 3 - Alpha", + "Environment :: Console", + "License :: OSI Approved", + "Programming Language :: Python", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: Implementation :: PyPy", +] +dependencies = [ + "python-socketio[client] >= 5.11.0", + "pyyaml >= 6.0.1", + "requests >= 2.31.0", + "typer >= 0.12.3", + "validators >= 0.22.0", + "colorama >= 0.4.6" +] + +[project.urls] +Documentation = "https://kumaone.rtfd.io/" +Issues = "https://github.com/dalwar23/kumaone/issues" +Source = "https://github.com/dalwar23/kumaone" + +[project.scripts] +kumaone = "src.kumaone.main:app" + +[tool.hatch.version] +path = "src/kumaone/__about__.py" + +[tool.hatch.build] +include = [ + "src/kumaone", +] + +[tool.hatch.build.targets.sdist] +exclude = [ + ".github/", + "docs/", +] + +[tool.hatch.envs.default] +dependencies = [ + "coverage[toml]>=7.4.0", + "pytest", +] +[tool.hatch.envs.default.scripts] +test = "pytest {args:tests}" +test-cov = "coverage run -m pytest {args:tests}" +cov-report = [ + "- coverage combine", + "coverage report", +] +cov = [ + "test-cov", + "cov-report", +] + +[[tool.hatch.envs.all.matrix]] +python = ["3.9", "3.10", "3.11", "3.12"] + +[tool.hatch.envs.lint] +detached = true +dependencies = [ + "black>=23.12.1", + "mypy>=1.8.0", + "ruff>=0.1.14", + "flake8>=7.0.0", +] +[tool.hatch.envs.lint.scripts] +typing = "mypy --install-types --non-interactive {args:src/kumaone tests}" +style = [ + "ruff {args:.}", + "black --check --diff {args:.}", +] +fmt = [ + "black {args:.}", + "ruff --fix {args:.}", + "style", +] +all = [ + "style", + "typing", +] + +[tool.black] +target-version = ["py312"] +line-length = 120 +skip-string-normalization = true + +[tool.ruff] +target-version = "py312" +line-length = 120 +select = [ + "A", + "ARG", + "B", + "C", + "DTZ", + "E", + "EM", + "F", + "FBT", + "I", + "ICN", + "ISC", + "N", + "PLC", + "PLE", + "PLR", + "PLW", + "Q", + "RUF", + "S", + "T", + "TID", + "UP", + "W", + "YTT", +] +ignore = [ + # Allow non-abstract empty methods in abstract base classes + "B027", + # Allow boolean positional values in function calls, like `dict.get(... True)` + "FBT003", + # Ignore checks for possible passwords + "S105", "S106", "S107", + # Ignore complexity + "C901", "PLR0911", "PLR0912", "PLR0913", "PLR0915", + # Argument name should be lowercase + "N803", + # fString without a placeholder + "F541", + # Prefer absolute imports over relative imports + "TID252", + # Boolean default positional argument in function definition + "FBT001", "FBT002", +] +unfixable = [ + # Don't touch unused imports + "F401", +] + +[tool.ruff.isort] +known-first-party = ["kumaone"] + +[tool.ruff.flake8-tidy-imports] +ban-relative-imports = "all" + +[tool.ruff.per-file-ignores] +# Tests can use magic values, assertions, and relative imports +"tests/**/*" = ["PLR2004", "S101", "TID252"] + +[tool.coverage.run] +source_pkgs = ["kumaone", "tests"] +branch = true +parallel = true +omit = [ + "src/kumaone/__about__.py", +] + +[tool.coverage.paths] +kumaone = ["src/kumaone", "*/kumaone/src/kumaone"] +tests = ["tests", "*/kumaone/tests"] + +[tool.coverage.report] +exclude_lines = [ + "no cov", + "if __name__ == .__main__.:", + "if TYPE_CHECKING:", +] + +[tool.bumpversion] +current_version = "0.0.1-alpha.10" +#parse = "(?P\\d+)\\.(?P\\d+)\\.(?P\\d+)" +#serialize = ["{major}.{minor}.{patch}"] +parse = """(?x) + (?P[0-9]+) + \\.(?P[0-9]+) + \\.(?P[0-9]+) + (?: + -(?Palpha|beta|rc|stable) + (?:.(?P[0-9]+))? + )? +""" +serialize = [ + "{major}.{minor}.{patch}-{pre_label}.{pre_n}", + "{major}.{minor}.{patch}", +] +regex = false +ignore_missing_version = false +tag = false +sign_tags = false +tag_name = "v{new_version}" +tag_message = "Bump version: {current_version} → {new_version}" +allow_dirty = false +commit = true +message = "Bump version: {current_version} → {new_version}" +commit_args = "" + +[[tool.bumpversion.files]] +filename = "src/kumaone/__about__.py" +search = '__version__ = "{current_version}"' +replace = '__version__ = "{new_version}"' + +[[tool.bumpversion.files]] +filename = "pyproject.toml" +search = "{current_version}" +replace = "{new_version}" + +[tool.bumpversion.parts.pre_label] +optional_value = "stable" +values =[ + "alpha", + "beta", + "rc", + "stable", +] +[tool.bumpversion.parts.pre_n] +independent = true diff --git a/src/kumaone/__about__.py b/src/kumaone/__about__.py index 4954f2a..650c658 100644 --- a/src/kumaone/__about__.py +++ b/src/kumaone/__about__.py @@ -7,7 +7,7 @@ year = datetime.now().year -__version__ = "0.0.1-alpha.9" +__version__ = "0.0.1-alpha.10" __author__ = "Dalwar Hossain" __license__ = "BSD 3-Clause" __home_page__ = "https://kumaone.rtfd.io" From d811c44c2508b12d20f9fede0961c12c66aa233c Mon Sep 17 00:00:00 2001 From: dalwar23 <5631766+dalwar23@users.noreply.github.com> Date: Tue, 10 Dec 2024 23:14:38 +0100 Subject: [PATCH 13/13] update changelog Signed-off-by: dalwar23 <5631766+dalwar23@users.noreply.github.com> --- CHANGELOG.md | 6 ++++++ Pipfile.lock | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index befa395..19c8165 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## 0.0.1-alpha.10 (11.12.2024) + +- Deprecate support for python 3.8 +- Add GiHub Actions for simple checks +- Running `kumaone` without any option will invoke help + ## 0.0.1-alpha.9 (10.12.2024) - Release patch by @dalwar23 in https://github.com/devopsforhumans/kumaone/pull/18 diff --git a/Pipfile.lock b/Pipfile.lock index b69ccc8..2c1620b 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "5d2160c34f75afe5837c9fe8b56411097609479b94623b33fe706c9ccdb00311" + "sha256": "b6cc36065d24507f5e7ff0a4714bef7eeed24f06e8d3d930620f2bc4ed7e10b5" }, "pipfile-spec": 6, "requires": {},