diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index 1110ddd6a..2886dd8ff 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -29,20 +29,29 @@ Submitting pull requests Before you submit a pull request, make sure to complete the following steps: -#. Fork the Skyplane repository to create a copy of the project in your own account. -#. Set up a developer environment as described in the `Development Guide `_. -#. Create a development branch (\ ``git checkout -b feature_name``\ ) -#. Test your changes manually using ``skyplane cp`` and with the unit test suite: - .. code-block:: bash +1. Fork the Skyplane repository to create a copy of the project in your own account. +2. Set up a developer environment as described in the `Development Guide `_. +3. Create a development branch (\ ``git checkout -b feature_name``\ ) +4. Test your changes manually using ``skyplane cp`` and with the unit test suite: + + .. code-block:: console $ pytest tests/unit_nocloud/ +5. Ensure your code is autoformatted and passes type checks: -#. Ensure your code is autoformatted and passes type checks: - .. code-block:: bash + .. code-block:: console - $ pip install black pytype + $ pip install black pytype autoflake $ black -l 140 . $ pytype --config .pytype.cfg skyplane + $ autoflake --in-place --remove-all-unused-imports --remove-unused-variables --recursive skyplane +6. If you updated documentation, test the docs: + + .. code-block:: console -#. Commit your changes using a `descriptive commit message `_. -#. Create a pull request on the main Skyplane repo from your fork. Consult `Github Help `_ for more details. + $ pip install sphinx-autobuild + $ cd docs + $ pip install -r requirements.txt + $ sphinx-autobuild -b html . /tmp/docs_build +7. Commit your changes using a `descriptive commit message `_. +8. Create a pull request on the main Skyplane repo from your fork. Consult `Github Help `_ for more details. diff --git a/skyplane/__init__.py b/skyplane/__init__.py index be6cb781f..d8376450f 100644 --- a/skyplane/__init__.py +++ b/skyplane/__init__.py @@ -1,6 +1,5 @@ import os from pathlib import Path -import uuid from skyplane.config import SkyplaneConfig from skyplane.gateway_version import gateway_version diff --git a/skyplane/cli/cli.py b/skyplane/cli/cli.py index 91246f051..ae17dc331 100644 --- a/skyplane/cli/cli.py +++ b/skyplane/cli/cli.py @@ -14,7 +14,6 @@ import skyplane.cli.usage.client from skyplane import GB from skyplane.cli.usage.client import UsageClient, UsageStatsStatus -from skyplane.obj_store.s3_interface import S3Interface from skyplane.replicate.replicator_client import ReplicatorClient import typer @@ -26,7 +25,7 @@ import skyplane.cli.cli_internal as cli_internal import skyplane.cli.cli_solver import skyplane.cli.experiments -from skyplane import config_path, exceptions, skyplane_root, cloud_config, tmp_log_dir +from skyplane import cloud_config, config_path, exceptions, skyplane_root from skyplane.cli.common import print_header, console from skyplane.cli.cli_impl.cp_replicate import ( enrich_dest_objs, diff --git a/skyplane/cli/cli_impl/cp_replicate.py b/skyplane/cli/cli_impl/cp_replicate.py index 9e415b7d6..1ad547704 100644 --- a/skyplane/cli/cli_impl/cp_replicate.py +++ b/skyplane/cli/cli_impl/cp_replicate.py @@ -1,4 +1,3 @@ -import json import os import pathlib import signal @@ -12,7 +11,7 @@ from skyplane import exceptions, GB, format_bytes, gateway_docker_image, skyplane_root, cloud_config from skyplane.compute.cloud_providers import CloudProvider from skyplane.obj_store.object_store_interface import ObjectStoreInterface, ObjectStoreObject -from skyplane.obj_store.s3_interface import S3Interface, S3Object +from skyplane.obj_store.s3_interface import S3Object from skyplane.obj_store.gcs_interface import GCSObject from skyplane.obj_store.azure_blob_interface import AzureBlobObject from skyplane.replicate.replication_plan import ReplicationTopology, ReplicationJob @@ -21,10 +20,7 @@ from skyplane.utils.timer import Timer from skyplane.cli.common import console -import skyplane.cli -import skyplane.cli.usage.definitions -import skyplane.cli.usage.client -from skyplane.cli.usage.client import UsageClient, UsageStatsStatus +from skyplane.cli.usage.client import UsageClient def generate_topology( diff --git a/skyplane/compute/azure/azure_cloud_provider.py b/skyplane/compute/azure/azure_cloud_provider.py index c3eaf0431..7ebb53362 100644 --- a/skyplane/compute/azure/azure_cloud_provider.py +++ b/skyplane/compute/azure/azure_cloud_provider.py @@ -1,4 +1,3 @@ -import json import os import re import uuid diff --git a/skyplane/compute/azure/azure_server.py b/skyplane/compute/azure/azure_server.py index 9bfcf3d1f..924690733 100644 --- a/skyplane/compute/azure/azure_server.py +++ b/skyplane/compute/azure/azure_server.py @@ -11,7 +11,6 @@ from skyplane import key_root from skyplane.compute.azure.azure_auth import AzureAuthentication from skyplane.compute.server import Server, ServerState -from skyplane.utils import logger from skyplane.utils.cache import ignore_lru_cache from skyplane.utils.fn import PathLike @@ -147,8 +146,8 @@ def terminate_instance_impl(self): compute_client = self.auth.get_compute_client() network_client = self.auth.get_network_client() - auth_client = self.auth.get_authorization_client() - vm = self.get_virtual_machine() + self.auth.get_authorization_client() + self.get_virtual_machine() vm_poller = compute_client.virtual_machines.begin_delete(AzureServer.resource_group_name, self.vm_name(self.name)) _ = vm_poller.result() diff --git a/skyplane/gateway/gateway_obj_store.py b/skyplane/gateway/gateway_obj_store.py index f5b9983f7..7742e54da 100644 --- a/skyplane/gateway/gateway_obj_store.py +++ b/skyplane/gateway/gateway_obj_store.py @@ -10,7 +10,6 @@ from skyplane.chunk import ChunkRequest from skyplane.gateway.chunk_store import ChunkStore from skyplane.obj_store.object_store_interface import ObjectStoreInterface -from skyplane.obj_store.s3_interface import S3Interface from skyplane.utils import logger from skyplane.utils.retry import retry_backoff diff --git a/skyplane/obj_store/azure_blob_interface.py b/skyplane/obj_store/azure_blob_interface.py index ac167c837..d502fbb31 100644 --- a/skyplane/obj_store/azure_blob_interface.py +++ b/skyplane/obj_store/azure_blob_interface.py @@ -2,9 +2,7 @@ import hashlib import os from functools import lru_cache, partial -from socket import timeout from typing import Iterator, List, Optional -import uuid from azure.core.exceptions import ResourceExistsError, ResourceNotFoundError, HttpResponseError diff --git a/skyplane/replicate/solver_ron.py b/skyplane/replicate/solver_ron.py index fa46d8b3a..bfe7df91f 100644 --- a/skyplane/replicate/solver_ron.py +++ b/skyplane/replicate/solver_ron.py @@ -1,5 +1,4 @@ import numpy as np -from skyplane import GB from skyplane.replicate.solver import ThroughputSolver, ThroughputProblem, ThroughputSolution