stdl 0.6.9__tar.gz → 0.7.0__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 (43) hide show
  1. {stdl-0.6.9 → stdl-0.7.0}/PKG-INFO +1 -1
  2. {stdl-0.6.9 → stdl-0.7.0}/pyproject.toml +1 -1
  3. {stdl-0.6.9 → stdl-0.7.0}/stdl/st.py +1 -1
  4. {stdl-0.6.9 → stdl-0.7.0}/tests/test_st.py +10 -0
  5. {stdl-0.6.9 → stdl-0.7.0}/uv.lock +1 -1
  6. {stdl-0.6.9 → stdl-0.7.0}/.editorconfig +0 -0
  7. {stdl-0.6.9 → stdl-0.7.0}/.github/workflows/lint.yml +0 -0
  8. {stdl-0.6.9 → stdl-0.7.0}/.github/workflows/publish.yml +0 -0
  9. {stdl-0.6.9 → stdl-0.7.0}/.github/workflows/test.yml +0 -0
  10. {stdl-0.6.9 → stdl-0.7.0}/.gitignore +0 -0
  11. {stdl-0.6.9 → stdl-0.7.0}/.pre-commit-config.yaml +0 -0
  12. {stdl-0.6.9 → stdl-0.7.0}/.python-version +0 -0
  13. {stdl-0.6.9 → stdl-0.7.0}/.readthedocs.yml +0 -0
  14. {stdl-0.6.9 → stdl-0.7.0}/CONTRIBUTING.md +0 -0
  15. {stdl-0.6.9 → stdl-0.7.0}/Justfile +0 -0
  16. {stdl-0.6.9 → stdl-0.7.0}/LICENSE +0 -0
  17. {stdl-0.6.9 → stdl-0.7.0}/README.md +0 -0
  18. {stdl-0.6.9 → stdl-0.7.0}/docs/index.md +0 -0
  19. {stdl-0.6.9 → stdl-0.7.0}/docs/reference/color.md +0 -0
  20. {stdl-0.6.9 → stdl-0.7.0}/docs/reference/decorators.md +0 -0
  21. {stdl-0.6.9 → stdl-0.7.0}/docs/reference/dt.md +0 -0
  22. {stdl-0.6.9 → stdl-0.7.0}/docs/reference/fs.md +0 -0
  23. {stdl-0.6.9 → stdl-0.7.0}/docs/reference/import_lazy.md +0 -0
  24. {stdl-0.6.9 → stdl-0.7.0}/docs/reference/log.md +0 -0
  25. {stdl-0.6.9 → stdl-0.7.0}/docs/reference/net.md +0 -0
  26. {stdl-0.6.9 → stdl-0.7.0}/docs/reference/st.md +0 -0
  27. {stdl-0.6.9 → stdl-0.7.0}/docs/requirements.txt +0 -0
  28. {stdl-0.6.9 → stdl-0.7.0}/mkdocs.yml +0 -0
  29. {stdl-0.6.9 → stdl-0.7.0}/stdl/__init__.py +0 -0
  30. {stdl-0.6.9 → stdl-0.7.0}/stdl/color.py +0 -0
  31. {stdl-0.6.9 → stdl-0.7.0}/stdl/decorators.py +0 -0
  32. {stdl-0.6.9 → stdl-0.7.0}/stdl/dt.py +0 -0
  33. {stdl-0.6.9 → stdl-0.7.0}/stdl/fs.py +0 -0
  34. {stdl-0.6.9 → stdl-0.7.0}/stdl/import_lazy.py +0 -0
  35. {stdl-0.6.9 → stdl-0.7.0}/stdl/log.py +0 -0
  36. {stdl-0.6.9 → stdl-0.7.0}/stdl/lst.py +0 -0
  37. {stdl-0.6.9 → stdl-0.7.0}/stdl/net.py +0 -0
  38. {stdl-0.6.9 → stdl-0.7.0}/tests/test_color.py +0 -0
  39. {stdl-0.6.9 → stdl-0.7.0}/tests/test_decorators.py +0 -0
  40. {stdl-0.6.9 → stdl-0.7.0}/tests/test_dt.py +0 -0
  41. {stdl-0.6.9 → stdl-0.7.0}/tests/test_fs.py +0 -0
  42. {stdl-0.6.9 → stdl-0.7.0}/tests/test_lst.py +0 -0
  43. {stdl-0.6.9 → stdl-0.7.0}/tests/test_pydantic_integration.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: stdl
3
- Version: 0.6.9
3
+ Version: 0.7.0
4
4
  Summary: Extended Python Standard Library
5
5
  Project-URL: Repository, https://github.com/zigai/stdl
6
6
  Project-URL: Issues, https://github.com/zigai/stdl/issues
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "stdl"
3
- version = "0.6.9"
3
+ version = "0.7.0"
4
4
  description = "Extended Python Standard Library"
5
5
  authors = [{ name = "Žiga Ivanšek", email = "ziga.ivansek@gmail.com" }]
6
6
  license = { file = "LICENSE" }
@@ -192,7 +192,7 @@ def colored(
192
192
  return f"{color}{background}{style}{text}{ST.RESET}"
193
193
 
194
194
 
195
- @dataclass
195
+ @dataclass(frozen=True)
196
196
  class TextStyle:
197
197
  color: ForegroundColor | str | None = None
198
198
  background: BackgroundColor | str | None = None
@@ -1,4 +1,7 @@
1
1
  import os
2
+ from dataclasses import FrozenInstanceError
3
+
4
+ import pytest
2
5
 
3
6
  from stdl import st
4
7
  from stdl.st import (
@@ -109,6 +112,13 @@ def test_ansi_rjust():
109
112
  assert ansi_rjust("", 5) == " "
110
113
 
111
114
 
115
+ def test_text_style_is_immutable():
116
+ style = st.TextStyle(color="red", style="bold")
117
+ assert st.with_style("hello", style) == colored("hello", color="red", style="bold")
118
+ with pytest.raises(FrozenInstanceError):
119
+ style.color = "blue"
120
+
121
+
112
122
  class TestStringFilter:
113
123
  def test_filename(self):
114
124
  assert st.sf.filename("file|name?.txt") == "filename.txt"
@@ -552,7 +552,7 @@ wheels = [
552
552
 
553
553
  [[package]]
554
554
  name = "stdl"
555
- version = "0.6.9"
555
+ version = "0.7.0"
556
556
  source = { editable = "." }
557
557
  dependencies = [
558
558
  { name = "python-dateutil" },
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes