Skip to content

Commit

Permalink
Fix Tox settings on local
Browse files Browse the repository at this point in the history
  • Loading branch information
dargueta committed Sep 9, 2023
1 parent 50f8f90 commit d8cb2c2
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion binobj/fields/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ def size(self) -> Union[int, str, "Field[int]", None]:
If the field is of variable size, such as a null-terminated string, this will be
``None``. Builtin fields set this automatically if ``const`` is given but you'll
need to implement :meth:`_size_for_value` in custom fields.
""" # noqa: D400,D401
"""
# TODO (dargueta) This return value is horrific. Rework it if possible.
return self._size

Expand Down
4 changes: 2 additions & 2 deletions binobj/pep526.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,8 @@ class MyStruct(binobj.Struct):
byte_offset = None

meta.components[name] = field_instance
field_index += 1 # noqa: SIM113
n_fields_found += 1 # noqa: SIM113
field_index += 1
n_fields_found += 1

# Overwrite the field declaration in the class with the derived field instance
# object. Otherwise, we'll end up with None or the default value provided:
Expand Down
1 change: 1 addition & 0 deletions binobj/structures.py
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,7 @@ def _to_dict_whatever_possible(self) -> MutableMapping[str, Any]:
" still be caught, please file a bug report.\n"
" Original message: %r" % (err.__module__, type(err).__name__, err),
DeprecationWarning,
2,
)

# Using ChainMap on Python 3.7 and 3.8 crashes for some reason when we try to
Expand Down
2 changes: 1 addition & 1 deletion binobj/varints.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def decode_integer_compact(stream: BinaryIO) -> int:
:return: The decoded integer.
:rtype: int
"""
sign = None # type: Optional[int]
sign: Optional[int] = None
value = 0

while True:
Expand Down
9 changes: 4 additions & 5 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
[tox]
envlist = py37, py38, py39, py310, py311, pypy37, pypy38, pypy39, lint, mypy
usedevelop = false
passenv = *
#usedevelop = false
skip_missing_interpreters = true
setenv =
PYTHON_KEYRING_BACKEND=keyring.backends.null.Keyring

[testenv]
allowlist_externals = poetry
skip_install = true
commands_pre =
poetry install --no-root --sync
commands = poetry run pytest --cov=binobj {posargs:tests}
commands =
poetry install
poetry run pytest --cov=binobj {posargs:tests}
passenv =
COV_PYTHON_VERSION
COV_PLATFORM
Expand Down

0 comments on commit d8cb2c2

Please sign in to comment.