Skip to content
Closed
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
13 changes: 13 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -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"
15 changes: 15 additions & 0 deletions .github/workflows/ruff-format.yml
Original file line number Diff line number Diff line change
@@ -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
15 changes: 15 additions & 0 deletions .github/workflows/ruff-lint.yml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion omdb/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
""" the omdb module """
"""the omdb module"""

from omdb.exceptions import OMDBException, OMDBLimitReached, OMDBNoResults, OMDBTooManyResults
from omdb.omdb import OMDB
Expand Down
3 changes: 1 addition & 2 deletions omdb/exceptions.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
""" Exceptions for the pyomdbapi project """

"""Exceptions for the pyomdbapi project"""

from typing import Dict

Check failure on line 3 in omdb/exceptions.py

View workflow job for this annotation

GitHub Actions / build

Ruff (UP035)

omdb/exceptions.py:3:1: UP035 `typing.Dict` is deprecated, use `dict` instead


class OMDBException(Exception):
Expand Down Expand Up @@ -47,7 +46,7 @@
params (dict): The parameters used when the exception was raised
"""

def __init__(self, error: str, params: Dict):

Check failure on line 49 in omdb/exceptions.py

View workflow job for this annotation

GitHub Actions / build

Ruff (UP006)

omdb/exceptions.py:49:44: UP006 Use `dict` instead of `Dict` for type annotation
"""init"""
self._params = params
self._error = error
Expand All @@ -59,7 +58,7 @@
return self._error

@property
def params(self) -> Dict:

Check failure on line 61 in omdb/exceptions.py

View workflow job for this annotation

GitHub Actions / build

Ruff (UP006)

omdb/exceptions.py:61:25: UP006 Use `dict` instead of `Dict` for type annotation
"""dict: The parameters used when the exception was raised"""
return self._params

Expand All @@ -72,7 +71,7 @@
params (dict): The parameters used when the exception was raised
"""

def __init__(self, error: str, params: Dict):

Check failure on line 74 in omdb/exceptions.py

View workflow job for this annotation

GitHub Actions / build

Ruff (UP006)

omdb/exceptions.py:74:44: UP006 Use `dict` instead of `Dict` for type annotation
"""init"""
self._params = params
self._error = error
Expand All @@ -84,7 +83,7 @@
return self._error

@property
def params(self) -> Dict:

Check failure on line 86 in omdb/exceptions.py

View workflow job for this annotation

GitHub Actions / build

Ruff (UP006)

omdb/exceptions.py:86:25: UP006 Use `dict` instead of `Dict` for type annotation
"""dict: The parameters used when the exception was raised"""
return self._params

Expand Down
3 changes: 2 additions & 1 deletion omdb/omdb.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
""" OMDB API python wrapper library """
"""OMDB API python wrapper library"""

from math import ceil
from typing import Any, Dict, Optional

Check failure on line 4 in omdb/omdb.py

View workflow job for this annotation

GitHub Actions / build

Ruff (UP035)

omdb/omdb.py:4:1: UP035 `typing.Dict` is deprecated, use `dict` instead

import requests

Expand Down Expand Up @@ -76,7 +77,7 @@
"""set the strict property"""
self._strict = bool(val)

def search(self, title: str, pull_all_results: bool = True, page: int = 1, **kwargs) -> Dict:

Check failure on line 80 in omdb/omdb.py

View workflow job for this annotation

GitHub Actions / build

Ruff (UP006)

omdb/omdb.py:80:93: UP006 Use `dict` instead of `Dict` for type annotation
"""Perform a search based on title

Args:
Expand Down Expand Up @@ -116,7 +117,7 @@

return results

def get(self, *, title: Optional[str] = None, imdbid: Optional[str] = None, **kwargs) -> Dict:

Check failure on line 120 in omdb/omdb.py

View workflow job for this annotation

GitHub Actions / build

Ruff (UP006)

omdb/omdb.py:120:94: UP006 Use `dict` instead of `Dict` for type annotation
"""Retrieve a specific movie, series, or episode

Args:
Expand Down Expand Up @@ -155,7 +156,7 @@
params.update(kwargs)
return self.search(title, pull_all_results, page, **params)

def search_series(self, title: str, pull_all_results: bool = True, page: int = 1, **kwargs) -> Dict:

Check failure on line 159 in omdb/omdb.py

View workflow job for this annotation

GitHub Actions / build

Ruff (UP006)

omdb/omdb.py:159:100: UP006 Use `dict` instead of `Dict` for type annotation
"""Search for a TV series by title

Args:
Expand All @@ -169,7 +170,7 @@
params.update(kwargs)
return self.search(title, pull_all_results, page, **params)

def get_movie(self, *, title: Optional[str] = None, imdbid: Optional[str] = None, **kwargs) -> Dict:

Check failure on line 173 in omdb/omdb.py

View workflow job for this annotation

GitHub Actions / build

Ruff (UP006)

omdb/omdb.py:173:100: UP006 Use `dict` instead of `Dict` for type annotation
"""Retrieve a movie by title or IMDB id

Args:
Expand Down
2 changes: 1 addition & 1 deletion omdb/utilities.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
""" A utilitites suite """
"""A utilitites suite"""


def camelcase_to_snake_case(_input: str) -> str:
Expand Down
115 changes: 99 additions & 16 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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

Expand All @@ -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"
Loading