From e68ff304194b4fba17cd13dc32fc3d3d61e9c0a7 Mon Sep 17 00:00:00 2001 From: Arthur <48595927+ArthurZucker@users.noreply.github.com> Date: Fri, 22 Mar 2024 18:11:59 +0900 Subject: [PATCH] =?UTF-8?q?[`quality`]=20update=20quality=20check=20to=20m?= =?UTF-8?q?ake=20sure=20we=20check=20imports=20=F0=9F=98=88=20=20(#29771)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * update quality check * make it nice * update * let's make sure it runs and we have the logs actually * update workflow * nits --- .circleci/config.yml | 1 + Makefile | 2 ++ 2 files changed, 3 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 44d50547804..d5e9ac799fe 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -157,6 +157,7 @@ jobs: command: pip freeze | tee installed.txt - store_artifacts: path: ~/transformers/installed.txt + - run: python -c "from transformers import *" || (echo '🚨 import failed, this means you introduced unprotected imports! 🚨'; exit 1) - run: ruff check examples tests src utils - run: ruff format tests src utils --check - run: python utils/custom_init_isort.py --check_only diff --git a/Makefile b/Makefile index 424880ce150..49535b5694d 100644 --- a/Makefile +++ b/Makefile @@ -51,12 +51,14 @@ repo-consistency: # this target runs checks on all files quality: + @python -c "from transformers import *" || (echo '🚨 import failed, this means you introduced unprotected imports! 🚨'; exit 1) ruff check $(check_dirs) setup.py conftest.py ruff format --check $(check_dirs) setup.py conftest.py python utils/custom_init_isort.py --check_only python utils/sort_auto_mappings.py --check_only python utils/check_doc_toc.py + # Format source code automatically and check is there are any problems left that need manual fixing extra_style_checks: