Skip to content

Commit 3570dc2

Browse files
committed
Updat quality dependencies and lint setup.py
1 parent de25f2c commit 3570dc2

File tree

6 files changed

+12
-11
lines changed

6 files changed

+12
-11
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ jobs:
2828
pip install .[quality]
2929
- name: Check quality
3030
run: |
31-
ruff check tests src benchmarks metrics utils # linter
32-
ruff format --check tests src benchmarks metrics utils # formatter
31+
ruff check tests src benchmarks metrics utils setup.py # linter
32+
ruff format --check tests src benchmarks metrics utils setup.py # formatter
3333
3434
test:
3535
needs: check_code_quality

Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ check_dirs := tests src benchmarks metrics utils
55
# Check that source code meets quality standards
66

77
quality:
8-
ruff check $(check_dirs) # linter
9-
ruff format --check $(check_dirs) # formatter
8+
ruff check $(check_dirs) setup.py # linter
9+
ruff format --check $(check_dirs) setup.py # formatter
1010

1111
# Format source code automatically
1212

1313
style:
14-
ruff check --fix $(check_dirs) # linter
15-
ruff format $(check_dirs) # formatter
14+
ruff check --fix $(check_dirs) setup.py # linter
15+
ruff format $(check_dirs) setup.py # formatter
1616

1717
# Run tests for the library
1818

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@
216216
TESTS_REQUIRE.extend(VISION_REQUIRE)
217217
TESTS_REQUIRE.extend(AUDIO_REQUIRE)
218218

219-
QUALITY_REQUIRE = ["black~=23.1", "ruff>=0.0.241", "pyyaml>=5.3.1"]
219+
QUALITY_REQUIRE = ["ruff>=0.1.5"]
220220

221221
DOCS_REQUIRE = [
222222
# Might need to add doc-builder and some specific deps in the future

src/datasets/filesystems/compression.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ class BaseCompressedFileFileSystem(AbstractArchiveFileSystem):
1010
"""Read contents of compressed file as a filesystem with one file inside."""
1111

1212
root_marker = ""
13-
protocol: str = None # protocol passed in prefix to the url. ex: "gzip", for gzip://file.txt::http://foo.bar/file.txt.gz
13+
protocol: str = (
14+
None # protocol passed in prefix to the url. ex: "gzip", for gzip://file.txt::http://foo.bar/file.txt.gz
15+
)
1416
compression: str = None # compression type in fsspec. ex: "gzip"
1517
extension: str = None # extension of the filename to strip. ex: "".gz" to get file.txt from file.txt.gz
1618

src/datasets/splits.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ class SplitBase(metaclass=abc.ABCMeta):
111111
to define which files to read and how to skip examples within file.
112112
113113
"""
114+
114115
# pylint: enable=line-too-long
115116

116117
@abc.abstractmethod

tests/test_load.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,7 @@ def _generate_examples(self, filepath, **kwargs):
8484
SAMPLE_DATASET_IDENTIFIER = "hf-internal-testing/dataset_with_script" # has dataset script
8585
SAMPLE_DATASET_IDENTIFIER2 = "hf-internal-testing/dataset_with_data_files" # only has data files
8686
SAMPLE_DATASET_IDENTIFIER3 = "hf-internal-testing/multi_dir_dataset" # has multiple data directories
87-
SAMPLE_DATASET_IDENTIFIER4 = (
88-
"hf-internal-testing/imagefolder_with_metadata"
89-
) # imagefolder with a metadata file outside of the train/test directories
87+
SAMPLE_DATASET_IDENTIFIER4 = "hf-internal-testing/imagefolder_with_metadata" # imagefolder with a metadata file outside of the train/test directories
9088
SAMPLE_NOT_EXISTING_DATASET_IDENTIFIER = "hf-internal-testing/_dummy"
9189
SAMPLE_DATASET_NAME_THAT_DOESNT_EXIST = "_dummy"
9290
SAMPLE_DATASET_NO_CONFIGS_IN_METADATA = "hf-internal-testing/audiofolder_no_configs_in_metadata"

0 commit comments

Comments
 (0)