Skip to content

Commit

Permalink
Merge pull request #145 from liormizr/version_0.5.0
Browse files Browse the repository at this point in the history
new version 0.5.0
  • Loading branch information
liormizr authored Aug 17, 2023
2 parents 5ec35cd + 4c65722 commit 7ec1b54
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
22 changes: 11 additions & 11 deletions s3path.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import smart_open.s3


__version__ = '0.4.2'
__version__ = '0.5.0'
__all__ = (
'register_configuration_parameter',
'S3Path',
Expand Down Expand Up @@ -1060,7 +1060,7 @@ def open(
errors=errors,
newline=newline)

def owner(self) -> str:
def owner(self) -> str:
"""
Returns the name of the user owning the Bucket or key.
Similarly to boto3's ObjectSummary owner attribute
Expand Down Expand Up @@ -1091,7 +1091,7 @@ def replace(self, target: Union[str, S3Path]) -> S3Path:
"""
return self.rename(target)

def unlink(self, missing_ok: bool = False) -> None:
def unlink(self, missing_ok: bool = False):
"""
Remove this key from its bucket.
"""
Expand Down Expand Up @@ -1119,7 +1119,7 @@ def unlink(self, missing_ok: bool = False) -> None:
if not missing_ok:
raise

def rmdir(self) -> None:
def rmdir(self):
"""
Removes this Bucket / key prefix. The Bucket / key prefix must be empty
"""
Expand All @@ -1140,7 +1140,7 @@ def samefile(self, other_path: Union[str, S3Path]) -> bool:
other_path = type(self)(other_path)
return self.bucket == other_path.bucket and self.key == other_path.key and self.is_file()

def touch(self, mode: int = 0o666, exist_ok: bool = True) -> None:
def touch(self, mode: int = 0o666, exist_ok: bool = True):
"""
Creates a key at this given path.
If the key already exists,
Expand All @@ -1151,7 +1151,7 @@ def touch(self, mode: int = 0o666, exist_ok: bool = True) -> None:
raise FileExistsError()
self.write_text('')

def mkdir(self, mode: int = 0o777, parents: bool = False, exist_ok: bool = False) -> None:
def mkdir(self, mode: int = 0o777, parents: bool = False, exist_ok: bool = False):
"""
Create a path bucket.
AWS S3 Service doesn't support folders, therefore the mkdir method will only create the current bucket.
Expand All @@ -1177,7 +1177,7 @@ def mkdir(self, mode: int = 0o777, parents: bool = False, exist_ok: bool = False
if not exist_ok:
raise

def is_mount(self) -> Literal[False]:
def is_mount(self) -> Literal[False]:
"""
AWS S3 Service doesn't have mounting feature, There for this method will always return False
"""
Expand Down Expand Up @@ -1262,7 +1262,7 @@ class PureVersionedS3Path(PureS3Path):
S3 is not a file-system, but we can look at it like a POSIX system.
"""

def __new__(cls, *args: Union[str, PurePath], version_id: str) -> PureVersionedS3Path:
def __new__(cls, *args, version_id: str):

self = super().__new__(cls, *args)
self.version_id = version_id
Expand Down Expand Up @@ -1295,7 +1295,7 @@ def from_bucket_key(cls, bucket: str, key: str, *, version_id: str) -> PureVersi
return cls(self, version_id=version_id)

def __repr__(self) -> str:
return f'{type(self).__name__}("{self.as_posix()}", version_id="{self.version_id}")'
return f'{type(self).__name__}({self.as_posix()}, version_id={self.version_id})'

def joinpath(self, *args):

Expand Down Expand Up @@ -1361,11 +1361,11 @@ def st_size(self) -> int:
return self.size

@property
def st_mtime(self) -> float:
def st_mtime(self) -> float:
return self.last_modified.timestamp()

@property
def st_version_id(self):
def st_version_id(self) -> str:
return self.version_id


Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
long_description = fh.read()
setup(
name='s3path',
version='0.4.2',
version='0.5.0',
url='https://github.com/liormizr/s3path',
author='Lior Mizrahi',
author_email='li.mizr@gmail.com',
Expand Down

0 comments on commit 7ec1b54

Please sign in to comment.