Skip to content

Commit bf44f7c

Browse files
authored
Bump up the Black version to 25.x (NVIDIA#5849)
- moves to black version 25.1 - reformats files according to black==25.1 Signed-off-by: Janusz Lisiecki <[email protected]>
1 parent 60ee1f6 commit bf44f7c

File tree

13 files changed

+57
-23
lines changed

13 files changed

+57
-23
lines changed

.github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
- uses: actions/setup-python@v4
2020
with:
2121
python-version: '3.10'
22-
- run: pip install flake8 bandit "black[jupyter]"==24.8.0
22+
- run: pip install flake8 bandit "black[jupyter]"==25.1.0
2323
# keep black invocations separated so each invocation will pick appropriate configuration file
2424
# from the top dir used for it
2525
- run: black --check --verbose ${{ env.PYTHON_SECURITY_LINT_PATHS }} ${{ env.PYTHON_LINT_PATHS }} ${{ env.AUTOGRAPH_LINT_PATHS }}

conda/dali_python_bindings/recipe/meta.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ requirements:
6969
- patchelf
7070
- python-clang
7171
- git-lfs
72-
- black =24.8.0
73-
- black-jupyter =24.8.0
72+
- black =25.1.0
73+
- black-jupyter =25.1.0
7474
- bandit
7575
host:
7676
- libprotobuf-static =5.27.4

dali/python/nvidia/dali/auto_aug/core/policy.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ def __repr__(self):
126126

127127

128128
def _sub_policy_with_unique_names(
129-
sub_policies: Sequence[Sequence[Tuple[Augmentation, float, Optional[int]]]]
129+
sub_policies: Sequence[Sequence[Tuple[Augmentation, float, Optional[int]]]],
130130
) -> Sequence[Sequence[Tuple[Augmentation, float, Optional[int]]]]:
131131
"""
132132
Check if the augmentations used in the sub-policies have unique names.

dali/python/nvidia/dali/pipeline.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2012,7 +2012,7 @@ def _generate_graph(pipe, func, fn_args, fn_kwargs):
20122012
# Bare decorator usage
20132013
@overload
20142014
def pipeline_def(
2015-
__func: Callable[..., Union[DataNode, Tuple[DataNode, ...]]]
2015+
__func: Callable[..., Union[DataNode, Tuple[DataNode, ...]]],
20162016
) -> Callable[..., Pipeline]: ...
20172017

20182018

dali/test/python/decoder/test_jpeg_scan_limit.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -96,14 +96,14 @@ def generate_file(cls, decoding_method, decoding_step):
9696
# fmt: on
9797
file = tempfile.NamedTemporaryFile(mode="w+b", delete=True)
9898
try:
99-
file.write(b"\xFF\xD8")
100-
file.write(b"\xFF")
101-
file.write(b"\xC2" if decoding_method == "huffman" else b"\xCA")
102-
file.write(b"\x00\x0B\x08")
99+
file.write(b"\xff\xd8")
100+
file.write(b"\xff")
101+
file.write(b"\xc2" if decoding_method == "huffman" else b"\xca")
102+
file.write(b"\x00\x0b\x08")
103103
file.write(extent)
104104
file.write(extent)
105105
file.write(b"\x01\x00\x11\x00")
106-
file.write(b"\xFF\xDB\x00\x43\x00")
106+
file.write(b"\xff\xdb\x00\x43\x00")
107107
file.write(quant_table)
108108
if decoding_method == "huffman":
109109
file.write(b"\xff\xc4") # DHT marker

dali/test/python/operator_2/test_squeeze.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def test_squeeze():
7171
),
7272
(None, "Z", "XYZ", [(300, 1, 1), (10, 1, 1)], [(300, 1), (10, 1)], "XY"),
7373
(None, "ZY", "XYZ", [(300, 1, 1), (10, 1, 1)], [(300,), (10,)], "X"),
74-
([0], None, "X", [(1)], [()], ""),
74+
([0], None, "X", [(1,)], [()], ""),
7575
([1], None, "XYZ", [(100, 0, 0)], [(100, 0)], "XZ"),
7676
(None, "Z", "XYZ", [(100, 0, 0)], [(100, 0)], "XY"),
7777
(None, "X", "XYZ", [(100, 0, 0)], [(0, 0)], "YZ"),

dali/test/python/test_dali_tf_plugin_cpu_only.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def get_data(batch_size, value):
4141
with tf.device("/cpu"):
4242
data = daliop(
4343
pipeline=pipe,
44-
shapes=[(batch_size)],
44+
shapes=[batch_size],
4545
dtypes=[tf.int32],
4646
device_id=types.CPU_ONLY_DEVICE_ID,
4747
)

dali/test/python/test_external_source_parallel_shared_batch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def check_serialize_deserialize(batch):
4545

4646
def test_serialize_deserialize():
4747
for shapes in [
48-
[(10)],
48+
[(10,)],
4949
[(10, 20)],
5050
[(10, 20, 3)],
5151
[(1), (2)],

docker/Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ ENV PYVER=${PYVER} \
1313
PYTHONPATH=/opt/python/v \
1414
PYBIN=${PYTHONPATH}/bin \
1515
PYLIB=${PYTHONPATH}/lib \
16-
PATH=/opt/python/cp38-cp38/bin:/opt/python/cp39-cp39/bin:${PYBIN}:/opt/python/cp310-cp310/bin:/opt/python/cp311-cp311/bin:${PYBIN}:/opt/python/cp312-cp312/bin:/opt/python/cp313-cp313/bin:${PYBIN}:${PATH} \
17-
LD_LIBRARY_PATH=/usr/local/lib:/opt/dali/${DALI_BUILD_DIR}:/opt/python/cp38-cp38/lib:/opt/python/cp39-cp39/lib:/opt/python/cp310-cp310/lib:/opt/python/cp311-cp311/lib:${PYLIB}:/opt/python/cp312-cp312/lib:/opt/python/cp313-cp313/lib:${PYLIB}:${LD_LIBRARY_PATH} \
18-
LIBRARY_PATH=/usr/local/lib:/opt/dali/${DALI_BUILD_DIR}:/opt/python/cp38-cp38/lib:/opt/python/cp39-cp39/lib:/opt/python/cp310-cp310/lib:/opt/python/cp311-cp311/lib:${PYLIB}:/opt/python/cp312-cp312/lib:/opt/python/cp313-cp313/lib:${PYLIB}:${LIBRARY_PATH}
16+
PATH=/opt/python/cp${PYV}-cp${PYV}/bin:/opt/python/cp38-cp38/bin:/opt/python/cp39-cp39/bin:${PYBIN}:/opt/python/cp310-cp310/bin:/opt/python/cp311-cp311/bin:${PYBIN}:/opt/python/cp312-cp312/bin:/opt/python/cp313-cp313/bin:${PYBIN}:${PATH} \
17+
LD_LIBRARY_PATH=/opt/python/cp${PYV}-cp${PYV}/lib:/usr/local/lib:/opt/dali/${DALI_BUILD_DIR}:/opt/python/cp38-cp38/lib:/opt/python/cp39-cp39/lib:/opt/python/cp310-cp310/lib:/opt/python/cp311-cp311/lib:${PYLIB}:/opt/python/cp312-cp312/lib:/opt/python/cp313-cp313/lib:${PYLIB}:${LD_LIBRARY_PATH} \
18+
LIBRARY_PATH=/opt/python/cp${PYV}-cp${PYV}/lib:/usr/local/lib:/opt/dali/${DALI_BUILD_DIR}:/opt/python/cp38-cp38/lib:/opt/python/cp39-cp39/lib:/opt/python/cp310-cp310/lib:/opt/python/cp311-cp311/lib:${PYLIB}:/opt/python/cp312-cp312/lib:/opt/python/cp313-cp313/lib:${PYLIB}:${LIBRARY_PATH}
1919

2020
RUN ln -s /opt/python/cp${PYV}* /opt/python/v
2121

2222
# install Python bindings and patch it to use the clang we have here
23-
RUN pip install future setuptools wheel clang==14.0 flake8 bandit astunparse gast dm-tree "black[jupyter]"==24.8.0 && \
23+
RUN pip install future setuptools wheel clang==14.0 flake8 bandit astunparse gast dm-tree "black[jupyter]"==25.1.0 && \
2424
PY_CLANG_PATH=$(echo $(pip show clang) | sed 's/.*Location: \(.*\) Requires.*/\1/')/clang/cindex.py && \
2525
LIBCLANG_PATH=/usr/local/lib/libclang.so && \
2626
sed -i "s|library_file = None|library_file = \"${LIBCLANG_PATH}\"|" ${PY_CLANG_PATH} && \

docker/Dockerfile.build.aarch64-linux

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,15 @@ RUN apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/
4646
libnpp-cross-aarch64-${CUDA_CROSS_VERSION} \
4747
&& \
4848
rm -rf /var/lib/apt/lists/* && \
49+
rm /usr/bin/python3 && ln -s python3.10 /usr/bin/python3 && \
4950
PYTHON_VER=$(python3 -c "import sys;print(f'{sys.version_info[0]}{sys.version_info[1]}')") && \
5051
if [ "${PYTHON_VER}" = "36" ]; then \
5152
curl -O https://bootstrap.pypa.io/pip/3.6/get-pip.py; \
5253
else \
5354
curl -O https://bootstrap.pypa.io/get-pip.py; \
5455
fi && python3 get-pip.py && rm get-pip.py && \
5556
# decouple libclang and clang installation so libclang changes are not overriden by clang
56-
pip install clang==14.0 && pip install libclang==14.0.1 flake8 bandit "black[jupyter]"==24.8.0 && \
57+
pip install clang==14.0 && pip install libclang==14.0.1 flake8 bandit "black[jupyter]"==25.1.0 && \
5758
rm -rf /root/.cache/pip/ && \
5859
cd /tmp && git clone https://github.com/NixOS/patchelf && cd patchelf && \
5960
./bootstrap.sh && ./configure --prefix=/usr/ && make -j install && cd / && rm -rf /tmp/patchelf && \

0 commit comments

Comments
 (0)