Skip to content

Commit

Permalink
Update dependencies
Browse files Browse the repository at this point in the history
Apply formatting to conform to the latest standards
  • Loading branch information
amolenaar committed Jul 12, 2023
1 parent b24b8f2 commit 9145368
Show file tree
Hide file tree
Showing 7 changed files with 323 additions and 594 deletions.
23 changes: 7 additions & 16 deletions .pre-commit-config.yaml
@@ -1,29 +1,20 @@
repos:
- repo: https://github.com/ambv/black
rev: 20.8b1
rev: 23.7.0
hooks:
- id: black
language_version: python3
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.790
rev: v1.4.1
hooks:
- id: mypy
- repo: https://gitlab.com/pycqa/flake8
rev: 3.8.3
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: 'v0.0.277'
hooks:
- id: flake8
- id: ruff
args: [--fix]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
rev: v4.4.0
hooks:
- id: check-toml
- id: check-yaml
- repo: https://github.com/pre-commit/mirrors-isort
rev: v5.6.0
hooks:
- id: isort
additional_dependencies: [toml]
- repo: https://github.com/myint/docformatter
rev: v1.3.1
hooks:
- id: docformatter
args: [--in-place]
1 change: 0 additions & 1 deletion django_dci/account/models.py
Expand Up @@ -4,7 +4,6 @@


class Account(models.Model):

balance = models.DecimalField(decimal_places=2, max_digits=12)

def withdraw(self, amount):
Expand Down
6 changes: 3 additions & 3 deletions docs/conf.py
Expand Up @@ -53,8 +53,8 @@
master_doc = "index"

# General information about the project.
project = u"Roles"
copyright = u"2009-2021, Arjan Molenaar"
project = "Roles"
copyright = "2009-2021, Arjan Molenaar"

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down Expand Up @@ -179,7 +179,7 @@
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, documentclass [howto/manual]).
latex_documents = [
("index", "Roles.tex", u"Roles Documentation", u"Arjan Molenaar", "manual"),
("index", "Roles.tex", "Roles Documentation", "Arjan Molenaar", "manual"),
]

# The name of an image file (relative to this directory) to place at the top of
Expand Down
845 changes: 292 additions & 553 deletions poetry.lock

Large diffs are not rendered by default.

32 changes: 16 additions & 16 deletions pyproject.toml
Expand Up @@ -31,12 +31,9 @@ classifiers = [
python = "^3.7"

[tool.poetry.dev-dependencies]
pytest = "^6.1"
pytest-cov = "^3.0"
pytest-runner = "^5.1"
black = { version = "^20.8b1", python = "^3.7" }
mypy = "0.910"
pre-commit = "^2.9"
pytest = "^7.4"
pytest-cov = "^4.0"
mypy = "^1.4"
tox = "^3.20"

[build-system]
Expand Down Expand Up @@ -85,14 +82,17 @@ testpaths = [
]
addopts = "--doctest-modules --doctest-glob='*.md' --doctest-glob='*.txt'"

[tool.isort]
multi_line_output = 3
include_trailing_comma = true
force_grid_wrap = 0
use_parentheses = true
line_length = 88
known_third_party = ["pytest"]
skip = ".venv,build,dist"

[tool.coverage.run]
source = ["generic"]
source = ["roles"]

[tool.ruff]
ignore = ["E501", "B019"]
line-length = 88
select = [
"B",
"B9",
"C",
"E",
"F",
"W",
]
2 changes: 1 addition & 1 deletion roles/role.py
Expand Up @@ -300,7 +300,7 @@ def newclass(self, cls: Type[T], rolebases: Tuple[Type, ...]) -> Type[R]:
# Role class not yet defined, define a new class
d: Dict[str, object] = {"__module__": cls.__module__, "__doc__": cls.__doc__}
try:
d["__slots__"] = cls.__slots__
d["__slots__"] = cls.__slots__ # type: ignore[attr-defined]
except AttributeError:
pass

Expand Down
8 changes: 4 additions & 4 deletions test/test_types.py
Expand Up @@ -50,12 +50,12 @@ def __init__(self):


def test_dict():
d: Dict[int, int] = dict()
d: Dict[int, int] = {}
with pytest.raises(TypeError) as exc_info:
SimpleRole(d) # type: ignore[call-arg]
assert (
exc_info.value.args[0]
== "__class__ assignment only supported for heap types or ModuleType subclasses"
== "__class__ assignment only supported for mutable types or ModuleType subclasses"
)


Expand All @@ -78,7 +78,7 @@ def test_list():
SimpleRole(d) # type: ignore[call-arg]
assert (
exc_info.value.args[0]
== "__class__ assignment only supported for heap types or ModuleType subclasses"
== "__class__ assignment only supported for mutable types or ModuleType subclasses"
)


Expand All @@ -99,7 +99,7 @@ def test_tuple():
SimpleRole(d) # type: ignore[call-arg]
assert (
exc_info.value.args[0]
== "__class__ assignment only supported for heap types or ModuleType subclasses"
== "__class__ assignment only supported for mutable types or ModuleType subclasses"
)


Expand Down

0 comments on commit 9145368

Please sign in to comment.