Skip to content

Commit 19ca7b8

Browse files
authored
Merge branch 'master' into improve_git_hub_action_workflow
2 parents a2ef616 + f37c2f1 commit 19ca7b8

File tree

12 files changed

+218
-238
lines changed

12 files changed

+218
-238
lines changed

.github/workflows/pythonpackage.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
strategy:
1616
fail-fast: false
1717
matrix:
18-
python-version: ["3.8", "3.9", "3.10", "3.11"]
18+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
1919
include:
2020
- python-version: "3.11"
2121
use_pandas: 1
@@ -26,7 +26,11 @@ jobs:
2626
with:
2727
python-version: ${{ matrix.python-version }}
2828
cache: poetry
29-
- run: poetry install
29+
- run: |
30+
if ! poetry install; then
31+
poetry lock
32+
poetry install
33+
fi
3034
- name: Pylint (Python v${{ matrix.python-version }})
3135
run: poetry run pylint functional
3236
- name: black (Python v${{ matrix.python-version }})

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v4.6.0
3+
rev: v5.0.0
44
hooks:
55
- id: check-yaml
66
- id: check-added-large-files
@@ -23,6 +23,6 @@ repos:
2323
pass_filenames: false
2424

2525
- repo: https://github.com/astral-sh/ruff-pre-commit
26-
rev: v0.4.2
26+
rev: v0.6.0
2727
hooks:
2828
- id: ruff

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
## Release 1.6
44

55
- Added Python version to GitHub Action workflow job steps and set Black to show required formatting changes
6+
- Upgraded pre-commit hooks (pre-commit-hooks to `v5.0.0` and ruff-pre-commit to `v0.6.0`)
7+
- Added [run-test.sh](run-tests.sh) script that runs all checks on code
8+
- Added support for Python 3.12 and 3.13 by upgrading Pylint and disabling/fixing Pylint errors
69
- Corrected and improved language consistency in [readme](README.md) and `CHANGELOG.md`
710

811
## Release 1.5

DEVELOPER.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
For every release, the following process is used.
55

66
### Before Release
7-
1. From the project directory, run `./run-tests.sh` to insure unit tests pass (on python 2 and 3),
7+
1. From the project directory, run [./run-tests.sh](run-tests.sh) to insure unit tests pass (on python 2 and 3),
88
and that pylint succeeds
99
2. Push commit which is the candidate release to Github master
1010
3. Wait for tests to pass on [TravisCI](https://travis-ci.org/EntilZha/PyFunctional)

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -511,6 +511,7 @@ In order to be merged, all pull requests must:
511511

512512
## Supported Python Versions
513513

514+
- `PyFunctional` 1.6 is tested against Python 3.12 and Python 3.13.
514515
- `PyFunctional` 1.5 is tested against Python 3.8 to 3.11. PyPy3 is not tested, but bug fixed on best effort basis.
515516
- `PyFunctional` 1.4 supports and is tested against Python 3.6, Python 3.7, and PyPy3
516517
- `PyFunctional` 1.4 and above do not support python 2.7

functional/io.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ class ReusableFile(Generic[_FileConv_co]):
2121
lazy.
2222
"""
2323

24+
# pylint: disable=unknown-option-value
25+
# pylint: disable=too-many-positional-arguments
2426
# pylint: disable=too-many-instance-attributes
2527
def __init__(
2628
self,
@@ -84,6 +86,8 @@ def read(self):
8486
class CompressedFile(ReusableFile):
8587
magic_bytes: bytes | None = None
8688

89+
# pylint: disable=unknown-option-value
90+
# pylint: disable=too-many-positional-arguments
8791
# pylint: disable=too-many-instance-attributes
8892
def __init__(
8993
self,
@@ -115,6 +119,8 @@ def is_compressed(cls, data):
115119
class GZFile(CompressedFile):
116120
magic_bytes: bytes = b"\x1f\x8b\x08"
117121

122+
# pylint: disable=unknown-option-value
123+
# pylint: disable=too-many-positional-arguments
118124
# pylint: disable=too-many-instance-attributes
119125
def __init__(
120126
self,
@@ -170,6 +176,8 @@ def read(self):
170176
class BZ2File(CompressedFile):
171177
magic_bytes: bytes = b"\x42\x5a\x68"
172178

179+
# pylint: disable=unknown-option-value
180+
# pylint: disable=too-many-positional-arguments
173181
# pylint: disable=too-many-instance-attributes
174182
def __init__(
175183
self,
@@ -220,6 +228,8 @@ class XZFile(CompressedFile):
220228
magic_bytes: bytes = b"\xfd\x37\x7a\x58\x5a\x00"
221229

222230
# pylint: disable=too-many-instance-attributes
231+
# pylint: disable=unknown-option-value
232+
# pylint: disable=too-many-positional-arguments
223233
def __init__(
224234
self,
225235
path,
@@ -294,6 +304,8 @@ def get_read_function(filename: str, disable_compression: bool):
294304
return ReusableFile
295305

296306

307+
# pylint: disable=unknown-option-value
308+
# pylint: disable=too-many-positional-arguments
297309
def universal_write_open(
298310
path: str,
299311
mode: str,

functional/pipeline.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@
3939
from collections.abc import Iterable
4040

4141
# pylint: disable=deprecated-class
42-
from typing import Callable, Any, Iterator, NoReturn, Hashable
42+
from typing import Callable, Any, NoReturn
43+
from collections.abc import Iterator, Hashable
4344
from _typeshed import SupportsRichComparison
4445
from _typeshed import SupportsRichComparisonT
4546
from typing_extensions import TypeGuard
@@ -71,6 +72,8 @@ class Sequence(Generic[_T_co]):
7172
functional transformations and reductions in a data pipeline style
7273
"""
7374

75+
# pylint: disable=unknown-option-value
76+
# pylint: disable=too-many-positional-arguments
7477
def __init__(
7578
self,
7679
sequence: Iterable[_T_co],
@@ -442,6 +445,8 @@ def cartesian(
442445
) -> Sequence[tuple[_T_co, _T1, _T2, _T3, _T4]]:
443446
...
444447

448+
# pylint: disable=unknown-option-value
449+
# pylint: disable=too-many-positional-arguments
445450
@overload
446451
def cartesian(
447452
self,
@@ -454,6 +459,8 @@ def cartesian(
454459
) -> Sequence[tuple[_T_co, _T1, _T2, _T3, _T4, _T5]]:
455460
...
456461

462+
# pylint: disable=unknown-option-value
463+
# pylint: disable=too-many-positional-arguments
457464
@overload
458465
def cartesian(
459466
self,
@@ -1757,6 +1764,8 @@ def dict(self, default=None): # pyright: ignore[reportInconsistentOverload]
17571764
return self.to_dict(default=default) # type: ignore
17581765

17591766
# pylint: disable=too-many-locals
1767+
# pylint: disable=unknown-option-value
1768+
# pylint: disable=too-many-positional-arguments
17601769
def to_file(
17611770
self,
17621771
path: str,

functional/streams.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
import builtins
77

88
from itertools import chain
9-
from typing import Any, Iterable, Iterator, SupportsIndex
10-
from typing import TypeVar, overload
9+
from typing import Any, SupportsIndex, TypeVar, overload
10+
from collections.abc import Iterable, Iterator
1111
import typing
1212

1313
from functional.execution import ExecutionEngine, ParallelExecutionEngine
@@ -134,6 +134,8 @@ def _parse_args(
134134
no_wrap=_no_wrap,
135135
)
136136

137+
# pylint: disable=unknown-option-value
138+
# pylint: disable=too-many-positional-arguments
137139
def open(
138140
self,
139141
path: str,
@@ -233,6 +235,8 @@ def csv(
233235
csv_input = csvapi.reader(input_file, dialect=dialect, **fmt_params)
234236
return self(csv_input).cache(delete_lineage=True)
235237

238+
# pylint: disable=unknown-option-value
239+
# pylint: disable=too-many-positional-arguments
236240
def csv_dict_reader(
237241
self,
238242
csv_file: str | Iterator[str],

functional/transformations.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -569,7 +569,7 @@ def grouped_impl(size, sequence):
569569
batch = islice(iterator, size)
570570
yield list(chain((next(batch),), batch))
571571
except StopIteration:
572-
return
572+
pass
573573

574574

575575
def grouped_t(size):

0 commit comments

Comments
 (0)