Skip to content

Commit

Permalink
run ruff format on entire code base (PrefectHQ#13909)
Browse files Browse the repository at this point in the history
  • Loading branch information
aaazzam authored Jun 10, 2024
1 parent 8c7fc24 commit 3061d27
Show file tree
Hide file tree
Showing 193 changed files with 202 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Prefect deployment steps for code storage and retrieval in S3 and S3
compatible services.
"""

from pathlib import Path, PurePosixPath
from typing import Dict, Optional

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
"""
Prefect deployment steps for code storage and retrieval in Azure Blob Storage.
These steps can be used in a `prefect.yaml` file to define the default
push and pull steps for a group of deployments, or they can be used to
These steps can be used in a `prefect.yaml` file to define the default
push and pull steps for a group of deployments, or they can be used to
define the push and pull steps for a specific deployment.
!!! example
Sample `prefect.yaml` file that is configured to push and pull to and
Sample `prefect.yaml` file that is configured to push and pull to and
from an Azure Blob Storage container:
```yaml
Expand All @@ -33,6 +33,7 @@
For more information about using deployment steps, check out out the Prefect [docs](https://docs.prefect.io/latest/concepts/projects/#the-prefect-yaml-file).
""" # noqa

from pathlib import Path, PurePosixPath
from typing import Dict, Optional

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Prefect deployment steps for code storage in and retrieval from Google Cloud Storage.
"""

from pathlib import Path, PurePosixPath
from typing import Dict, Optional

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Credential classes used to perform authenticated interactions with GitHub"""


from typing import Optional

from pydantic import Field, SecretStr
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Module for interacting with Kubernetes deployments from Prefect flows."""

from typing import Any, Dict, Optional

from kubernetes.client.models import V1DeleteOptions, V1Deployment, V1DeploymentList
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
""" Tasks for working with Kubernetes services. """
"""Tasks for working with Kubernetes services."""

from typing import Any, Dict, Optional

Expand Down
1 change: 1 addition & 0 deletions src/prefect/_internal/compatibility/migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
__getattr__ = getattr_migration(__name__)
```
"""

import sys
from typing import Any, Callable, Dict

Expand Down
4 changes: 2 additions & 2 deletions src/prefect/_internal/concurrency/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
Much of the complexity managed here arises from ensuring that a thread of execution is
not blocked.
The main data structure is a `Call` which is created from a function call capturing
The main data structure is a `Call` which is created from a function call capturing
local context variables. The call is then submitted to run somewhere via a `Portal`.
The primary portal used is the `WorkerThread`, which executes work on a thread running
concurrently to the one that created the call. A singleton `EventLoopThread` portal
is also used to schedule work on a dedicated event loop.
The result of the call can be retrieved asynchronously using `Call.result()`. Behind
the scenes, a `Future` is used to report the result of the call. Retrieving the result
of a call is a blocking operation.
of a call is a blocking operation.
Sometimes, it is important not to block the current thread while retrieving the result
of a call. For this purpose, there is the `Waiter`. Waiters attach to a call and provide
Expand Down
1 change: 1 addition & 0 deletions src/prefect/_internal/concurrency/primitives.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Thread-safe async synchronization primitives.
"""

import asyncio
import collections
import threading
Expand Down
4 changes: 2 additions & 2 deletions src/prefect/_internal/pydantic/annotations/pendulum.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""
This file contains compat code to handle pendulum.DateTime objects during jsonschema
generation and validation.
This file contains compat code to handle pendulum.DateTime objects during jsonschema
generation and validation.
"""

import typing as t
Expand Down
2 changes: 1 addition & 1 deletion src/prefect/_internal/pytz.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
This is a compatibility module that allows us to drop our dependency on pytz in the minimal prefect-client.
This is a compatibility module that allows us to drop our dependency on pytz in the minimal prefect-client.
All values here are taken from:
Expand Down
1 change: 1 addition & 0 deletions src/prefect/cli/block.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Command line interface for working with blocks.
"""

import inspect
from importlib import import_module
from pathlib import Path
Expand Down
1 change: 1 addition & 0 deletions src/prefect/cli/concurrency_limit.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Command line interface for working with concurrency limits.
"""

import textwrap

import pendulum
Expand Down
1 change: 1 addition & 0 deletions src/prefect/deployments/steps/pull.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Core set of steps for specifying a Prefect project pull step.
"""

import os
from pathlib import Path
from typing import TYPE_CHECKING, Any, Optional
Expand Down
3 changes: 2 additions & 1 deletion src/prefect/deployments/steps/utility.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Steps within this module can be used within a `build`, `push`, or `pull` deployment action.
Example:
Use the `run_shell_script` setp to retrieve the short Git commit hash of the current
Use the `run_shell_script` setp to retrieve the short Git commit hash of the current
repository and use it as a Docker image tag:
```yaml
build:
Expand All @@ -19,6 +19,7 @@
dockerfile: auto
```
"""

import io
import os
import shlex
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
ContainerInstancePushProvisioner: A class for provisioning infrastructure using Azure Container Instances.
"""

import json
import random
import shlex
Expand Down
1 change: 1 addition & 0 deletions src/prefect/plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
- prefect.collections: Identifies this package as a Prefect collection that
should be imported when Prefect is imported.
"""

import sys
from types import ModuleType
from typing import Any, Dict, Union
Expand Down
1 change: 1 addition & 0 deletions src/prefect/runtime/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
print(f"This script is running from deployment {deployment.id} with parameters {deployment.parameters}")
```
"""

import prefect.runtime.deployment
import prefect.runtime.flow_run
import prefect.runtime.task_run
1 change: 1 addition & 0 deletions src/prefect/runtime/deployment.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ def get_task_runner():
include default values set on the flow function, only the parameter values set on the deployment
object or those directly provided via API for this run
"""

import os
from typing import Any, Dict, List, Optional

Expand Down
1 change: 1 addition & 0 deletions src/prefect/runtime/flow_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
- `parent_deployment_id`: the ID of the deployment that triggered this run, if any
- `run_count`: the number of times this flow run has been run
"""

import os
from typing import Any, Dict, List, Optional

Expand Down
1 change: 1 addition & 0 deletions src/prefect/runtime/task_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
- `run_count`: the number of times this task run has been run
- `task_name`: the name of the task
"""

import os
from typing import Any, Dict, List, Optional

Expand Down
1 change: 1 addition & 0 deletions src/prefect/server/api/ui/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
"""Routes primarily for use by the UI"""

from . import flows, flow_runs, schemas, task_runs
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
"""initial migration
Revision ID: 25f4b90a7a42
Revises:
Revises:
Create Date: 2022-01-20 12:21:27.508018
"""

from typing import Dict, List, Union

import sqlalchemy as sa
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2022-02-13 12:52:13.264435
"""

import sqlalchemy as sa
from alembic import op

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2022-02-17 21:17:27.832400
"""

import sqlalchemy as sa
from alembic import op

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2022-02-17 14:08:21.839817
"""

import sqlalchemy as sa
from alembic import op

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
"""Rename block data table
Revision ID: d9d98a9ebb6f
Revises:
Revises:
Create Date: 2022-02-19 20:55:43.397189
"""

from alembic import op

# revision identifiers, used by Alembic.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2022-02-20 10:38:44.972308
"""

import sqlalchemy as sa
from alembic import op

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2022-02-21 11:10:50.989062
"""

from alembic import op

# revision identifiers, used by Alembic.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2022-02-21 15:00:17.529885
"""

import sqlalchemy as sa
from alembic import op

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2022-03-10 10:27:13.015390
"""

from alembic import op

# revision identifiers, used by Alembic.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2022-04-20 11:30:11.934795
"""

import sqlalchemy as sa
from alembic import op

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2022-04-21 09:55:19.820177
"""

import sqlalchemy as sa
from alembic import op

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2022-04-19 13:28:03.661481
"""

from alembic import op

# revision identifiers, used by Alembic.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2022-05-12 20:29:52.681522
"""

import sqlalchemy as sa
from alembic import op

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2022-05-26 13:57:43.152931
"""

import sqlalchemy as sa
from alembic import op

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2022-05-30 11:25:49.621795
"""

from alembic import op

# revision identifiers, used by Alembic.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2022-06-04 10:40:48.710626
"""

from alembic import op

# revision identifiers, used by Alembic.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2022-06-08 12:17:53.241415
"""

import sqlalchemy as sa
from alembic import op

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2022-06-13 10:42:34.183100
"""

import sqlalchemy as sa
from alembic import op

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2022-06-17 20:44:09.726661
"""

from alembic import op

# revision identifiers, used by Alembic.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2022-06-20 12:39:21.112876
"""

import sqlalchemy as sa
from alembic import op

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2022-06-21 09:37:32.382898
"""

from alembic import op

# revision identifiers, used by Alembic.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2022-06-29 13:54:32.981105
"""

import sqlalchemy as sa
from alembic import op

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2022-06-29 15:22:19.213787
"""

import sqlalchemy as sa
from alembic import op

Expand Down
Loading

0 comments on commit 3061d27

Please sign in to comment.