From cf28976323acc45d15f6bb58470ac4c9a0d874b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Mart=C3=ADn=20Bl=C3=A1zquez?= Date: Fri, 13 Dec 2024 11:36:24 +0100 Subject: [PATCH] Enable `RUF022` to automatically sort `__all__` --- pyproject.toml | 1 + src/distilabel/constants.py | 22 ++++++------- src/distilabel/llms.py | 12 +++---- src/distilabel/models/__init__.py | 16 +++++----- src/distilabel/models/llms/__init__.py | 12 +++---- src/distilabel/pipeline/__init__.py | 2 +- src/distilabel/steps/__init__.py | 44 +++++++++++++------------- src/distilabel/steps/tasks/__init__.py | 36 ++++++++++----------- src/distilabel/typing.py | 20 ++++++------ 9 files changed, 83 insertions(+), 82 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index e5bcc8399a..b203f7edf5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -121,6 +121,7 @@ exclude = ["docs"] [tool.ruff.lint] select = ["E", "W", "F", "I", "C", "B"] ignore = ["E501", "B905", "B008"] +extend-select = ["RUF022"] [tool.pytest.ini_options] testpaths = ["tests"] diff --git a/src/distilabel/constants.py b/src/distilabel/constants.py index 44554f8423..20f644dffc 100644 --- a/src/distilabel/constants.py +++ b/src/distilabel/constants.py @@ -50,21 +50,21 @@ __all__ = [ - "DISTILABEL_METADATA_KEY", "BASE_CACHE_DIR", - "PIPELINES_CACHE_DIR", - "STEP_ATTR_NAME", + "CONVERGENCE_STEP_ATTR_NAME", + "DISTILABEL_DOCS_URL", + "DISTILABEL_METADATA_KEY", + "DISTISET_ARTIFACTS_FOLDER", + "DISTISET_CONFIG_FOLDER", "INPUT_QUEUE_ATTR_NAME", + "LAST_BATCH_SENT_FLAG", + "PIPELINES_CACHE_DIR", + "PIPELINE_CONFIG_FILENAME", + "PIPELINE_LOG_FILENAME", "RECEIVES_ROUTED_BATCHES_ATTR_NAME", "ROUTING_BATCH_FUNCTION_ATTR_NAME", - "CONVERGENCE_STEP_ATTR_NAME", - "LAST_BATCH_SENT_FLAG", "SIGINT_HANDLER_CALLED_ENV_NAME", - "STEPS_OUTPUTS_PATH", "STEPS_ARTIFACTS_PATH", - "DISTISET_CONFIG_FOLDER", - "DISTISET_ARTIFACTS_FOLDER", - "PIPELINE_CONFIG_FILENAME", - "PIPELINE_LOG_FILENAME", - "DISTILABEL_DOCS_URL", + "STEPS_OUTPUTS_PATH", + "STEP_ATTR_NAME", ] diff --git a/src/distilabel/llms.py b/src/distilabel/llms.py index e4970992ce..b00d891407 100644 --- a/src/distilabel/llms.py +++ b/src/distilabel/llms.py @@ -43,26 +43,26 @@ from distilabel.models.mixins.cuda_device_placement import CudaDevicePlacementMixin __all__ = [ + "LLM", "AnthropicLLM", "AnyscaleLLM", - "AzureOpenAILLM", - "LLM", "AsyncLLM", + "AzureOpenAILLM", + "ClientvLLM", "CohereLLM", + "CudaDevicePlacementMixin", + "GenerateOutput", "GroqLLM", + "HiddenState", "InferenceEndpointsLLM", "LiteLLM", "LlamaCppLLM", "MistralLLM", - "CudaDevicePlacementMixin", "MixtureOfAgentsLLM", "OllamaLLM", "OpenAILLM", "TogetherLLM", "TransformersLLM", - "GenerateOutput", - "HiddenState", "VertexAILLM", - "ClientvLLM", "vLLM", ] diff --git a/src/distilabel/models/__init__.py b/src/distilabel/models/__init__.py index 45807302f0..b84a2c4690 100644 --- a/src/distilabel/models/__init__.py +++ b/src/distilabel/models/__init__.py @@ -38,29 +38,29 @@ from distilabel.models.mixins.cuda_device_placement import CudaDevicePlacementMixin __all__ = [ + "LLM", "AnthropicLLM", "AnyscaleLLM", - "AzureOpenAILLM", - "LLM", "AsyncLLM", + "AzureOpenAILLM", + "ClientvLLM", "CohereLLM", + "CudaDevicePlacementMixin", + "Embeddings", + "GenerateOutput", "GroqLLM", + "HiddenState", "InferenceEndpointsLLM", "LiteLLM", "LlamaCppLLM", "MistralLLM", - "CudaDevicePlacementMixin", "MixtureOfAgentsLLM", "OllamaLLM", "OpenAILLM", + "SentenceTransformerEmbeddings", "TogetherLLM", "TransformersLLM", - "GenerateOutput", - "HiddenState", "VertexAILLM", - "ClientvLLM", "vLLM", - "Embeddings", - "SentenceTransformerEmbeddings", "vLLMEmbeddings", ] diff --git a/src/distilabel/models/llms/__init__.py b/src/distilabel/models/llms/__init__.py index 2ae3119832..cca70d64c3 100644 --- a/src/distilabel/models/llms/__init__.py +++ b/src/distilabel/models/llms/__init__.py @@ -32,26 +32,26 @@ from distilabel.models.mixins.cuda_device_placement import CudaDevicePlacementMixin __all__ = [ + "LLM", "AnthropicLLM", "AnyscaleLLM", - "AzureOpenAILLM", - "LLM", "AsyncLLM", + "AzureOpenAILLM", + "ClientvLLM", "CohereLLM", + "CudaDevicePlacementMixin", + "GenerateOutput", "GroqLLM", + "HiddenState", "InferenceEndpointsLLM", "LiteLLM", "LlamaCppLLM", "MistralLLM", - "CudaDevicePlacementMixin", "MixtureOfAgentsLLM", "OllamaLLM", "OpenAILLM", "TogetherLLM", "TransformersLLM", - "GenerateOutput", - "HiddenState", "VertexAILLM", - "ClientvLLM", "vLLM", ] diff --git a/src/distilabel/pipeline/__init__.py b/src/distilabel/pipeline/__init__.py index 34400288da..b5e8b2c278 100644 --- a/src/distilabel/pipeline/__init__.py +++ b/src/distilabel/pipeline/__init__.py @@ -23,9 +23,9 @@ ) __all__ = [ + "InstructionResponsePipeline", "Pipeline", "RayPipeline", - "InstructionResponsePipeline", "routing_batch_function", "sample_n_steps", ] diff --git a/src/distilabel/steps/__init__.py b/src/distilabel/steps/__init__.py index cc1be59f92..58875bbec3 100644 --- a/src/distilabel/steps/__init__.py +++ b/src/distilabel/steps/__init__.py @@ -58,42 +58,42 @@ from distilabel.steps.typing import GeneratorStepOutput, StepOutput __all__ = [ - "PreferenceToArgilla", - "TextGenerationToArgilla", - "GeneratorStep", - "GlobalStep", - "Step", - "StepInput", - "StepResources", - "CombineOutputs", - "ExpandColumns", - "CombineColumns", - "GroupColumns", - "KeepColumns", - "MergeColumns", "DBSCAN", "UMAP", - "TextClustering", - "step", + "CombineColumns", + "CombineOutputs", + "ConversationTemplate", + "DataSampler", "DeitaFiltering", + "EmbeddingDedup", "EmbeddingGeneration", + "ExpandColumns", "FaissNearestNeighbour", - "ConversationTemplate", "FormatChatGenerationDPO", - "FormatTextGenerationDPO", "FormatChatGenerationSFT", + "FormatTextGenerationDPO", "FormatTextGenerationSFT", + "GeneratorStep", + "GeneratorStepOutput", + "GlobalStep", + "GroupColumns", + "KeepColumns", "LoadDataFromDicts", - "DataSampler", "LoadDataFromDisk", "LoadDataFromFileSystem", "LoadDataFromHub", - "EmbeddingDedup", + "MergeColumns", "MinHashDedup", - "make_generator_step", + "PreferenceToArgilla", "PushToHub", "RewardModelScore", - "TruncateTextColumn", - "GeneratorStepOutput", + "Step", + "StepInput", "StepOutput", + "StepResources", + "TextClustering", + "TextGenerationToArgilla", + "TruncateTextColumn", + "make_generator_step", + "step", ] diff --git a/src/distilabel/steps/tasks/__init__.py b/src/distilabel/steps/tasks/__init__.py index aa0460c3e1..f542aea232 100644 --- a/src/distilabel/steps/tasks/__init__.py +++ b/src/distilabel/steps/tasks/__init__.py @@ -60,47 +60,47 @@ from distilabel.steps.tasks.urial import URIAL __all__ = [ - "GeneratorTask", - "Task", - "ArgillaLabeller", + "CLAIR", + "URIAL", "APIGenExecutionChecker", "APIGenGenerator", "APIGenSemanticChecker", + "ArgillaLabeller", + "BitextRetrievalGenerator", + "ChatGeneration", + "ChatItem", + "ChatType", "ComplexityScorer", - "task", - "EvolInstruct", + "EmbeddingTaskGenerator", "EvolComplexity", "EvolComplexityGenerator", + "EvolInstruct", "EvolInstructGenerator", "EvolQuality", + "FormatPRM", "GenerateEmbeddings", - "Genstruct", - "BitextRetrievalGenerator", - "EmbeddingTaskGenerator", "GenerateLongTextMatchingData", + "GenerateSentencePair", "GenerateShortTextMatchingData", "GenerateTextClassificationData", "GenerateTextRetrievalData", - "MonolingualTripletGenerator", + "GeneratorTask", + "Genstruct", "InstructionBacktranslation", "Magpie", "MagpieGenerator", - "MathShepherdGenerator", "MathShepherdCompleter", - "FormatPRM", + "MathShepherdGenerator", + "MonolingualTripletGenerator", "PairRM", "PrometheusEval", "QualityScorer", "SelfInstruct", - "GenerateSentencePair", "StructuredGeneration", + "Task", "TextClassification", - "ChatGeneration", "TextGeneration", - "ChatItem", - "ChatType", - "CLAIR", - "UltraFeedback", - "URIAL", "TextGenerationWithImage", + "UltraFeedback", + "task", ] diff --git a/src/distilabel/typing.py b/src/distilabel/typing.py index 28bfd57fc5..a3d65d5d75 100644 --- a/src/distilabel/typing.py +++ b/src/distilabel/typing.py @@ -34,22 +34,22 @@ from distilabel.steps.typing import GeneratorStepOutput, StepColumns, StepOutput __all__ = [ - "GenerateOutput", - "DownstreamConnectable", - "DownstreamConnectableSteps", - "InputDataset", - "PipelineRuntimeParametersInfo", - "StepLoadStatus", - "UpstreamConnectableSteps", "ChatItem", "ChatType", + "DownstreamConnectable", + "DownstreamConnectableSteps", "FormattedInput", + "GenerateOutput", + "GeneratorStepOutput", + "InputDataset", "InstructorStructuredOutputType", "OutlinesStructuredOutputType", + "PipelineRuntimeParametersInfo", "StandardInput", - "StructuredInput", - "StructuredOutputType", - "GeneratorStepOutput", "StepColumns", + "StepLoadStatus", "StepOutput", + "StructuredInput", + "StructuredOutputType", + "UpstreamConnectableSteps", ]