diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..8703fdf --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,13 @@ +# To get started with Dependabot version updates, you'll need to specify which +# package ecosystems to update and where the package manifests are located. +# Please see the documentation for all configuration options: +# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file + +version: 2 +updates: + + - package-ecosystem: "github-actions" + directory: "/" + schedule: + # Check for updates to GitHub Actions every week + interval: "monthly" diff --git a/.github/workflows/ruff-format.yml b/.github/workflows/ruff-format.yml new file mode 100644 index 0000000..60a211e --- /dev/null +++ b/.github/workflows/ruff-format.yml @@ -0,0 +1,15 @@ +name: Ruff-Format +on: [workflow_dispatch, pull_request] +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Install Python + uses: actions/setup-python@v4 + with: + python-version: "3.*" + - uses: astral-sh/ruff-action@v3 + with: + args: "format --check" + continue-on-error: false \ No newline at end of file diff --git a/.github/workflows/ruff-lint.yml b/.github/workflows/ruff-lint.yml new file mode 100644 index 0000000..3399347 --- /dev/null +++ b/.github/workflows/ruff-lint.yml @@ -0,0 +1,15 @@ +name: Ruff-Lint +on: [workflow_dispatch, pull_request] +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Install Python + uses: actions/setup-python@v4 + with: + python-version: "3.*" + - uses: astral-sh/ruff-action@v3 + with: + args: "check --fix" + continue-on-error: false \ No newline at end of file diff --git a/omdb/__init__.py b/omdb/__init__.py index 0975404..ee1418e 100644 --- a/omdb/__init__.py +++ b/omdb/__init__.py @@ -1,4 +1,4 @@ -""" the omdb module """ +"""the omdb module""" from omdb.exceptions import OMDBException, OMDBLimitReached, OMDBNoResults, OMDBTooManyResults from omdb.omdb import OMDB diff --git a/omdb/exceptions.py b/omdb/exceptions.py index 76bbb24..ffb0122 100644 --- a/omdb/exceptions.py +++ b/omdb/exceptions.py @@ -1,5 +1,4 @@ -""" Exceptions for the pyomdbapi project """ - +"""Exceptions for the pyomdbapi project""" from typing import Dict diff --git a/omdb/omdb.py b/omdb/omdb.py index 7255ab6..ab70525 100644 --- a/omdb/omdb.py +++ b/omdb/omdb.py @@ -1,4 +1,5 @@ -""" OMDB API python wrapper library """ +"""OMDB API python wrapper library""" + from math import ceil from typing import Any, Dict, Optional diff --git a/omdb/utilities.py b/omdb/utilities.py index d672014..a95ebb1 100644 --- a/omdb/utilities.py +++ b/omdb/utilities.py @@ -1,4 +1,4 @@ -""" A utilitites suite """ +"""A utilitites suite""" def camelcase_to_snake_case(_input: str) -> str: diff --git a/pyproject.toml b/pyproject.toml index 014ea14..86f452c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -17,15 +17,14 @@ classifiers = [ "License :: OSI Approved", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.5", - "Programming Language :: Python :: 3.6", - "Programming Language :: Python :: 3.7", "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 :: 3.13", ] -requires-python = ">=3.6" +requires-python = ">=3.8" dependencies = ["requests>=2"] [tool.setuptools.dynamic] @@ -36,15 +35,9 @@ Homepage = "https://github.com/barrust/pyomdbapi" Bug-tracker = "https://github.com/barrust/pyomdbapi/issues" Documentation = "https://pyomdbapi.readthedocs.io/" -[tool.poetry] -packages = [{ include = "omdb" }] - [tool.setuptools.packages.find] include = ["omdb"] -[tool.flit.module] -name = "omdb" - [tool.distutils.bdist_wheel] universal = 0 @@ -62,15 +55,105 @@ profile = "black" [tool.black] line-length = 120 -target-version = ['py36'] +target-version = ['py38'] include = '\.pyi?$' -[build-system] -#requires = ["poetry-core>=1.0.0"] -#build-backend = "poetry.core.masonry.api" +############################################ +# Ruff +########################################### +[tool.ruff] +include = ["pyproject.toml", "omdb/**/*.py", "omdb/*.py"] +exclude = [ + ".bzr", + ".direnv", + ".eggs", + ".git", + ".git-rewrite", + ".hg", + ".ipynb_checkpoints", + ".mypy_cache", + ".nox", + ".pants.d", + ".pyenv", + ".pytest_cache", + ".pytype", + ".ruff_cache", + ".svn", + ".tox", + ".venv", + ".vscode", + "__pypackages__", + "_build", + "buck-out", + "build", + "dist", + "node_modules", + "site-packages", + "venv", +] + +# Same as Black. +line-length = 120 +indent-width = 4 + +# Assume Python 3.9 +target-version = "py39" + +[tool.ruff.lint] +# Enable Pyflakes (`F`) and a subset of the pycodestyle (`E`) codes by default. +# Unlike Flake8, Ruff doesn't enable pycodestyle warnings (`W`) or +# McCabe complexity (`C901`) by default. +select = [ + # pycodestyle + "E", + # Pyflakes + "F", + # pyupgrade + "UP", + # flake8-bugbear + "B", + # flake8-simplify + "SIM", + # isort + "I", +] +ignore = [] -#requires = ["flit_core>=3.2"] -#build-backend = "flit_core.buildapi" +# Allow fix for all enabled rules (when `--fix`) is provided. +fixable = ["ALL"] +unfixable = [] +# Allow unused variables when underscore-prefixed. +dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$" + +[tool.ruff.format] +# Like Black, use double quotes for strings. +quote-style = "double" + +# Like Black, indent with spaces, rather than tabs. +indent-style = "space" + +# Like Black, respect magic trailing commas. +skip-magic-trailing-comma = false + +# Like Black, automatically detect the appropriate line ending. +line-ending = "auto" + +# Enable auto-formatting of code examples in docstrings. Markdown, +# reStructuredText code/literal blocks and doctests are all supported. +# +# This is currently disabled by default, but it is planned for this +# to be opt-out in the future. +docstring-code-format = false + +# Set the line length limit used when formatting code snippets in +# docstrings. +# +# This only has an effect when the `docstring-code-format` setting is +# enabled. +docstring-code-line-length = "dynamic" + + +[build-system] requires = ["setuptools>=61.2.0", "wheel"] build-backend = "setuptools.build_meta"