Skip to content

Commit b5853eb

Browse files
authored
Switch from pyzstd to zstandard (#1514)
The [zstandard](https://github.com/indygreg/python-zstandard) library has clearer maintainership. I have also taken this opportunity to sort the list of requirements.
1 parent 2420c62 commit b5853eb

File tree

2 files changed

+38
-38
lines changed

2 files changed

+38
-38
lines changed

evals/data.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@
1212
from collections.abc import Iterator
1313
from functools import partial
1414
from pathlib import Path
15-
from typing import Any, List, Optional, Sequence, Text, Union
15+
from typing import Any, BinaryIO, List, Optional, Sequence, Text, Union
1616

1717
import blobfile as bf
1818
import lz4.frame
1919
import pydantic
20-
import pyzstd
20+
import zstandard
2121

2222
logger = logging.getLogger(__name__)
2323

@@ -37,11 +37,11 @@ def lz4_open(filename: str, mode: str = "rb", openhook: Any = open) -> lz4.frame
3737
return lz4.frame.LZ4FrameFile(openhook(filename, mode), mode=mode)
3838

3939

40-
def zstd_open(filename: str, mode: str = "rb", openhook: Any = open) -> pyzstd.ZstdFile:
40+
def zstd_open(filename: str, mode: str = "rb", openhook: Any = open) -> BinaryIO:
4141
if mode and "b" not in mode:
4242
mode += "b"
4343

44-
return pyzstd.ZstdFile(openhook(filename, mode), mode=mode)
44+
return zstandard.open(openhook(filename, mode), mode=mode, closefd=True)
4545

4646

4747
def open_by_file_pattern(filename: Union[str, Path], mode: str = "r", **kwargs: Any) -> Any:

pyproject.toml

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -4,50 +4,50 @@ version = "2.0.0.post1"
44
requires-python = ">=3.9"
55
readme = "README.md"
66
dependencies = [
7-
"mypy",
8-
"openai>=1.0.0",
9-
"tiktoken",
10-
"blobfile",
7+
"aiolimiter",
8+
"anthropic",
119
"backoff",
12-
"numpy",
13-
"snowflake-connector-python[pandas]",
14-
"pandas",
10+
"beartype==0.12.0",
11+
"blobfile",
12+
"chess",
13+
"dacite",
1514
"datasets",
16-
"fire",
17-
"pydantic",
18-
"tqdm",
19-
"types-tqdm",
20-
"nltk",
15+
"docker",
16+
"evaluate",
2117
"filelock",
22-
"mock",
18+
"fire",
19+
"flask",
20+
"google-generativeai",
21+
"gymnasium",
22+
"jiwer",
23+
"langchain",
2324
"langdetect",
24-
'termcolor',
2525
"lz4",
26-
"pyzstd",
27-
"pyyaml",
28-
"sacrebleu",
2926
"matplotlib",
30-
"pytest",
31-
"langchain",
27+
"mock",
28+
"mypy",
29+
"networkx",
30+
"nltk",
3231
"numexpr",
33-
"types-PyYAML",
34-
"spacy-universal-sentence-encoder",
35-
"jiwer",
32+
"numpy",
33+
"openai>=1.0.0",
34+
"pandas",
35+
"playwright==1.32.1",
36+
"pydantic",
37+
"pytest",
38+
"pyyaml",
39+
"sacrebleu",
3640
"seaborn",
41+
"snowflake-connector-python[pandas]",
42+
"spacy-universal-sentence-encoder",
3743
"statsmodels",
44+
"termcolor",
45+
"tiktoken",
3846
"torch",
39-
"dacite",
40-
"playwright==1.32.1",
41-
"evaluate",
42-
"aiolimiter",
43-
"beartype==0.12.0",
44-
"flask",
45-
"docker",
46-
"gymnasium",
47-
"networkx",
48-
"chess",
49-
"anthropic",
50-
"google-generativeai",
47+
"tqdm",
48+
"types-PyYAML",
49+
"types-tqdm",
50+
"zstandard",
5151
]
5252

5353
[project.urls]

0 commit comments

Comments
 (0)