superpathlib 2.1.0__tar.gz → 2.1.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (27) hide show
  1. {superpathlib-2.1.0/src/superpathlib.egg-info → superpathlib-2.1.1}/PKG-INFO +1 -1
  2. {superpathlib-2.1.0 → superpathlib-2.1.1}/pyproject.toml +1 -1
  3. {superpathlib-2.1.0 → superpathlib-2.1.1}/src/superpathlib/content_properties.py +1 -1
  4. {superpathlib-2.1.0 → superpathlib-2.1.1}/src/superpathlib/utils.py +3 -3
  5. {superpathlib-2.1.0 → superpathlib-2.1.1/src/superpathlib.egg-info}/PKG-INFO +1 -1
  6. {superpathlib-2.1.0 → superpathlib-2.1.1}/tests/test_content.py +8 -1
  7. {superpathlib-2.1.0 → superpathlib-2.1.1}/LICENSE +0 -0
  8. {superpathlib-2.1.0 → superpathlib-2.1.1}/README.md +0 -0
  9. {superpathlib-2.1.0 → superpathlib-2.1.1}/setup.cfg +0 -0
  10. {superpathlib-2.1.0 → superpathlib-2.1.1}/src/superpathlib/__init__.py +0 -0
  11. {superpathlib-2.1.0 → superpathlib-2.1.1}/src/superpathlib/archive.py +0 -0
  12. {superpathlib-2.1.0 → superpathlib-2.1.1}/src/superpathlib/base.py +0 -0
  13. {superpathlib-2.1.0 → superpathlib-2.1.1}/src/superpathlib/common_folders.py +0 -0
  14. {superpathlib-2.1.0 → superpathlib-2.1.1}/src/superpathlib/encrypted.py +0 -0
  15. {superpathlib-2.1.0 → superpathlib-2.1.1}/src/superpathlib/extra_functionality.py +0 -0
  16. {superpathlib-2.1.0 → superpathlib-2.1.1}/src/superpathlib/metadata_properties.py +0 -0
  17. {superpathlib-2.1.0 → superpathlib-2.1.1}/src/superpathlib/override.py +0 -0
  18. {superpathlib-2.1.0 → superpathlib-2.1.1}/src/superpathlib/path.py +0 -0
  19. {superpathlib-2.1.0 → superpathlib-2.1.1}/src/superpathlib/py.typed +0 -0
  20. {superpathlib-2.1.0 → superpathlib-2.1.1}/src/superpathlib.egg-info/SOURCES.txt +0 -0
  21. {superpathlib-2.1.0 → superpathlib-2.1.1}/src/superpathlib.egg-info/dependency_links.txt +0 -0
  22. {superpathlib-2.1.0 → superpathlib-2.1.1}/src/superpathlib.egg-info/requires.txt +0 -0
  23. {superpathlib-2.1.0 → superpathlib-2.1.1}/src/superpathlib.egg-info/top_level.txt +0 -0
  24. {superpathlib-2.1.0 → superpathlib-2.1.1}/tests/test_common_folders.py +0 -0
  25. {superpathlib-2.1.0 → superpathlib-2.1.1}/tests/test_functionality.py +0 -0
  26. {superpathlib-2.1.0 → superpathlib-2.1.1}/tests/test_inheritance.py +0 -0
  27. {superpathlib-2.1.0 → superpathlib-2.1.1}/tests/test_metadata.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: superpathlib
3
- Version: 2.1.0
3
+ Version: 2.1.1
4
4
  Summary: Extended Pathlib
5
5
  Author-email: Quinten Roets <qdr2104@columbia.edu>
6
6
  License-Expression: MIT
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "superpathlib"
3
- version = "2.1.0"
3
+ version = "2.1.1"
4
4
  description = "Extended Pathlib"
5
5
  authors = [{name = "Quinten Roets", email = "qdr2104@columbia.edu"}]
6
6
  license = "MIT"
@@ -31,7 +31,7 @@ class Path(metadata_properties.Path):
31
31
  return self.read_text()
32
32
 
33
33
  @text.setter
34
- def text(self, value: Any) -> None:
34
+ def text(self, value: object) -> None:
35
35
  self.write_text(str(value))
36
36
 
37
37
  @property
@@ -1,17 +1,17 @@
1
1
  from collections.abc import Callable
2
- from typing import Any, TypeVar
2
+ from typing import Any, TypeVar, cast
3
3
 
4
4
  T = TypeVar("T")
5
5
  Getter = Callable[[Any], T]
6
6
 
7
7
 
8
- def catch_missing(default: T) -> Callable[[Getter[T]], Getter[T]]:
8
+ def catch_missing(default: object) -> Callable[[Getter[T]], Getter[T]]:
9
9
  def wrap_getter(function: Getter[T]) -> Getter[T]:
10
10
  def wrapper(self: Any) -> T:
11
11
  try:
12
12
  return function(self)
13
13
  except FileNotFoundError:
14
- return default
14
+ return cast("T", default)
15
15
 
16
16
  return wrapper
17
17
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: superpathlib
3
- Version: 2.1.0
3
+ Version: 2.1.1
4
4
  Summary: Extended Pathlib
5
5
  Author-email: Quinten Roets <qdr2104@columbia.edu>
6
6
  License-Expression: MIT
@@ -1,7 +1,7 @@
1
1
  import operator
2
2
  from collections.abc import Callable, Iterator
3
3
  from functools import partial
4
- from typing import Any, NamedTuple
4
+ from typing import Any, NamedTuple, assert_type
5
5
 
6
6
  import numpy as np
7
7
  import pytest
@@ -104,6 +104,13 @@ def test_missing_content(path: Path) -> None:
104
104
  assert missing_path.json is None
105
105
 
106
106
 
107
+ def test_content_types(path: Path) -> None:
108
+ path.text = 1
109
+ assert_type(path.text, str)
110
+ assert_type(path.json, Any)
111
+ assert_type(path.yaml, Any)
112
+
113
+
107
114
  @pytest.fixture
108
115
  def cache_path(path: Path) -> Iterator[Path]:
109
116
  with path.with_name(path.name + ".cache") as cache_path:
File without changes
File without changes
File without changes