Skip to content

Commit 55f4d7d

Browse files
authored
Merge pull request PacktPublishing#4 from PacktPublishing/version_bump
Bump version numbers of dependencies
2 parents 889282c + 8d964f0 commit 55f4d7d

File tree

11 files changed

+117
-114
lines changed

11 files changed

+117
-114
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,3 +158,5 @@ cython_debug/
158158
# and can be added to the global gitignore or merged into this file. For a more nuclear
159159
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
160160
#.idea/
161+
162+
.idea/

Chapter06/ch06_ex1.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def test_facti() -> None:
5050
assert facti(1000) == factorial(1000)
5151
assert facti(2000) == factorial(2000)
5252
if sys.version_info.minor > 10:
53-
sys.set_int_max_str_digits(6000) # type: ignore [attr-defined]
53+
sys.set_int_max_str_digits(6000)
5454
assert len(str(facti(2000))) == 5736
5555

5656

@@ -82,7 +82,7 @@ def test_facts() -> None:
8282
assert fasts(1000) == factorial(1000)
8383
assert fasts(2000) == factorial(2000)
8484
if sys.version_info.minor > 10:
85-
sys.set_int_max_str_digits(6000) # type: ignore [attr-defined]
85+
sys.set_int_max_str_digits(6000)
8686
assert len(str(fasts(2000))) == 5736
8787

8888

Chapter06/ch06_ex2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ def test_mean_f() -> None:
428428
assert sum_x2(data_1) == approx(659.9762)
429429
assert mean_f(lambda x: True, data_1) == approx(7.5)
430430

431-
data_2: list[Any] = [None, None] + data_1[:5] + [None] + data_1[5:] + [None, None, None] # type: ignore [operator]
431+
data_2: list[Any] = [None, None] + data_1[:5] + [None] + data_1[5:] + [None, None, None]
432432
assert mean_f(lambda x: x is not None, data_2) == approx(7.5)
433433

434434

Chapter09/ch09_ex3.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ def test_num_cvt() -> None:
154154
from typing import Iterable, Iterator
155155

156156

157-
def convert(row_iter: Iterator[list[str]]) -> Union[Iterable[str], Iterable[float]]:
157+
def convert(row_iter: Iterator[list[str]]) -> Union[Iterable[tuple[str, ...]], Iterable[tuple[float, ...]]]:
158158
"""
159159
>>> s3890= ['', '2000', '2001', '2002', '2003', '2004', '2005', '2006', '2007', '2008', '2009', '', 'Per capita consumption of mozzarella cheese (US)Pounds (USDA)', '9.3', '9.7', '9.7', '9.7', '9.9', '10.2', '10.5', '11', '10.6', '10.6', '', 'Civil engineering doctorates awarded (US)Degrees awarded (National Science Foundation)', '480', '501', '540', '552', '547', '622', '655', '701', '712', '708', '', 'Correlation: 0.958648']
160160
>>> list(convert(column_data(s3890)))

Chapter10/ch10_ex2.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -58,18 +58,18 @@ class Card(tuple[str, int]):
5858
Suits = "\u2660", "\u2665", "\u2666", "\u2663"
5959
__slots__ = ()
6060

61-
def __new__(cls, rank: int, suit: str) -> "Card":
62-
obj = super().__new__(
63-
Card,
64-
cast(
65-
Iterable[Any],
66-
[
67-
suit,
68-
rank,
69-
],
70-
),
71-
)
72-
return obj
61+
def __new__(cls: type["Card"], rank: int, suit: str) -> "Card":
62+
obj = super().__new__( # type: ignore [type-var]
63+
cls,
64+
cast(
65+
Iterable[Any],
66+
[
67+
suit,
68+
rank,
69+
],
70+
),
71+
)
72+
return cast(Card, obj)
7373

7474
def __str__(self) -> str:
7575
return f"{self.rank:2d}{self.suit}"

Chapter12/ch12_ex1.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -363,18 +363,18 @@ def to_int(text: str, base: int = 10) -> int:
363363
FDT = TypeVar("FDT", bound=FloatFuncT)
364364

365365

366-
def normalized(mean: float, stdev: float) -> FDT:
366+
def normalized(mean: float, stdev: float) -> FloatFuncT:
367367
z_score: Callable[[float], float] = lambda x: (x - mean) / stdev
368368

369-
def concrete_decorator(function: FDT) -> FDT:
369+
def concrete_decorator(function: FloatFuncT) -> FloatFuncT:
370370
@wraps(function)
371371
def wrapped(data_arg: Iterable[float]) -> Iterator[float]:
372372
z = map(z_score, data_arg)
373373
return function(z)
374374

375-
return cast(FDT, wrapped)
375+
return cast(FloatFuncT, wrapped)
376376

377-
return cast(FDT, concrete_decorator)
377+
return cast(FloatFuncT, concrete_decorator)
378378

379379

380380
REPL_normalized = """

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ We’ll presume some familiarity with functional programming. Since Python is no
2929

3030
Some of the examples use exploratory data analysis (EDA) as a problem domain to show the value of functional programming. Some familiarity with basic probability and statistics will help with this. There are only a few examples that move into more serious data science.
3131

32-
You’ll need to have Python 3.10 installed and running.
32+
You’ll need to have Python 3.11 installed and running.
3333
For more information on Python, visit http://www.python.org/.
3434

3535
There are two paths to installing the required packages:
@@ -47,7 +47,7 @@ After the **conda** tool is installed,
4747
the required packages can be installed using the following:
4848

4949
```bash
50-
conda create -n functional3 --channel=conda-forge python=3.10 --file requirements-conda.txt
50+
conda create -n functional3 --channel=conda-forge python=3.11 --file requirements-conda.txt
5151
conda activate functional3
5252
python -m pip install pymonad==2.4.0
5353
```
@@ -114,4 +114,4 @@ $ tox -e ch01
114114
### Download a free PDF
115115

116116
<i>If you have already purchased a print or Kindle version of this book, you can get a DRM-free PDF version at no cost.<br>Simply click on the link to claim your free PDF.</i>
117-
<p align="center"> <a href="https://packt.link/free-ebook/9781803232577">https://packt.link/free-ebook/9781803232577 </a> </p>
117+
<p align="center"> <a href="https://packt.link/free-ebook/9781803232577">https://packt.link/free-ebook/9781803232577 </a> </p>

environment.yml

Lines changed: 66 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -3,82 +3,81 @@ channels:
33
- conda-forge
44
- defaults
55
dependencies:
6-
- attrs=21.4.0=pyhd8ed1ab_0
7-
- beautifulsoup4=4.11.1=pyha770c72_0
8-
- black=22.6.0=pyhd8ed1ab_0
6+
- beautifulsoup4=4.12.2=pyha770c72_0
7+
- black=23.3.0=py311h6eed73b_1
8+
- blinker=1.6.2=pyhd8ed1ab_0
99
- bzip2=1.0.8=h0d85af4_4
10-
- ca-certificates=2022.6.15=h033912b_0
11-
- click=8.1.3=py310h2ec42d9_0
12-
- colorama=0.4.5=pyhd8ed1ab_0
13-
- commonmark=0.9.1=py_0
14-
- dataclasses=0.8=pyhc8e2a94_3
15-
- distlib=0.3.5=pyhd8ed1ab_0
16-
- filelock=3.7.1=pyhd8ed1ab_0
17-
- flask=2.1.3=pyhd8ed1ab_0
18-
- freetype=2.10.4=h4cff582_1
19-
- future=0.18.2=py310h2ec42d9_5
20-
- giflib=5.2.1=hbcb3906_2
21-
- importlib-metadata=4.11.4=py310h2ec42d9_0
22-
- iniconfig=1.1.1=pyh9f0ad1d_0
10+
- ca-certificates=2023.5.7=h8857fd0_0
11+
- cachetools=5.3.1=pyhd8ed1ab_0
12+
- chardet=5.1.0=py311h6eed73b_0
13+
- click=8.1.4=unix_pyh707e725_0
14+
- colorama=0.4.6=pyhd8ed1ab_0
15+
- distlib=0.3.6=pyhd8ed1ab_0
16+
- exceptiongroup=1.1.2=pyhd8ed1ab_0
17+
- filelock=3.12.2=pyhd8ed1ab_0
18+
- flask=2.3.2=pyhd8ed1ab_0
19+
- freetype=2.12.1=h3f81eb7_1
20+
- importlib-metadata=6.8.0=pyha770c72_0
21+
- importlib_metadata=6.8.0=hd8ed1ab_0
22+
- iniconfig=2.0.0=pyhd8ed1ab_0
2323
- itsdangerous=2.1.2=pyhd8ed1ab_0
2424
- jinja2=3.1.2=pyhd8ed1ab_1
25-
- jpeg=9e=hac89ed1_2
26-
- lcms2=2.12=h577c468_0
27-
- lerc=3.0=he49afe7_0
28-
- libcxx=14.0.6=hce7ea42_0
29-
- libdeflate=1.12=hac89ed1_0
25+
- lcms2=2.15=h2dcdeff_1
26+
- lerc=4.0.0=hb486fe8_0
27+
- libcxx=16.0.6=hd57cbcb_0
28+
- libdeflate=1.18=hac1461d_0
29+
- libexpat=2.5.0=hf0c8a7f_1
3030
- libffi=3.4.2=h0d85af4_5
31-
- libpng=1.6.37=h5a3d3bf_3
32-
- libtiff=4.4.0=h9847915_1
33-
- libwebp=1.2.3=hf64df63_1
34-
- libwebp-base=1.2.3=hac89ed1_2
35-
- libxcb=1.13=h0d85af4_1004
36-
- libzlib=1.2.12=hfe4f2af_2
37-
- lz4-c=1.9.3=he49afe7_1
38-
- markupsafe=2.1.1=py310h1961e1f_1
39-
- mypy_extensions=0.4.3=py310h2ec42d9_5
40-
- ncurses=6.3=h96cf925_1
41-
- openjpeg=2.4.0=h6e7aa92_1
42-
- openssl=3.0.5=hfe4f2af_0
43-
- packaging=21.3=pyhd8ed1ab_0
44-
- pathspec=0.9.0=pyhd8ed1ab_0
45-
- pillow=9.2.0=py310hb3240ae_0
46-
- pip=22.2=pyhd8ed1ab_0
47-
- platformdirs=2.5.2=pyhd8ed1ab_1
48-
- pluggy=1.0.0=py310h2ec42d9_3
31+
- libjpeg-turbo=2.1.5.1=hb7f2c08_0
32+
- libpng=1.6.39=ha978bb4_0
33+
- libsqlite=3.42.0=h58db7d2_0
34+
- libtiff=4.5.1=hf955e92_0
35+
- libwebp-base=1.3.1=h0dc2134_0
36+
- libxcb=1.15=hb7f2c08_0
37+
- libzlib=1.2.13=h8a1eda9_5
38+
- markdown-it-py=3.0.0=pyhd8ed1ab_0
39+
- markupsafe=2.1.3=py311h2725bcf_0
40+
- mdurl=0.1.0=pyhd8ed1ab_0
41+
- mypy=1.4.1=py311h2725bcf_0
42+
- mypy_extensions=1.0.0=pyha770c72_0
43+
- ncurses=6.4=hf0c8a7f_0
44+
- openjpeg=2.5.0=h13ac156_2
45+
- openssl=3.1.1=h8a1eda9_1
46+
- packaging=23.1=pyhd8ed1ab_0
47+
- pathspec=0.11.1=pyhd8ed1ab_0
48+
- pillow=10.0.0=py311h7cb0e2d_0
49+
- pip=23.1.2=pyhd8ed1ab_0
50+
- platformdirs=3.8.1=pyhd8ed1ab_0
51+
- pluggy=1.2.0=pyhd8ed1ab_0
52+
- psutil=5.9.5=py311h5547dcb_0
4953
- pthread-stubs=0.4=hc929b4f_1001
50-
- py=1.11.0=pyh6c4a22f_0
51-
- pygments=2.12.0=pyhd8ed1ab_0
52-
- pyparsing=3.0.9=pyhd8ed1ab_0
53-
- pyrsistent=0.18.1=py310h1961e1f_1
54-
- pytest=7.1.2=py310h2ec42d9_0
55-
- python=3.10.5=hdd68b96_0_cpython
56-
- python_abi=3.10=2_cp310
57-
- pyyaml=6.0=py310h1961e1f_4
58-
- readline=8.1.2=h3899abd_0
59-
- rich=12.5.1=pyhd8ed1ab_0
60-
- setuptools=63.2.0=py310h2ec42d9_0
61-
- six=1.16.0=pyh6c4a22f_0
54+
- pygments=2.15.1=pyhd8ed1ab_0
55+
- pyproject-api=1.5.3=pyhd8ed1ab_0
56+
- pyrsistent=0.19.3=py311h5547dcb_0
57+
- pytest=7.4.0=pyhd8ed1ab_0
58+
- python=3.11.4=h30d4d87_0_cpython
59+
- python_abi=3.11=3_cp311
60+
- pyyaml=6.0=py311h5547dcb_5
61+
- readline=8.2=h9e318b2_1
62+
- rich=13.4.2=pyhd8ed1ab_0
63+
- setuptools=68.0.0=pyhd8ed1ab_0
6264
- soupsieve=2.3.2.post1=pyhd8ed1ab_0
63-
- sqlite=3.39.2=hd9f0692_0
6465
- tk=8.6.12=h5dbffcc_0
65-
- toml=0.10.2=pyhd8ed1ab_0
6666
- tomli=2.0.1=pyhd8ed1ab_0
6767
- toolz=0.12.0=pyhd8ed1ab_0
68-
- tox=3.25.1=pyhd8ed1ab_0
69-
- typed-ast=1.5.4=py310h6c45266_0
70-
- types-pyyaml=6.0.11=pyhd8ed1ab_0
71-
- typing_extensions=4.3.0=pyha770c72_0
72-
- tzdata=2022a=h191b570_0
73-
- virtualenv=20.16.1=py310h2ec42d9_0
74-
- werkzeug=2.2.0=pyhd8ed1ab_0
75-
- wheel=0.37.1=pyhd8ed1ab_0
76-
- xorg-libxau=1.0.9=h35c211d_0
68+
- tox=4.6.4=pyhd8ed1ab_0
69+
- types-pyyaml=6.0.12=pyhd8ed1ab_0
70+
- typing-extensions=4.7.1=hd8ed1ab_0
71+
- typing_extensions=4.7.1=pyha770c72_0
72+
- tzdata=2023c=h71feb2d_0
73+
- virtualenv=20.23.1=pyhd8ed1ab_0
74+
- werkzeug=2.3.6=pyhd8ed1ab_0
75+
- wheel=0.40.0=pyhd8ed1ab_0
76+
- xorg-libxau=1.0.11=h0dc2134_0
7777
- xorg-libxdmcp=1.1.3=h35c211d_0
78-
- xz=5.2.5=haf1e3a3_1
78+
- xz=5.2.6=h775f41a_0
7979
- yaml=0.2.5=h0d85af4_2
80-
- zipp=3.8.0=pyhd8ed1ab_0
81-
- zlib=1.2.12=hfe4f2af_2
82-
- zstd=1.5.2=ha9df2e0_2
80+
- zipp=3.16.0=pyhd8ed1ab_0
81+
- zstd=1.5.2=h829000d_7
8382
- pip:
84-
- pymonad==2.4.0
83+
- pymonad==2.4.0

requirements-conda.txt

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
# Used by conda to build an initial environment
2-
pillow==9.3.0
3-
beautifulsoup4==4.11.1
2+
pillow==10.0.0
3+
beautifulsoup4==4.12.2
44
toolz==0.12.0
5-
pyrsistent==0.18.1
6-
rich==12.5.1
5+
pyrsistent==0.19.3
6+
rich==13.4.2
77
pyyaml==6.0
8-
types-PyYAML==6.0.11
9-
mypy_extensions==0.4.3
10-
black==22.6.0
11-
flask==2.1.3
12-
tox==3.25.1
8+
types-PyYAML==6.0.12
9+
mypy_extensions==1.0.0
10+
black==23.3.0
11+
flask==2.3.2
12+
tox==4.6.4
1313
# Helpful to have this match tox.ini
14-
pytest==7.1.2
14+
pytest==7.4.0
15+
mypy==1.4.1
1516
# The following are not available in --channel=conda-forge
1617
# Use python -m pip install pymonad==2.4.0
1718
# pymonad==2.4.0

requirements.txt

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
# Used by TOX, but not by conda to build an initial environment
2-
pillow==9.3.0
3-
beautifulsoup4==4.11.1
4-
pymonad==2.4.0
2+
pillow==10.0.0
3+
beautifulsoup4==4.12.2
54
toolz==0.12.0
6-
pyrsistent==0.18.1
7-
rich==12.5.1
5+
pyrsistent==0.19.3
6+
rich==13.4.2
87
pyyaml==6.0
9-
types-PyYAML==6.0.11
10-
mypy_extensions==0.4.3
11-
black==22.6.0
12-
flask==2.1.3
13-
tox==3.25.1
8+
types-PyYAML==6.0.12
9+
mypy_extensions==1.0.0
10+
black==23.3.0
11+
flask==2.3.2
12+
tox==4.6.4
13+
pymonad==2.4.0
1414
# Helpful to have this match tox.ini
15-
pytest==7.1.2
15+
pytest==7.4.0
16+
mypy==1.4.1

0 commit comments

Comments
 (0)