Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,10 @@ repos:
files: ^devtools/ci/
args: [-e, SC1091] # don't follow sourced files

- repo: https://github.com/ambv/black
rev: 25.12.0
- repo: https://github.com/psf/black
rev: 26.5.1
hooks:
- id: black
language_version: python3
exclude: "^metaflow/_vendor/"
additional_dependencies: ["click<8.1.0"]
args: [-t, py34, -t, py35, -t, py36, -t, py37, -t, py38, -t, py39, -t, py310, -t, py311, -t, py312, -t, py313, -t, py314]
args: [-t, py34, -t, py35, -t, py36, -t, py37, -t, py38, -t, py39, -t, py310, -t, py311, -t, py312, -t, py313, -t, py314, -t, py315]
1 change: 0 additions & 1 deletion metaflow/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ class and related decorators.
# Decorators
from .decorators import step, _import_plugin_decorators


# Parsers (for configs) for now
from .plugins import _import_tl_plugins

Expand Down
1 change: 0 additions & 1 deletion metaflow/cmd/configure_cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

from .util import echo_always, makedirs


echo = echo_always

# NOTE: This code needs to be in sync with metaflow/metaflow_config.py.
Expand Down
12 changes: 4 additions & 8 deletions metaflow/cmd/develop/stubs.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,7 @@ def install(ctx: Any, force: bool):
mf_version, _ = get_mf_version(True)
with tempfile.TemporaryDirectory() as tmp_dir:
with open(os.path.join(tmp_dir, "setup.py"), "w") as f:
f.write(
f"""
f.write(f"""
from setuptools import setup, find_namespace_packages
setup(
include_package_data=True,
Expand All @@ -171,16 +170,13 @@ def install(ctx: Any, force: bool):
install_requires=["metaflow=={mf_version}"],
python_requires=">=3.6.1",
)
"""
)
""")
with open(os.path.join(tmp_dir, "MANIFEST.in"), "w") as f:
f.write(
"""
f.write("""
include metaflow-stubs/generated_for.txt
include metaflow-stubs/py.typed
global-include *.pyi
"""
)
""")

StubGenerator(os.path.join(tmp_dir, "metaflow-stubs")).write_out()

Expand Down
1 change: 0 additions & 1 deletion metaflow/extension_support/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
from metaflow.meta_files import read_info_file
from metaflow.util import walk_without_cycles


#
# This file provides the support for Metaflow's extension mechanism which allows
# a Metaflow developer to extend metaflow by providing a package `metaflow_extensions`.
Expand Down
1 change: 0 additions & 1 deletion metaflow/plugins/airflow/airflow_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from collections import defaultdict
from datetime import datetime, timedelta


TASK_ID_XCOM_KEY = "metaflow_task_id"
FOREACH_CARDINALITY_XCOM_KEY = "metaflow_foreach_cardinality"
FOREACH_XCOM_KEY = "metaflow_foreach_indexes"
Expand Down
1 change: 0 additions & 1 deletion metaflow/plugins/airflow/sensors/external_task_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from ..exception import AirflowException
from datetime import timedelta


AIRFLOW_STATES = dict(
QUEUED="queued",
RUNNING="running",
Expand Down
1 change: 0 additions & 1 deletion metaflow/plugins/cards/card_creator.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
from metaflow import current
from typing import Callable, Tuple, Dict


ASYNC_TIMEOUT = 30


Expand Down
1 change: 0 additions & 1 deletion metaflow/plugins/datastores/azure_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
get_azure_blob_service_client,
)


# How many threads / connections to use per upload or download operation
from metaflow.plugins.storage_executor import (
StorageExecutor,
Expand Down
1 change: 0 additions & 1 deletion metaflow/plugins/datastores/s3_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
from metaflow.metaflow_config import DATASTORE_SYSROOT_S3, ARTIFACT_LOCALROOT
from metaflow.datastore.datastore_storage import CloseAfterUse, DataStoreStorage


try:
# python2
from urlparse import urlparse
Expand Down
1 change: 0 additions & 1 deletion metaflow/plugins/datatools/s3/s3util.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
RETRY_WARNING_THRESHOLD,
)


TEST_S3_RETRY = "TEST_S3_RETRY" in os.environ

TRANSIENT_RETRY_LINE_CONTENT = "<none>"
Expand Down
6 changes: 2 additions & 4 deletions metaflow/runner/click_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,9 @@
elif _py_ver >= (3, 7):
from metaflow._vendor.v3_7.typeguard import TypeCheckError, check_type
else:
raise RuntimeError(
"""
raise RuntimeError("""
The Metaflow Programmatic API is not supported for versions of Python less than 3.7
"""
)
""")

import functools
import importlib
Expand Down
1 change: 0 additions & 1 deletion metaflow/sidecar/sidecar_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

import traceback


# add metaflow module to python path if not already present
myDir = os.path.dirname(os.path.abspath(__file__))
parentDir = os.path.split(os.path.split(myDir)[0])[0]
Expand Down
1 change: 0 additions & 1 deletion metaflow/user_configs/config_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
from ..parameters import DeployTimeField, ParameterContext, current_flow
from ..util import get_username


_CONVERT_PREFIX = "@!c!@:"
_DEFAULT_PREFIX = "@!d!@:"
_NO_FILE = "@!n!@:"
Expand Down
1 change: 0 additions & 1 deletion test/core/tests/secrets_decorator.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from metaflow_test import MetaflowTest, ExpectationFailed, steps, tag


INLINE_SECRETS_VARS = [
{
"type": "inline",
Expand Down
1 change: 0 additions & 1 deletion test/plugins/conda/test_parsers.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
requirements_txt_parser,
)


# ---------------------------------------------------------------------------
# requirements_txt_parser
# ---------------------------------------------------------------------------
Expand Down
1 change: 0 additions & 1 deletion test/unit/graph_inference/test_graph_inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

from metaflow.events import Trigger


# ---------------------------------------------------------------------------
# Custom named flow (begin/middle/finish)
# ---------------------------------------------------------------------------
Expand Down
1 change: 0 additions & 1 deletion test/unit/test_add_to_package.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
)
from metaflow.packaging_sys import ContentType


# ---------------------------------------------------------------------------
# Helpers
# ---------------------------------------------------------------------------
Expand Down
1 change: 0 additions & 1 deletion test/unit/test_artifact_serializer.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
SerializerStore,
)


# Snapshot the registry before this module's classes are defined. Module-level
# test serializers (_HighPrioritySerializer, ...) self-register at class
# definition time; the module-scoped fixture below removes them at teardown so
Expand Down
1 change: 0 additions & 1 deletion test/unit/test_compute_resource_attributes.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from collections import namedtuple
from metaflow.plugins.aws.aws_utils import compute_resource_attributes


MockDeco = namedtuple("MockDeco", ["name", "attributes"])


Expand Down
1 change: 0 additions & 1 deletion test/unit/test_pickle_serializer.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
)
from metaflow.plugins.datastores.serializers.pickle_serializer import PickleSerializer


# ---------------------------------------------------------------------------
# Registration and identity
# ---------------------------------------------------------------------------
Expand Down
1 change: 0 additions & 1 deletion test/ux/core/test_compliance.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
wait_for_deployed_run_allow_failure,
)


# ---------------------------------------------------------------------------
# test_run_params_multiple_values
#
Expand Down
1 change: 0 additions & 1 deletion test/ux/core/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from metaflow import Deployer, Flow, Run, Runner, namespace
from metaflow.exception import MetaflowNotFound


# Directory containing the test flows, relative to this file
_FLOWS_DIR = os.path.join(os.path.dirname(__file__), "flows")

Expand Down
Loading