stdl 0.6.3__tar.gz → 0.6.4__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 (46) hide show
  1. {stdl-0.6.3 → stdl-0.6.4}/.editorconfig +2 -1
  2. stdl-0.6.4/.github/workflows/lint.yml +23 -0
  3. {stdl-0.6.3 → stdl-0.6.4}/.github/workflows/publish.yml +9 -4
  4. stdl-0.6.3/.github/workflows/tests.yml → stdl-0.6.4/.github/workflows/test.yml +11 -4
  5. {stdl-0.6.3 → stdl-0.6.4}/.pre-commit-config.yaml +3 -3
  6. stdl-0.6.4/Justfile +62 -0
  7. {stdl-0.6.3 → stdl-0.6.4}/PKG-INFO +8 -9
  8. {stdl-0.6.3 → stdl-0.6.4}/README.md +1 -1
  9. {stdl-0.6.3 → stdl-0.6.4}/pyproject.toml +54 -49
  10. {stdl-0.6.3 → stdl-0.6.4}/stdl/color.py +382 -120
  11. {stdl-0.6.3 → stdl-0.6.4}/stdl/decorators.py +12 -8
  12. {stdl-0.6.3 → stdl-0.6.4}/stdl/dt.py +5 -5
  13. {stdl-0.6.3 → stdl-0.6.4}/stdl/fs.py +12 -6
  14. {stdl-0.6.3 → stdl-0.6.4}/stdl/import_lazy.py +9 -8
  15. {stdl-0.6.3 → stdl-0.6.4}/stdl/log.py +6 -6
  16. {stdl-0.6.3 → stdl-0.6.4}/stdl/net.py +4 -3
  17. {stdl-0.6.3 → stdl-0.6.4}/stdl/st.py +6 -6
  18. {stdl-0.6.3 → stdl-0.6.4}/tests/test_color.py +172 -132
  19. stdl-0.6.4/tests/test_pydantic_integration.py +79 -0
  20. stdl-0.6.4/uv.lock +534 -0
  21. stdl-0.6.3/.github/workflows/lint.yml +0 -17
  22. stdl-0.6.3/Justfile +0 -41
  23. stdl-0.6.3/uv.lock +0 -853
  24. {stdl-0.6.3 → stdl-0.6.4}/.gitignore +0 -0
  25. {stdl-0.6.3 → stdl-0.6.4}/.python-version +0 -0
  26. {stdl-0.6.3 → stdl-0.6.4}/.readthedocs.yml +0 -0
  27. {stdl-0.6.3 → stdl-0.6.4}/CONTRIBUTING.md +0 -0
  28. {stdl-0.6.3 → stdl-0.6.4}/LICENSE +0 -0
  29. {stdl-0.6.3 → stdl-0.6.4}/docs/index.md +0 -0
  30. {stdl-0.6.3 → stdl-0.6.4}/docs/reference/color.md +0 -0
  31. {stdl-0.6.3 → stdl-0.6.4}/docs/reference/decorators.md +0 -0
  32. {stdl-0.6.3 → stdl-0.6.4}/docs/reference/dt.md +0 -0
  33. {stdl-0.6.3 → stdl-0.6.4}/docs/reference/fs.md +0 -0
  34. {stdl-0.6.3 → stdl-0.6.4}/docs/reference/import_lazy.md +0 -0
  35. {stdl-0.6.3 → stdl-0.6.4}/docs/reference/log.md +0 -0
  36. {stdl-0.6.3 → stdl-0.6.4}/docs/reference/net.md +0 -0
  37. {stdl-0.6.3 → stdl-0.6.4}/docs/reference/st.md +0 -0
  38. {stdl-0.6.3 → stdl-0.6.4}/docs/requirements.txt +0 -0
  39. {stdl-0.6.3 → stdl-0.6.4}/mkdocs.yml +0 -0
  40. {stdl-0.6.3 → stdl-0.6.4}/stdl/__init__.py +0 -0
  41. {stdl-0.6.3 → stdl-0.6.4}/stdl/lst.py +0 -0
  42. {stdl-0.6.3 → stdl-0.6.4}/tests/test_decorators.py +0 -0
  43. {stdl-0.6.3 → stdl-0.6.4}/tests/test_dt.py +0 -0
  44. {stdl-0.6.3 → stdl-0.6.4}/tests/test_fs.py +0 -0
  45. {stdl-0.6.3 → stdl-0.6.4}/tests/test_lst.py +0 -0
  46. {stdl-0.6.3 → stdl-0.6.4}/tests/test_st.py +0 -0
@@ -6,6 +6,7 @@ indent_size = 4
6
6
  charset = utf-8
7
7
  trim_trailing_whitespace = true
8
8
  insert_final_newline = true
9
+ end_of_line = lf
9
10
 
10
- [{*.yaml, *.yml}]
11
+ [*.{yaml,yml}]
11
12
  indent_size = 2
@@ -0,0 +1,23 @@
1
+ name: Lint
2
+ on: [push, pull_request]
3
+
4
+ jobs:
5
+ lint:
6
+ runs-on: ubuntu-latest
7
+ steps:
8
+ - uses: actions/checkout@v5
9
+
10
+ - name: Install uv
11
+ uses: astral-sh/setup-uv@v7
12
+
13
+ - name: Set up Python
14
+ run: uv python install 3.12
15
+
16
+ - name: Install dependencies
17
+ run: uv sync --extra dev --python 3.12
18
+
19
+ - name: Check formatting with Ruff
20
+ run: uv run --python 3.12 ruff format --check .
21
+
22
+ - name: Run Ruff lint
23
+ run: uv run --python 3.12 ruff check .
@@ -2,19 +2,24 @@ name: Upload Python Package
2
2
  on:
3
3
  release:
4
4
  types: [published]
5
+
5
6
  jobs:
6
7
  deploy:
7
8
  runs-on: ubuntu-latest
8
9
  steps:
9
- - uses: actions/checkout@v4
10
+ - uses: actions/checkout@v5
11
+
10
12
  - name: Install uv
11
- uses: astral-sh/setup-uv@v3
12
- - name: Set up Python
13
- run: uv python install 3.12
13
+ uses: astral-sh/setup-uv@v7
14
+ with:
15
+ python-version: 3.12
16
+
14
17
  - name: Build and publish
15
18
  env:
16
19
  TWINE_USERNAME: __token__
20
+
17
21
  TWINE_PASSWORD: ${{ secrets.TOKEN }}
22
+
18
23
  run: |
19
24
  uv build
20
25
  uv run --with twine twine upload dist/*
@@ -1,24 +1,31 @@
1
1
  name: Tests
2
2
  on: [push, pull_request]
3
+
3
4
  jobs:
4
5
  tests:
5
- runs-on: ubuntu-latest
6
6
  strategy:
7
7
  fail-fast: false
8
8
  matrix:
9
+ os: [ubuntu-latest, macos-latest, windows-latest]
9
10
  python-version: [
10
11
  "3.10",
11
12
  "3.11",
12
13
  "3.12",
13
- "3.13"
14
+ "3.13",
15
+ "3.14"
14
16
  ]
17
+ runs-on: ${{ matrix.os }}
18
+
15
19
  steps:
16
- - uses: actions/checkout@v4
20
+ - uses: actions/checkout@v5
21
+
17
22
  - name: Install uv
18
- uses: astral-sh/setup-uv@v3
23
+ uses: astral-sh/setup-uv@v7
24
+
19
25
 
20
26
  - name: Set up Python ${{ matrix.python-version }}
21
27
  run: uv python install ${{ matrix.python-version }}
28
+
22
29
  - name: Install dependencies
23
30
  run: uv sync --extra test --python ${{ matrix.python-version }}
24
31
 
@@ -8,8 +8,8 @@ repos:
8
8
  - id: check-toml
9
9
 
10
10
  - repo: https://github.com/astral-sh/ruff-pre-commit
11
- rev: v0.8.4
11
+ rev: v0.14.2
12
12
  hooks:
13
- - id: ruff
14
- args: [--fix, --exit-non-zero-on-fix]
13
+ - id: ruff-check
14
+ args: [--fix, --exit-zero]
15
15
  - id: ruff-format
stdl-0.6.4/Justfile ADDED
@@ -0,0 +1,62 @@
1
+ @_:
2
+ just --list
3
+
4
+ _require-uv:
5
+ @uv --version > /dev/null || (echo "Please install uv: https://docs.astral.sh/uv/" && exit 1)
6
+
7
+ _require-hatch:
8
+ @hatch --version > /dev/null || (echo "Please install hatch: uv tool install hatch" && exit 1)
9
+
10
+ # check code style and potential issues
11
+ lint:
12
+ ruff check
13
+
14
+ # format code
15
+ format:
16
+ ruff format
17
+
18
+ # fix automatically fixable linting issues
19
+ fix:
20
+ ruff check --fix
21
+
22
+ # run tests across all supported Python versions
23
+ test: _require-hatch
24
+ hatch run test:test
25
+
26
+ # build the package
27
+ build: _require-uv
28
+ uv build
29
+
30
+ # setup or update local dev environment, keeps previously installed extras
31
+ dev: _require-uv
32
+ uv sync --inexact --extra dev
33
+ uv run pre-commit install
34
+
35
+ # run tests with coverage and show a coverage report
36
+ coverage:
37
+ coverage run -m pytest
38
+ coverage report
39
+
40
+ # clean build artifacts and caches
41
+ clean:
42
+ rm -rf .venv .pytest_cache .mypy_cache .ruff_cache
43
+ find . -type d -name "__pycache__" -exec rm -r {} +
44
+
45
+ # static type check with mypy
46
+ typecheck: _require-uv
47
+ uv run mypy
48
+
49
+ # check code for common misspellings
50
+ spell:
51
+ codespell
52
+
53
+ # run all quality checks
54
+ check: format lint coverage typecheck spell
55
+
56
+ # list available recipes
57
+ help:
58
+ just --list
59
+
60
+ alias fmt := format
61
+ alias cov := coverage
62
+ alias mypy := typecheck
@@ -1,9 +1,8 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: stdl
3
- Version: 0.6.3
3
+ Version: 0.6.4
4
4
  Summary: Extended Python Standard Library
5
5
  Project-URL: Repository, https://github.com/zigai/stdl
6
- Project-URL: Documentation, https://stdl.readthedocs.io
7
6
  Project-URL: Issues, https://github.com/zigai/stdl/issues
8
7
  Project-URL: Homepage, https://github.com/zigai/stdl
9
8
  Author-email: Žiga Ivanšek <ziga.ivansek@gmail.com>
@@ -29,7 +28,7 @@ License: MIT License
29
28
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
30
29
  SOFTWARE.
31
30
  License-File: LICENSE
32
- Keywords: ANSI colors,color formats,filesystem,lazy import,list utils,logging configuration,python lazy import,python utilites,standard library,stdl,string utils,terminal links,terminal output
31
+ Keywords: ANSI colors,color formats,filesystem,lazy import,list utils,logging configuration,python lazy import,python utilities,standard library,stdl,string utils,terminal links,terminal output
33
32
  Classifier: Intended Audience :: Developers
34
33
  Classifier: License :: OSI Approved :: MIT License
35
34
  Classifier: Operating System :: OS Independent
@@ -40,6 +39,7 @@ Classifier: Programming Language :: Python :: 3.10
40
39
  Classifier: Programming Language :: Python :: 3.11
41
40
  Classifier: Programming Language :: Python :: 3.12
42
41
  Classifier: Programming Language :: Python :: 3.13
42
+ Classifier: Programming Language :: Python :: 3.14
43
43
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
44
44
  Classifier: Typing :: Typed
45
45
  Requires-Python: >=3.10
@@ -48,21 +48,20 @@ Requires-Dist: pyyaml>=6.0.2
48
48
  Requires-Dist: toml>=0.10.2
49
49
  Requires-Dist: tqdm>=4.67.1
50
50
  Provides-Extra: dev
51
- Requires-Dist: black; extra == 'dev'
52
- Requires-Dist: mkdocs; extra == 'dev'
53
- Requires-Dist: mkdocs-autorefs; extra == 'dev'
54
- Requires-Dist: mkdocs-material; extra == 'dev'
55
- Requires-Dist: mkdocstrings[python]; extra == 'dev'
51
+ Requires-Dist: codespell; extra == 'dev'
52
+ Requires-Dist: coverage; extra == 'dev'
53
+ Requires-Dist: mypy; extra == 'dev'
56
54
  Requires-Dist: pre-commit; extra == 'dev'
57
55
  Requires-Dist: pytest; extra == 'dev'
58
56
  Requires-Dist: ruff; extra == 'dev'
59
57
  Provides-Extra: test
58
+ Requires-Dist: coverage; extra == 'test'
60
59
  Requires-Dist: pytest; extra == 'test'
61
60
  Description-Content-Type: text/markdown
62
61
 
63
62
  # stdl
64
63
 
65
- [![Tests](https://github.com/zigai/stdl/actions/workflows/tests.yml/badge.svg)](https://github.com/zigai/stdl/actions/workflows/tests.yml)
64
+ [![Tests](https://github.com/zigai/stdl/actions/workflows/tests.yml/badge.svg)](https://github.com/zigai/stdl/actions/workflows/test.yml)
66
65
  [![Documentation Status](https://readthedocs.org/projects/stdl/badge/?version=latest)](https://stdl.readthedocs.io/en/latest/?badge=latest)
67
66
  [![PyPI version](https://badge.fury.io/py/stdl.svg)](https://badge.fury.io/py/stdl)
68
67
  ![Supported versions](https://img.shields.io/badge/python-3.10+-blue.svg)
@@ -1,6 +1,6 @@
1
1
  # stdl
2
2
 
3
- [![Tests](https://github.com/zigai/stdl/actions/workflows/tests.yml/badge.svg)](https://github.com/zigai/stdl/actions/workflows/tests.yml)
3
+ [![Tests](https://github.com/zigai/stdl/actions/workflows/tests.yml/badge.svg)](https://github.com/zigai/stdl/actions/workflows/test.yml)
4
4
  [![Documentation Status](https://readthedocs.org/projects/stdl/badge/?version=latest)](https://stdl.readthedocs.io/en/latest/?badge=latest)
5
5
  [![PyPI version](https://badge.fury.io/py/stdl.svg)](https://badge.fury.io/py/stdl)
6
6
  ![Supported versions](https://img.shields.io/badge/python-3.10+-blue.svg)
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "stdl"
3
- version = "0.6.3"
3
+ version = "0.6.4"
4
4
  description = "Extended Python Standard Library"
5
5
  authors = [{ name = "Žiga Ivanšek", email = "ziga.ivansek@gmail.com" }]
6
6
  license = { file = "LICENSE" }
@@ -26,12 +26,13 @@ classifiers = [
26
26
  "Programming Language :: Python :: 3.11",
27
27
  "Programming Language :: Python :: 3.12",
28
28
  "Programming Language :: Python :: 3.13",
29
+ "Programming Language :: Python :: 3.14",
29
30
  ]
30
31
 
31
32
  keywords = [
32
33
  "stdl",
33
34
  "standard library",
34
- "python utilites",
35
+ "python utilities",
35
36
  "filesystem",
36
37
  "list utils",
37
38
  "string utils",
@@ -46,21 +47,11 @@ keywords = [
46
47
 
47
48
 
48
49
  [project.optional-dependencies]
49
- test = ["pytest"]
50
- dev = [
51
- "pytest",
52
- "black",
53
- "ruff",
54
- "pre-commit",
55
- "mkdocs",
56
- "mkdocs-material",
57
- "mkdocs-autorefs",
58
- "mkdocstrings[python]",
59
- ]
50
+ test = ["pytest", "coverage"]
51
+ dev = ["pytest", "coverage", "ruff", "pre-commit", "mypy", "codespell"]
60
52
 
61
53
  [project.urls]
62
54
  Repository = "https://github.com/zigai/stdl"
63
- Documentation = "https://stdl.readthedocs.io"
64
55
  Issues = "https://github.com/zigai/stdl/issues"
65
56
  Homepage = "https://github.com/zigai/stdl"
66
57
 
@@ -71,10 +62,6 @@ build-backend = "hatchling.build"
71
62
  [tool.hatch.build.targets.wheel]
72
63
  packages = ["stdl"]
73
64
 
74
- [tool.black]
75
- line-length = 100
76
- target_version = ['py310', 'py311', 'py312', 'py313']
77
-
78
65
  [tool.ruff]
79
66
  line-length = 100
80
67
 
@@ -147,54 +134,72 @@ ignore = [
147
134
  "N806",
148
135
  "UP007",
149
136
  "UP038",
150
- "E741",
151
- ]
152
- isort = { known-first-party = ["stdl", 'tests'] }
153
- pydocstyle = { convention = 'google' }
154
-
155
- exclude = [
156
- ".bzr",
157
- ".direnv",
158
- ".eggs",
159
- ".git",
160
- ".hg",
161
- ".mypy_cache",
162
- ".nox",
163
- ".pants.d",
164
- ".pytype",
165
- ".ruff_cache",
166
- ".svn",
167
- ".tox",
168
- ".venv",
169
- "__pypackages__",
170
- "_build",
171
- "buck-out",
172
- "build",
173
- "dist",
174
- "node_modules",
175
- "venv",
176
- "tests/*",
177
- "tests/**/*",
178
137
  ]
138
+ exclude = ["build", "tests/**"]
179
139
 
180
140
  [tool.ruff.lint.per-file-ignores]
181
141
  "__init__.py" = [
182
142
  "F401", # Unused import
183
143
  "E402", # Module import not at top of file
184
144
  ]
145
+ "stdl/color.py" = [
146
+ "E741", # Ambiguous variable name 'l' (used for lightness in HSL color space)
147
+ ]
148
+ "stdl/lst.py" = [
149
+ "E741", # Ambiguous variable name 'l' (used as list parameter name)
150
+ ]
185
151
 
186
152
  [tool.ruff.format]
187
153
  quote-style = "double"
188
154
  indent-style = "space"
189
155
  skip-magic-trailing-comma = false
190
- line-ending = "auto"
156
+ line-ending = "lf"
157
+
158
+ [tool.ruff.lint.isort]
159
+ known-first-party = ["stdl", "tests"]
160
+
161
+ [tool.ruff.lint.pydocstyle]
162
+ convention = "google"
163
+
164
+ [tool.codespell]
165
+ skip = '.git,uv.lock'
191
166
 
192
167
  [tool.hatch.envs.test]
193
168
  features = ["test"]
194
169
  installer = "uv"
195
170
 
196
171
  [[tool.hatch.envs.test.matrix]]
197
- python = ["3.10", "3.11", "3.12", "3.13"]
172
+ python = ["3.10", "3.11", "3.12", "3.13", "3.14"]
198
173
 
199
174
  [tool.hatch.envs.test.scripts]
200
- test = "pytest -v"
175
+ test = "pytest {args}"
176
+ cov = "coverage run -m pytest {args}"
177
+
178
+ [tool.coverage.run]
179
+ source = ["stdl"]
180
+ branch = true
181
+
182
+ [tool.coverage.report]
183
+ exclude_lines = [
184
+ 'pragma: no cover',
185
+ 'raise NotImplementedError',
186
+ 'if TYPE_CHECKING:',
187
+ 'if typing.TYPE_CHECKING:',
188
+ ]
189
+ omit = ["tests/*", "tests/**"]
190
+
191
+ [tool.mypy]
192
+ python_version = "3.10"
193
+ files = ["stdl"]
194
+ exclude = ["^tests/"]
195
+
196
+ disallow_untyped_defs = true
197
+ disallow_untyped_calls = true
198
+ disallow_any_generics = true
199
+ no_implicit_optional = true
200
+ warn_unused_ignores = true
201
+ warn_redundant_casts = true
202
+ warn_return_any = true
203
+ warn_unused_configs = true
204
+ strict_equality = true
205
+ ignore_missing_imports = true