From 937ea30802e4fff6f8097cc7a42bf54c5282b574 Mon Sep 17 00:00:00 2001 From: Rok Mandeljc Date: Mon, 9 Sep 2024 21:51:25 +0200 Subject: [PATCH] hooks: add hook for yapf_third_party Add hook for `yapf_third_party` (part of `yapf`) to collect its data files. --- .../stdhooks/hook-yapf_third_party.py | 15 +++++++++++++++ news/792.new.rst | 2 ++ requirements-test-libraries.txt | 1 + tests/test_libraries.py | 9 +++++++-- 4 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 _pyinstaller_hooks_contrib/stdhooks/hook-yapf_third_party.py create mode 100644 news/792.new.rst diff --git a/_pyinstaller_hooks_contrib/stdhooks/hook-yapf_third_party.py b/_pyinstaller_hooks_contrib/stdhooks/hook-yapf_third_party.py new file mode 100644 index 000000000..d138c53b8 --- /dev/null +++ b/_pyinstaller_hooks_contrib/stdhooks/hook-yapf_third_party.py @@ -0,0 +1,15 @@ +# ------------------------------------------------------------------ +# Copyright (c) 2024 PyInstaller Development Team. +# +# This file is distributed under the terms of the GNU General Public +# License (version 2.0 or later). +# +# The full license is available in LICENSE, distributed with +# this software. +# +# SPDX-License-Identifier: GPL-2.0-or-later +# ------------------------------------------------------------------ + +from PyInstaller.utils.hooks import collect_data_files + +datas = collect_data_files('yapf_third_party') diff --git a/news/792.new.rst b/news/792.new.rst new file mode 100644 index 000000000..112ddb387 --- /dev/null +++ b/news/792.new.rst @@ -0,0 +1,2 @@ +Add hook for ``yapf_third_party`` (part of ``yapf``) to collect its +data files. diff --git a/requirements-test-libraries.txt b/requirements-test-libraries.txt index 8eff023bd..341a9d5e0 100644 --- a/requirements-test-libraries.txt +++ b/requirements-test-libraries.txt @@ -217,6 +217,7 @@ xarray==2024.7.0; python_version >= '3.9' tables==3.10.1; python_version >= '3.10' schwifty==2024.9.0 # pyup: != '2024.8.1' patool==2.4.0; python_version >= '3.10' +yapf==0.40.2 # ------------------- Platform (OS) specifics diff --git a/tests/test_libraries.py b/tests/test_libraries.py index 2c0896a38..f77c032ef 100644 --- a/tests/test_libraries.py +++ b/tests/test_libraries.py @@ -2156,8 +2156,6 @@ def test_itk(pyi_builder): def test_slixmpp(pyi_builder): pyi_builder.test_source(""" import slixmpp - - slixmpp.ClientXMPP('username', 'password') """) @@ -2168,3 +2166,10 @@ def test_capstone(pyi_builder): import capstone capstone.__version__ """) + + +@importorskip('yapf') +def test_yapf(pyi_builder): + pyi_builder.test_source(""" + import yapf + """)