diff --git a/pyproject.toml b/pyproject.toml index 82b1ff0..6683ca7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "s3-objects-tracker" -version = "0.2.0" +version = "0.3.0" description = "Track already processed objects inside your s3 bucket." authors = ["Vladimir Vyazovetskov "] license = "MIT" diff --git a/s3_objects_tracker/__init__.py b/s3_objects_tracker/__init__.py index 1f4a967..9ff2be2 100644 --- a/s3_objects_tracker/__init__.py +++ b/s3_objects_tracker/__init__.py @@ -1,5 +1,5 @@ from s3_objects_tracker.tracker import S3ObjectsTracker -__version__ = "0.2.0" +__version__ = "0.3.0" __all__ = ("S3ObjectsTracker",) diff --git a/s3_objects_tracker/tracker.py b/s3_objects_tracker/tracker.py index 935ed8d..8904d3e 100644 --- a/s3_objects_tracker/tracker.py +++ b/s3_objects_tracker/tracker.py @@ -72,7 +72,7 @@ async def __aexit__(self, exc_type, exc_val, exc_tb) -> None: await self._upload_to_s3() await self._exit_stack.__aexit__(exc_type, exc_val, exc_tb) - async def determine_new(self, objects: List[T]) -> List[T]: + def determine_new(self, objects: List[T]) -> List[T]: new_objects = [] for _object in objects: if _object.id not in self._published_ids: diff --git a/tests/test_tracker.py b/tests/test_tracker.py index 4a65171..2e533e9 100644 --- a/tests/test_tracker.py +++ b/tests/test_tracker.py @@ -25,7 +25,7 @@ async def test_common_workflow(object_storage_mock, s3_credentials): objects = [Object(i) for i in range(10)] async with S3ObjectsTracker(**s3_credentials) as tracker: assert tracker._published_ids == [], "Published IDs should be empty" - new_objects = await tracker.determine_new(objects) + new_objects = tracker.determine_new(objects) assert new_objects == objects, "New objects should be the same as objects" for _object in new_objects: await tracker.publish(_object) @@ -35,7 +35,7 @@ async def test_common_workflow(object_storage_mock, s3_credentials): assert tracker._published_ids == [ _object.id for _object in objects ], "First objects should be published" - new_objects = await tracker.determine_new(next_objects) + new_objects = tracker.determine_new(next_objects) assert new_objects == next_objects[5:], "Only last 5 objects should be new" for _object in new_objects: await tracker.publish(_object) @@ -52,7 +52,7 @@ async def test_limit(object_storage_mock, s3_credentials): objects = [Object(i) for i in range(5)] async with S3ObjectsTracker(**s3_credentials, max_published_objects=5) as tracker: assert tracker._published_ids == [], "Published IDs should be empty" - new_objects = await tracker.determine_new(objects) + new_objects = tracker.determine_new(objects) assert new_objects == objects, "New objects should be the same as objects" for _object in objects: await tracker.publish(_object) @@ -60,7 +60,7 @@ async def test_limit(object_storage_mock, s3_credentials): next_objects = [Object(i) for i in range(6)] async with S3ObjectsTracker(**s3_credentials, max_published_objects=5) as tracker: assert tracker._published_ids == [0, 1, 2, 3, 4], "Objects should be published" - new_objects = await tracker.determine_new(next_objects) + new_objects = tracker.determine_new(next_objects) assert new_objects == [Object(5)], "Only last _object should be new" await tracker.publish(new_objects[0])