Skip to content

Commit

Permalink
Makefile and dependency updates
Browse files Browse the repository at this point in the history
  • Loading branch information
haukex committed Oct 3, 2024
1 parent 81d1095 commit 6b59877
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 28 deletions.
11 changes: 6 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,8 @@ py_code_locs = unzipwalk tests docs/*.py docs/_ext/*.py
requirement_txts = requirements.txt dev/requirements.txt docs/requirements.txt
perm_checks = ./* .gitignore .vscode .github

# Remember venv only sets up the `python3` alias if it was called from `python3`,
# so it's generally more reliable to call `python` instead, though on some old
# systems that may still refer to Python 2 (`sudo apt-get install python-is-python3`).
PYTHON3BIN = python # user can change this on the `make` command line
# The user can change the following on the command line, but note that some tools below won't use this variable!
PYTHON3BIN = python

.PHONY: help tasklist installdeps test
.PHONY: smoke-checks nix-checks shellcheck ver-checks other-checks coverage unittest
Expand Down Expand Up @@ -43,6 +41,9 @@ installdeps: ## Install project dependencies
smoke-checks: ## Basic smoke tests
@set -euxo pipefail
# example: [[ "$$OSTYPE" =~ linux.* ]] # this project only runs on Linux
# make sure that PYTHON3BIN and `python3` refer to the same Python (on some old systems `python` is still Python 2 - `sudo apt-get install python-is-python3`)
[[ "$$( $(PYTHON3BIN) -c 'import sys; print(sys.exec_prefix+" "+sys.version.replace("\n",""))' )" == "$$( python3 -c 'import sys; print(sys.exec_prefix+" "+sys.version.replace("\n",""))' )" ]]
# make sure we're on Python 3
[[ "$$($(PYTHON3BIN) --version)" =~ ^Python\ 3\. ]]

nix-checks: ## Checks that depend on a *NIX OS/FS
Expand Down Expand Up @@ -99,7 +100,7 @@ coverage: ## Run unit tests with coverage
$(PYTHON3BIN) -m coverage xml --rcfile=pyproject.toml
set +x
# We don't use --fail_under=100 above because then the report won't be written.
# Also, the GitHub macOS runners didn't like the following (probably due to the old bash),
# Also, the GitHub macOS runners didn't like doing the following check in bash (probably due to the old bash),
# so we'll just hand it off to Perl:
$(PYTHON3BIN) -m coverage json --rcfile=pyproject.toml -o- | jq .totals.percent_covered \
| perl -wMstrict -0777 -MTerm::ANSIColor=colored -ne \
Expand Down
26 changes: 13 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ file’s header is currently not possible due to

<a id="function-unzipwalk"></a>

### unzipwalk.unzipwalk(paths: [str](https://docs.python.org/3/library/stdtypes.html#str) | [PathLike](https://docs.python.org/3/library/os.html#os.PathLike) | [bytes](https://docs.python.org/3/library/stdtypes.html#bytes) | [Iterable](https://docs.python.org/3/library/collections.abc.html#collections.abc.Iterable)[[str](https://docs.python.org/3/library/stdtypes.html#str) | [PathLike](https://docs.python.org/3/library/os.html#os.PathLike) | [bytes](https://docs.python.org/3/library/stdtypes.html#bytes)], \*, matcher: [Callable](https://docs.python.org/3/library/collections.abc.html#collections.abc.Callable)[[[Sequence](https://docs.python.org/3/library/collections.abc.html#collections.abc.Sequence)[[PurePath](https://docs.python.org/3/library/pathlib.html#pathlib.PurePath)]], [bool](https://docs.python.org/3/library/functions.html#bool)] | [None](https://docs.python.org/3/library/constants.html#None) = None, raise_errors: [bool](https://docs.python.org/3/library/functions.html#bool) = True)
### unzipwalk.unzipwalk(paths: [str](https://docs.python.org/3/library/stdtypes.html#str) | [PathLike](https://docs.python.org/3/library/os.html#os.PathLike) | [bytes](https://docs.python.org/3/library/stdtypes.html#bytes) | [Iterable](https://docs.python.org/3/library/collections.abc.html#collections.abc.Iterable)[[str](https://docs.python.org/3/library/stdtypes.html#str) | [PathLike](https://docs.python.org/3/library/os.html#os.PathLike) | [bytes](https://docs.python.org/3/library/stdtypes.html#bytes)], \*, matcher: [Callable](https://docs.python.org/3/library/collections.abc.html#collections.abc.Callable)[[[Sequence](https://docs.python.org/3/library/collections.abc.html#collections.abc.Sequence)[[PurePath](https://docs.python.org/3/library/pathlib.html#pathlib.PurePath)]], [bool](https://docs.python.org/3/library/functions.html#bool)] | [None](https://docs.python.org/3/library/constants.html#None) = None, raise_errors: [bool](https://docs.python.org/3/library/functions.html#bool) = True) → [Generator](https://docs.python.org/3/library/collections.abc.html#collections.abc.Generator)[[UnzipWalkResult](#unzipwalk.UnzipWalkResult), [None](https://docs.python.org/3/library/constants.html#None), [None](https://docs.python.org/3/library/constants.html#None)]

This generator recursively walks into directories and compressed files and yields named tuples of type [`UnzipWalkResult`](#unzipwalk.UnzipWalkResult).

Expand Down Expand Up @@ -126,7 +126,7 @@ Intended for internal use, mainly when type checkers are not being used.

<a id="unzipwalk.UnzipWalkResult.checksum_line"></a>

#### checksum_line(hash_algo: [str](https://docs.python.org/3/library/stdtypes.html#str), \*, raise_errors: [bool](https://docs.python.org/3/library/functions.html#bool) = True)
#### checksum_line(hash_algo: [str](https://docs.python.org/3/library/stdtypes.html#str), \*, raise_errors: [bool](https://docs.python.org/3/library/functions.html#bool) = True)[str](https://docs.python.org/3/library/stdtypes.html#str)

Encodes this object into a line of text suitable for use as a checksum line.

Expand All @@ -143,7 +143,7 @@ Requires that the file handle be open (for files), and will read from it to gene

<a id="unzipwalk.UnzipWalkResult.from_checksum_line"></a>

#### *classmethod* from_checksum_line(line: [str](https://docs.python.org/3/library/stdtypes.html#str), \*, windows: [bool](https://docs.python.org/3/library/functions.html#bool) = False)
#### *classmethod* from_checksum_line(line: [str](https://docs.python.org/3/library/stdtypes.html#str), \*, windows: [bool](https://docs.python.org/3/library/functions.html#bool) = False)[UnzipWalkResult](#unzipwalk.UnzipWalkResult) | [None](https://docs.python.org/3/library/constants.html#None)

Decodes a checksum line as produced by [`checksum_line()`](#unzipwalk.UnzipWalkResult.checksum_line).

Expand Down Expand Up @@ -202,7 +202,7 @@ An error was encountered with this file, when the `raise_errors` option is off.

<a id="unzipwalk.recursive_open"></a>

### unzipwalk.recursive_open(fns: [Sequence](https://docs.python.org/3/library/collections.abc.html#collections.abc.Sequence)[[str](https://docs.python.org/3/library/stdtypes.html#str) | [PathLike](https://docs.python.org/3/library/os.html#os.PathLike)], encoding=None, errors=None, newline=None)
### unzipwalk.recursive_open(fns: [Sequence](https://docs.python.org/3/library/collections.abc.html#collections.abc.Sequence)[[str](https://docs.python.org/3/library/stdtypes.html#str) | [PathLike](https://docs.python.org/3/library/os.html#os.PathLike)], encoding=None, errors=None, newline=None)[Generator](https://docs.python.org/3/library/collections.abc.html#collections.abc.Generator)[[ReadOnlyBinary](#unzipwalk.ReadOnlyBinary) | TextIOWrapper, [None](https://docs.python.org/3/library/constants.html#None), [None](https://docs.python.org/3/library/constants.html#None)]

This context manager allows opening files nested inside archives directly.

Expand Down Expand Up @@ -239,19 +239,19 @@ Note [`unzipwalk()`](#function-unzipwalk) automatically closes files.

#### *property* name *: [str](https://docs.python.org/3/library/stdtypes.html#str)*

#### close()
#### close()[None](https://docs.python.org/3/library/constants.html#None)

#### *property* closed *: [bool](https://docs.python.org/3/library/functions.html#bool)*

#### readable()
#### readable()[Literal](https://docs.python.org/3/library/typing.html#typing.Literal)[True]

#### read(n: [int](https://docs.python.org/3/library/functions.html#int) = -1)
#### read(n: [int](https://docs.python.org/3/library/functions.html#int) = -1)[bytes](https://docs.python.org/3/library/stdtypes.html#bytes)

#### readline(limit: [int](https://docs.python.org/3/library/functions.html#int) = -1)
#### readline(limit: [int](https://docs.python.org/3/library/functions.html#int) = -1)[bytes](https://docs.python.org/3/library/stdtypes.html#bytes)

#### seekable()
#### seekable()[bool](https://docs.python.org/3/library/functions.html#bool)

#### seek(offset: [int](https://docs.python.org/3/library/functions.html#int), whence: [int](https://docs.python.org/3/library/functions.html#int) = 0)
#### seek(offset: [int](https://docs.python.org/3/library/functions.html#int), whence: [int](https://docs.python.org/3/library/functions.html#int) = 0)[int](https://docs.python.org/3/library/functions.html#int)

## Command-Line Interface

Expand Down Expand Up @@ -279,9 +279,9 @@ optional arguments:
* Note --exclude currently only matches against the final name in the
sequence, excluding path names, but this interface may change in future
versions. For more control, use the library instead of this command-line tool.
** Possible values for ALGO: blake2b, blake2s, md4, md5, md5-sha1, mdc2,
ripemd160, sha1, sha224, sha256, sha384, sha3_224, sha3_256, sha3_384,
sha3_512, sha512, sha512_224, sha512_256, shake_128, shake_256, sm3, whirlpool
** Possible values for ALGO: blake2b, blake2s, md4, md5, md5-sha1, ripemd160,
sha1, sha224, sha256, sha384, sha3_224, sha3_256, sha3_384, sha3_512, sha512,
sha512_224, sha512_256, shake_128, shake_256, sm3, whirlpool
```

The available checksum algorithms may vary depending on your system and Python version.
Expand Down
10 changes: 5 additions & 5 deletions dev/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# requirements *for development*!
igbpyutils == 0.6.0
simple-perms == 0.9.1
coverage[toml] == 7.5.4
pylint == 3.2.4
mypy == 1.10.1
flake8 == 7.1.0
coverage[toml] == 7.6.1
pylint == 3.3.1
mypy == 1.11.2
flake8 == 7.1.1
Flake8-pyproject == 1.2.3
pur == 7.3.2
pre-commit == 3.7.1
pre-commit == 3.8.0
8 changes: 4 additions & 4 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
tomli == 2.0.1
sphinx == 7.3.7
sphinx-markdown-builder == 0.6.6
types-docutils == 0.21.0.20240423
tomli == 2.0.2
sphinx == 7.4.7
sphinx-markdown-builder == 0.6.7
types-docutils == 0.21.0.20240907
4 changes: 3 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,9 @@ inlinevar-naming-style = "snake_case"
[tool.pylint.design]

# Maximum number of arguments for function / method.
max-args = 7
max-args = 20
# too-many-positional-arguments default is 5
max-positional-arguments = 4

# Maximum number of attributes for a class (see R0902).
max-attributes = 10
Expand Down

0 comments on commit 6b59877

Please sign in to comment.