Skip to content
Snippets Groups Projects
Commit 906d886d authored by Martin Bergemann's avatar Martin Bergemann 💬
Browse files

Mark package as typed

parent f6de6196
Branches main
No related tags found
No related merge requests found
Pipeline #24044 passed with stages
in 36 seconds
......@@ -9,4 +9,4 @@ lint:
mypy --install-types --non-interactive
black --check -t py310 -l 79 src
flake8 src/swift_helper --count --max-complexity=15 --max-line-length=88 --statistics --doctests
stubgen -p swift_helper -o src/
# stubgen -p swift_helper -o src/
......@@ -21,13 +21,6 @@ def find_version(*parts: str) -> str:
raise RuntimeError("Unable to find version string.")
def get_stubs(*parts):
asset_dir = Path(__file__).parent.joinpath(*parts)
out = [str(d.relative_to(asset_dir.parent)) for d in asset_dir.rglob("*.pyi")]
print(out, "foo")
return out
setup(
name="swift_helper",
version=find_version("src", "swift_helper", "__init__.py"),
......@@ -40,7 +33,7 @@ setup(
long_description_content_type="text/markdown",
license="GPLv3",
packages=find_packages("src"),
package_data={"": get_stubs("src", "swift_helper")},
package_data={"": ["py.typed"]},
package_dir={"": "src"},
install_requires=[
"aiohttp-retry",
......
from .swift import Swift as Swift, logger as logger
from . import Swift as Swift, logger as logger
def cli() -> None: ...
from _typeshed import Incomplete
from datetime import datetime
from pathlib import Path
from typing import Any, Iterator, Optional, Union
SwiftAuthType = Optional[Union[str, bool, float, int, list[str]]]
logger: Incomplete
class Swift:
browser_url: str
account: Incomplete
username: Incomplete
auth_token: Incomplete
storage_url: Incomplete
expires: Incomplete
def __init__(
self,
account: str,
username: Optional[str] = ...,
password: Optional[str] = ...,
swift_server: str = ...,
auth_version: float = ...,
) -> None: ...
def __enter__(self) -> Swift: ...
def __exit__(self, *args: Any) -> None: ...
@staticmethod
def get_passwd(msg: str = ..., wait_sec: int = ...) -> str: ...
@property
def auth_url(self) -> str: ...
@property
def swift_file(self) -> Path: ...
@property
def fsspec_auth(self) -> list[dict[str, str]]: ...
def stat(self, container: str) -> dict[str, str]: ...
def delete(
self, container: str, path: Union[str, Path, None] = ...
) -> dict[str, Any]: ...
def list(
self,
container: str,
path: Union[str, Path, None] = ...,
dir_only: bool = ...,
) -> Iterator[tuple[Path, datetime]]: ...
def make_public(self, container: str) -> None: ...
def exists(
self, container: str, path: Optional[Union[str, Path]] = ...
) -> bool: ...
def get_swift_container_url(
self,
container: str,
path: Optional[Union[str, Path]] = ...,
scheme: str = ...,
) -> str: ...
def create_container(self, container: str) -> int: ...
def upload(
self,
inp_dir: Union[str, Path],
container: str,
public: bool = ...,
) -> str: ...
import aiohttp_retry
from typing import Any
async def get_client(**kwargs: Any) -> aiohttp_retry.RetryClient: ...
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment