Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom Augspurger committed Apr 17, 2023
1 parent 2b930c8 commit 6779b08
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pctasks/core/pctasks/core/importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
# would directly hook into the `import` statement.
# For background, checkout out Recipe 10.11 in the Python Cookbook (3rd edition)
from __future__ import annotations
import io

import io
import logging
import pathlib
import site
Expand Down
6 changes: 3 additions & 3 deletions pctasks/core/pctasks/core/storage/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from abc import ABC, abstractmethod
from dataclasses import dataclass
from datetime import datetime as Datetime
from typing import Any, Dict, Generator, Iterable, List, Optional, Tuple
from typing import Any, Dict, Generator, Iterable, List, Optional, Tuple, Union

import orjson

Expand Down Expand Up @@ -131,7 +131,7 @@ def upload_bytes(
) -> None:
"""Upload bytes to a storage file."""

def upload_code(self, file_path: str) -> str:
def upload_code(self, file_path: Union[str, pathlib.Path]) -> str:
"""Upload a Python module or package."""
from pctasks.core.importer import write_code

Expand All @@ -140,7 +140,7 @@ def upload_code(self, file_path: str) -> str:
if not path.exists():
raise OSError(f"Path {path} does not exist.")

name, buf = write_code(file_path)
name, buf = write_code(path)
data = buf.read()

token = hashlib.md5(data).hexdigest()
Expand Down
3 changes: 1 addition & 2 deletions pctasks/core/tests/storage/test_importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
import subprocess
import sys
import unittest.mock
import zipfile
from pathlib import Path
from tempfile import TemporaryDirectory
from typing import Optional
import zipfile

from pctasks.core.importer import ensure_code, ensure_requirements, write_code
from pctasks.core.storage.blob import BlobStorage
Expand Down Expand Up @@ -112,7 +112,6 @@ def test_ensure_requirements_target_dir():
sys.path.remove(target_dir)



def test_write_code():
with TemporaryDirectory() as temp_dir:
p = Path(temp_dir)
Expand Down

0 comments on commit 6779b08

Please sign in to comment.