pycons 0.1.1__tar.gz → 0.2.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 (36) hide show
  1. {pycons-0.1.1 → pycons-0.2.0}/PKG-INFO +31 -30
  2. pycons-0.2.0/pyproject.toml +263 -0
  3. pycons-0.2.0/src/pycons/__init__.py +25 -0
  4. pycons-0.1.1/.copier-answers.yml +0 -21
  5. pycons-0.1.1/.github/FUNDING.yml +0 -3
  6. pycons-0.1.1/.github/copilot-instructions.md +0 -19
  7. pycons-0.1.1/.github/dependabot.yml +0 -9
  8. pycons-0.1.1/.github/workflows/build.yml +0 -88
  9. pycons-0.1.1/.github/workflows/documentation.yml +0 -57
  10. pycons-0.1.1/.gitignore +0 -32
  11. pycons-0.1.1/.pre-commit-config.yaml +0 -48
  12. pycons-0.1.1/docs/.empty +0 -0
  13. pycons-0.1.1/duties.py +0 -60
  14. pycons-0.1.1/mkdocs.yml +0 -92
  15. pycons-0.1.1/overrides/_dummy.txt +0 -1
  16. pycons-0.1.1/pyproject.toml +0 -259
  17. pycons-0.1.1/src/pycons/__init__.py +0 -6
  18. pycons-0.1.1/tests/__init__.py +0 -3
  19. pycons-0.1.1/tests/conftest.py +0 -1
  20. pycons-0.1.1/tests/test_icons.py +0 -57
  21. {pycons-0.1.1 → pycons-0.2.0}/LICENSE +0 -0
  22. {pycons-0.1.1 → pycons-0.2.0}/README.md +0 -0
  23. {pycons-0.1.1 → pycons-0.2.0}/src/pycons/asciicons.py +0 -0
  24. {pycons-0.1.1 → pycons-0.2.0}/src/pycons/favicon.py +0 -0
  25. {pycons-0.1.1 → pycons-0.2.0}/src/pycons/font_providers/__init__.py +0 -0
  26. {pycons-0.1.1 → pycons-0.2.0}/src/pycons/font_providers/base.py +0 -0
  27. {pycons-0.1.1 → pycons-0.2.0}/src/pycons/font_providers/models.py +0 -0
  28. {pycons-0.1.1 → pycons-0.2.0}/src/pycons/font_providers/providers.py +0 -0
  29. {pycons-0.1.1 → pycons-0.2.0}/src/pycons/font_providers/registry.py +0 -0
  30. {pycons-0.1.1 → pycons-0.2.0}/src/pycons/functional.py +0 -0
  31. {pycons-0.1.1 → pycons-0.2.0}/src/pycons/iconify/__init__.py +0 -0
  32. {pycons-0.1.1 → pycons-0.2.0}/src/pycons/iconify/api.py +0 -0
  33. {pycons-0.1.1 → pycons-0.2.0}/src/pycons/iconify/iconify.py +0 -0
  34. {pycons-0.1.1 → pycons-0.2.0}/src/pycons/iconify/iconify_types.py +0 -0
  35. {pycons-0.1.1 → pycons-0.2.0}/src/pycons/py.typed +0 -0
  36. {pycons-0.1.1 → pycons-0.2.0}/src/pycons/utils.py +0 -0
@@ -1,36 +1,32 @@
1
- Metadata-Version: 2.4
1
+ Metadata-Version: 2.3
2
2
  Name: pycons
3
- Version: 0.1.1
3
+ Version: 0.2.0
4
4
  Summary: Icon utilities (Material Design icons & similar)
5
- Project-URL: Documentation, https://phil65.github.io/pycons/
6
- Project-URL: Source, https://github.com/phil65/pycons
7
- Project-URL: Issues, https://github.com/phil65/pycons/issues
8
- Project-URL: Discussions, https://github.com/phil65/pycons/discussions
9
- Project-URL: Code coverage, https://app.codecov.io/gh/phil65/pycons
5
+ Keywords:
6
+ Author: Philipp Temminghoff
10
7
  Author-email: Philipp Temminghoff <philipptemminghoff@googlemail.com>
11
8
  License: MIT License
12
-
13
- Copyright (c) 2024, Philipp Temminghoff
14
-
15
- Permission is hereby granted, free of charge, to any person obtaining a copy
16
- of this software and associated documentation files (the "Software"), to deal
17
- in the Software without restriction, including without limitation the rights
18
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
19
- copies of the Software, and to permit persons to whom the Software is
20
- furnished to do so, subject to the following conditions:
21
-
22
- The above copyright notice and this permission notice shall be included in all
23
- copies or substantial portions of the Software.
24
-
25
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
26
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
27
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
28
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
29
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
30
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
31
- SOFTWARE.
32
-
33
- License-File: LICENSE
9
+
10
+ Copyright (c) 2024, Philipp Temminghoff
11
+
12
+ Permission is hereby granted, free of charge, to any person obtaining a copy
13
+ of this software and associated documentation files (the "Software"), to deal
14
+ in the Software without restriction, including without limitation the rights
15
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
16
+ copies of the Software, and to permit persons to whom the Software is
17
+ furnished to do so, subject to the following conditions:
18
+
19
+ The above copyright notice and this permission notice shall be included in all
20
+ copies or substantial portions of the Software.
21
+
22
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
25
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
27
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
28
+ SOFTWARE.
29
+
34
30
  Classifier: Development Status :: 4 - Beta
35
31
  Classifier: Intended Audience :: Developers
36
32
  Classifier: Operating System :: OS Independent
@@ -43,11 +39,16 @@ Classifier: Topic :: Documentation
43
39
  Classifier: Topic :: Software Development
44
40
  Classifier: Topic :: Utilities
45
41
  Classifier: Typing :: Typed
46
- Requires-Python: >=3.12
47
42
  Requires-Dist: anyenv>=0.2.0
48
43
  Requires-Dist: appdirs>=1.4.4
49
44
  Requires-Dist: hishel>=0.1.1
50
45
  Requires-Dist: httpx>=0.28.1
46
+ Requires-Python: >=3.12
47
+ Project-URL: Code coverage, https://app.codecov.io/gh/phil65/pycons
48
+ Project-URL: Discussions, https://github.com/phil65/pycons/discussions
49
+ Project-URL: Documentation, https://phil65.github.io/pycons/
50
+ Project-URL: Issues, https://github.com/phil65/pycons/issues
51
+ Project-URL: Source, https://github.com/phil65/pycons
51
52
  Description-Content-Type: text/markdown
52
53
 
53
54
  # Pycons
@@ -0,0 +1,263 @@
1
+ [project]
2
+ name = "pycons"
3
+ version = "0.2.0"
4
+ description = "Icon utilities (Material Design icons & similar)"
5
+ readme = "README.md"
6
+ requires-python = ">=3.12"
7
+ license = { file = "LICENSE" }
8
+ authors = [
9
+ { name = "Philipp Temminghoff", email = "philipptemminghoff@googlemail.com" },
10
+ ]
11
+ keywords = []
12
+ classifiers = [
13
+ "Development Status :: 4 - Beta",
14
+ "Intended Audience :: Developers",
15
+ "Operating System :: OS Independent",
16
+ "Programming Language :: Python :: 3",
17
+ "Programming Language :: Python :: 3 :: Only",
18
+ "Programming Language :: Python :: 3.12",
19
+ "Programming Language :: Python :: 3.13",
20
+ "Programming Language :: Python :: 3.14",
21
+ "Topic :: Documentation",
22
+ "Topic :: Software Development",
23
+ "Topic :: Utilities",
24
+ "Typing :: Typed",
25
+ ]
26
+ dependencies = [
27
+ "anyenv>=0.2.0",
28
+ "appdirs>=1.4.4",
29
+ "hishel>=0.1.1",
30
+ # Only add below (Copier)
31
+ "httpx>=0.28.1",
32
+ ]
33
+
34
+ [project.urls]
35
+ "Code coverage" = "https://app.codecov.io/gh/phil65/pycons"
36
+ Discussions = "https://github.com/phil65/pycons/discussions"
37
+ Documentation = "https://phil65.github.io/pycons/"
38
+ Issues = "https://github.com/phil65/pycons/issues"
39
+ Source = "https://github.com/phil65/pycons"
40
+
41
+ [dependency-groups]
42
+ dev = [
43
+ "devtools",
44
+ "pyreadline3",
45
+ "pytest",
46
+ # Only add below (Copier)
47
+ "pytest-asyncio>=0.25.3",
48
+ "pytest-cov",
49
+ ]
50
+ benchmark = ["pyinstrument"]
51
+ docs = [
52
+ "mkdocs-material",
53
+ "mkdocs-mknodes",
54
+ # Only add below (Copier)
55
+ ]
56
+ lint = [
57
+ "mypy; python_version >= '3.14'",
58
+ "mypy[faster-cache]; python_version < '3.14'",
59
+ "ruff",
60
+ # Only add below (Copier)
61
+ ]
62
+
63
+ [build-system]
64
+ requires = ["uv_build>=0.8.22"]
65
+ build-backend = "uv_build"
66
+
67
+ [tool.coverage.report]
68
+ exclude_lines = [
69
+ "pragma: no cover",
70
+ "if TYPE_CHECKING:",
71
+ "@overload",
72
+ "except ImportError",
73
+ 'if __name__ == "__main__":',
74
+ ]
75
+
76
+ [tool.mknodes]
77
+ allowed-commit-types = [
78
+ "fix",
79
+ "feat",
80
+ "refactor",
81
+ "docs",
82
+ "test",
83
+ "build",
84
+ "chore",
85
+ ]
86
+ docstring-style = "google"
87
+
88
+ [tool.mypy]
89
+ python_version = "3.12"
90
+ disable_error_code = ["misc", "import"]
91
+ pretty = true
92
+ check_untyped_defs = true
93
+ exclude = ["venv/", ".venv/", "tests/"]
94
+ plugins = []
95
+
96
+ [tool.pyright]
97
+ venvPath = "."
98
+ venv = ".venv"
99
+ pythonVersion = "3.12"
100
+ pythonPlatform = "All"
101
+ typeCheckingMode = "basic"
102
+ deprecateTypingAliases = true
103
+ reportMissingTypeStubs = false
104
+ reportUnusedCallResult = false
105
+ reportUnknownVariableType = false
106
+ reportAny = false
107
+ reportImplicitOverride = false
108
+ reportUnusedFunction = false
109
+ reportImplicitStringConcatenation = false
110
+ reportIgnoreCommentWithoutRule = false
111
+ reportUnannotatedClassAttribute = false
112
+ reportSelfClsParameterName = false
113
+ reportPrivateImportUsage = false
114
+
115
+ [tool.pytest.ini_options]
116
+ log_cli = true
117
+ log_date_format = "%Y-%m-%d %H:%M:%S"
118
+ log_format = "%(asctime)s %(levelname)s %(message)s"
119
+ testpaths = "tests/"
120
+ asyncio_mode = "auto"
121
+
122
+ [tool.ruff]
123
+ line-length = 90
124
+ extend-exclude = ["docs"]
125
+ target-version = "py312"
126
+
127
+ [tool.ruff.lint]
128
+ future-annotations = true
129
+ select = [
130
+ "A", # Flake8-builtins
131
+ # "ANN", # Flake8-Annotations
132
+ # "ASYNC", # Flake8-Async
133
+ # "ARG", # # Flake8-Unused-Arguments
134
+ "B", # flake8-bugbear
135
+ "BLE", # Flake8-blind-except
136
+ "C",
137
+ "C4", # flake8-comprehensions
138
+ # "C90", # MCCabe
139
+ "COM", # Flake8-commas
140
+ # "CPY", # Copyright-related rules
141
+ "D", # PyDocStyle
142
+ # "DTZ", # Flake8- Datetimez
143
+ "E", # PyCodeStyle Error
144
+ "EM", # flake8-errmsg
145
+ # "ERA", # Eradicate
146
+ "EXE", # flake8-executable
147
+ "F", # PyFlakes
148
+ "FA", # flake8-future-annotations
149
+ # "FBT", # flake8-boolean-trap
150
+ # "FIX", # flake8-fixme
151
+ "FLY", # flynt
152
+ "G", # flake8-logging-format
153
+ "I", # ISort
154
+ "ICN", # Flake8-import-conventions
155
+ "INP", # flake8-no-pep420
156
+ "INT", # flake8-gettext
157
+ "ISC", # flake8-implicit-str-concat
158
+ "N", # pep8-naming
159
+ # "NPY", # numpy-specific rules
160
+ # "PD", # pandas-vet
161
+ "PERF", # perflint
162
+ # "PGH", # pygrep-hooks
163
+ "PIE", # flake8-pie
164
+ "PLE", # PyLint Error
165
+ "PLC", # PyLint convention
166
+ # "PLW", # PyLint Warning
167
+ "PLR", # PyLint refactor
168
+ "PT", # flake8-pytest-style
169
+ "PTH", # flake8-use-pathlib
170
+ "PYI", # flake8-pyi
171
+ "Q", # flake8-quotes
172
+ "RET", # flake8-return
173
+ "RSE", # flake8-raise
174
+ "RUF", # ruff-specific rules
175
+ # "S", # flake8-bandit
176
+ "SIM", # flake8-simplify
177
+ "SLF", # flake8-self
178
+ "SLOT", # flake8-slots
179
+ # "T",
180
+ # "TD", # flake8-todos
181
+ "T10", # flake8-debugger
182
+ # "T20", # flake8-print
183
+ "TC", # flake8-type-checking
184
+ "TID", # flake8-tidy-imports
185
+ "TRY", # tryceratops
186
+ "UP", # PyUpgrade
187
+ "W", # PyCodeStyle warning
188
+ "YTT", # flake8-2020
189
+ ]
190
+ ignore = [
191
+ "C408", # Unnecessary {obj_type} call (rewrite as a literal)
192
+ "B905", # zip() without an explicit strict= parameter
193
+ "C901", # {name} is too complex ({complexity} > {max_complexity})
194
+ "COM812",
195
+ # "CPY001", # Missing copyright notice at top of file
196
+ "D100", # Missing docstring in public module
197
+ "D101", # Missing docstring in public class
198
+ "D102", # Missing docstring in public method
199
+ "D103", # Missing docstring in public function
200
+ "D104", # Missing docstring in public package
201
+ "D105", # Missing docstring in magic method
202
+ "D106", # Missing docstring in public nested class
203
+ "D107", # Missing docstring in __init__
204
+ "D203", # 1 blank line required before class docstring
205
+ "D204", # 1 blank line required after class docstring
206
+ "D213", # Multi-line docstring summary should start at the second line
207
+ "D215", # Section underline is over-indented ("{name}")
208
+ "D400", # First line should end with a period
209
+ "D401", # First line of docstring should be in imperative mood: "{first_line}"
210
+ "D404", # First word of the docstring should not be "This"
211
+ "D406", # Section name should end with a newline ("{name}")
212
+ "D407", # Missing dashed underline after section ("{name}")
213
+ "D408", # Section underline should be in the line following the section's name ("{name}")
214
+ "D409", # Section underline should match the length of its name ("{name}")
215
+ "D413", # Missing blank line after last section ("{name}")
216
+ "ISC001",
217
+ "PLC0415",
218
+ "PLR0912", # Too many branches
219
+ "PLR0913", # Too many arguments to function call
220
+ "PLR0915", # Too many statements
221
+ # "PLR2004", # Magic values instead of named consts
222
+ "SLF001", # Private member accessed
223
+ "TRY003", # Avoid specifying long messages outside the exception class
224
+ "TC006", # runtime-cast-value
225
+ ]
226
+
227
+ [tool.ruff.lint.flake8-quotes]
228
+ docstring-quotes = "double"
229
+
230
+ [tool.ruff.lint.flake8-type-checking]
231
+ runtime-evaluated-base-classes = [
232
+ "pydantic.BaseModel",
233
+ "sqlalchemy.orm.DeclarativeBase",
234
+ "schemez.Schema",
235
+ ]
236
+ runtime-evaluated-decorators = [
237
+ "pydantic.validate_call",
238
+ "attrs.define",
239
+ "fastapi.FastAPI.get",
240
+ "fastapi.FastAPI.post",
241
+ "fastmcp.FastMCP.tool",
242
+ ]
243
+
244
+ [tool.ruff.lint.isort]
245
+ lines-after-imports = 2
246
+ # lines-between-types = 1
247
+ # atomic = true
248
+ force-sort-within-sections = true
249
+ combine-as-imports = true
250
+
251
+ [tool.ruff.lint.per-file-ignores]
252
+ "__init__.py" = ["E402", "I001"]
253
+ "scripts/*" = ["INP001"]
254
+
255
+ [tool.ruff.format]
256
+ # Enable preview style formatting.
257
+ preview = true
258
+
259
+ [tool.ty.environment]
260
+ python-version = "3.12"
261
+
262
+ [tool.uv]
263
+ default-groups = ["dev", "lint", "docs"]
@@ -0,0 +1,25 @@
1
+ """Pycons: main package.
2
+
3
+ Icon utilities (Material Design icons & similar).
4
+ """
5
+
6
+ from __future__ import annotations
7
+
8
+ from importlib.metadata import version
9
+
10
+ __version__ = version("pycons")
11
+ __title__ = "Pycons"
12
+
13
+ __author__ = "Philipp Temminghoff"
14
+ __author_email__ = "philipptemminghoff@googlemail.com"
15
+ __copyright__ = "Copyright (c) 2025 Philipp Temminghoff"
16
+ __license__ = "MIT"
17
+ __url__ = "https://github.com/phil65/pycons"
18
+
19
+ from pycons.functional import get_icon_sync, get_icon
20
+
21
+ __all__ = [
22
+ "__version__",
23
+ "get_icon",
24
+ "get_icon_sync",
25
+ ]
@@ -1,21 +0,0 @@
1
- # Changes here will be overwritten by Copier
2
- _commit: v1.9.0
3
- _src_path: https://github.com/phil65/copier-phil65.git
4
- author_email: philipptemminghoff@googlemail.com
5
- author_fullname: Philipp Temminghoff
6
- author_username: phil65
7
- copyright_date: '2025'
8
- copyright_holder: Philipp Temminghoff
9
- copyright_holder_email: philipptemminghoff@googlemail.com
10
- libraries_use_pydantic: false
11
- libraries_use_qt: false
12
- project_description: Icon utilities (Material Design icons & similar)
13
- project_name: Pycons
14
- python_minimum_version: '3.12'
15
- python_package_command_line_name: pycons
16
- python_package_distribution_name: pycons
17
- python_package_import_name: pycons
18
- repository_name: pycons
19
- repository_namespace: phil65
20
- repository_provider: github.com
21
-
@@ -1,3 +0,0 @@
1
- github: phil65
2
- custom:
3
- - https://www.paypal.me/phil65
@@ -1,19 +0,0 @@
1
- ## Code style
2
-
3
- You can assume Python 3.12.
4
- Use newest language features if possible
5
- Consider using pattern matching, walrus operators and other new syntax features.
6
- Adhere to pep8.
7
-
8
- ## Tests
9
-
10
- Tests are written using PyTest. Dont put tests into a class.
11
-
12
- ## DocStrings
13
-
14
- DocStrings are written in google-style.
15
- Dont add the types to the "Args" section.
16
- Only add a Return section if a value is returned and the meaning of the returned value
17
- is not obvious.
18
- You can use markdown admonitions with python-markdown syntax if neccessary (!!! info, !!! note, !!! warning).
19
- You can use markdown tables and markdown lists if neccessary.
@@ -1,9 +0,0 @@
1
- # Set update schedule for GitHub Actions
2
-
3
- version: 2
4
- updates:
5
- - package-ecosystem: "github-actions"
6
- directory: "/"
7
- schedule:
8
- # Check for updates to GitHub Actions every week
9
- interval: "weekly"
@@ -1,88 +0,0 @@
1
- name: Build
2
-
3
- on: [push, pull_request]
4
-
5
- jobs:
6
- test:
7
- runs-on: ${{ matrix.os }}
8
- continue-on-error: ${{ matrix.python_version == '3.14' }}
9
- strategy:
10
- matrix:
11
- python_version: ["3.13", "3.14"]
12
- os: ["ubuntu-latest", "macos-latest", "windows-latest"]
13
- steps:
14
- - name: Check out repository
15
- uses: actions/checkout@v5
16
-
17
- - name: Set up Python ${{ matrix.python_version }}
18
- uses: actions/setup-python@v6
19
- with:
20
- python-version: ${{ matrix.python_version }}
21
- allow-prereleases: true
22
-
23
- - name: Install uv
24
- uses: astral-sh/setup-uv@v6
25
- with:
26
- enable-cache: true
27
- cache-dependency-glob: pyproject.toml
28
- cache-suffix: py${{ matrix.python_version }}
29
-
30
- - name: Install dependencies (uv sync)
31
- run: uv sync --all-extras --no-group docs
32
-
33
- - name: Check for code issues (ruff check)
34
- uses: astral-sh/ruff-action@v3
35
-
36
- - name: Check code format (ruff format)
37
- uses: astral-sh/ruff-action@v3
38
- with:
39
- args: "format --check"
40
-
41
- - name: Static type checking (MyPy)
42
- run: uv run --no-group docs mypy src/pycons/
43
-
44
- - name: Run tests
45
- run: uv run --no-group docs pytest --cov-report=xml --cov=src/pycons/ --cov-report=term-missing
46
-
47
- - name: Upload test results to Codecov
48
- uses: codecov/codecov-action@v5
49
- with:
50
- fail_ci_if_error: false
51
- verbose: true
52
-
53
- release:
54
- runs-on: ubuntu-latest
55
- needs: test
56
- if: startsWith(github.ref, 'refs/tags/')
57
- permissions:
58
- # this permission is mandatory for trusted publishing
59
- id-token: write
60
- contents: write
61
- steps:
62
- - name: Check out repository
63
- uses: actions/checkout@v5
64
-
65
- - name: Set up Python
66
- uses: actions/setup-python@v6
67
- with:
68
- python-version: "3.12"
69
-
70
- - name: Install uv
71
- uses: astral-sh/setup-uv@v6
72
- with:
73
- enable-cache: true
74
- cache-dependency-glob: pyproject.toml
75
- cache-suffix: py${{ matrix.python_version }}
76
-
77
- - name: Build package
78
- run: uv build
79
-
80
- - name: Publish package distributions to PyPI
81
- uses: pypa/gh-action-pypi-publish@release/v1
82
-
83
- - name: Release package on GitHub
84
- uses: ncipollo/release-action@v1
85
- with:
86
- body: ${{ github.event.head_commit.message }}
87
- artifacts: dist/*.whl,dist/*.tar.gz
88
- token: ${{ secrets.GITHUB_TOKEN }}
@@ -1,57 +0,0 @@
1
- name: Build documentation
2
-
3
- on:
4
- push:
5
- branches:
6
- - main
7
-
8
- # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
9
- permissions:
10
- contents: read
11
- pages: write
12
- id-token: write
13
-
14
- # Allow one concurrent deployment
15
- concurrency:
16
- group: "pages"
17
- cancel-in-progress: true
18
-
19
- # Default to bash
20
- defaults:
21
- run:
22
- shell: bash
23
-
24
- jobs:
25
- build:
26
- runs-on: ubuntu-latest
27
-
28
- steps:
29
- - uses: actions/checkout@v5
30
- with:
31
- fetch-depth: 0
32
- - name: Set up Python
33
- uses: actions/setup-python@v6
34
- with:
35
- python-version: "3.12"
36
- - name: Install uv
37
- uses: astral-sh/setup-uv@v6
38
- - name: Install dependencies
39
- run: |
40
- uv sync --all-extras
41
- - name: Build
42
- run: uv run mknodes build
43
- - name: Upload artifact
44
- uses: actions/upload-pages-artifact@v4
45
- with:
46
- path: ./site
47
-
48
- deploy:
49
- environment:
50
- name: github-pages
51
- url: ${{ steps.deployment.outputs.page_url }}
52
- runs-on: ubuntu-latest
53
- needs: build
54
- steps:
55
- - name: Deploy to GitHub Pages
56
- id: deployment
57
- uses: actions/deploy-pages@v4
pycons-0.1.1/.gitignore DELETED
@@ -1,32 +0,0 @@
1
- # Byte-compiled / optimized / DLL files
2
- __pycache__/
3
- *.py[cod]
4
- # Distribution / packaging
5
- *.sublime-workspace
6
- # Unit test / coverage reports
7
- .coverage
8
- coverage.xml
9
- .cache
10
- .hatch
11
- .pytest_cache/
12
- junit.xml
13
- # Jupyter Notebook
14
- .ipynb_checkpoints
15
- # pyenv
16
- .python-version
17
- # dotenv
18
- .env
19
- # virtualenv
20
- .venv
21
- # mkdocs documentation
22
- /site
23
- # mypy
24
- .mypy_cache/
25
- # .vscode
26
- .vscode/
27
- # OS files
28
- .DS_Store
29
- # uv
30
- uv.lock
31
- # DiskCache cache file
32
- ./model_cache
@@ -1,48 +0,0 @@
1
- default_language_version:
2
- python: python3.12
3
- default_stages: [pre-commit]
4
- repos:
5
- - repo: local
6
- hooks:
7
- - id: pytest-check
8
- name: pytest-check
9
- entry: uv run pytest
10
- language: system
11
- # stages: [push]
12
- types: [python]
13
- pass_filenames: false
14
- always_run: true
15
-
16
- - repo: https://github.com/pre-commit/pre-commit-hooks
17
- # https://pre-commit.com/hooks.html
18
- rev: v6.0.0
19
- hooks:
20
- - id: check-added-large-files
21
- - id: check-case-conflict
22
- - id: check-merge-conflict
23
- - id: check-toml
24
- - id: check-json
25
- - id: check-xml
26
- - id: check-yaml
27
- args: [--allow-multiple-documents, --unsafe]
28
- - id: debug-statements
29
- - id: detect-private-key
30
-
31
- - repo: https://github.com/pre-commit/mirrors-mypy
32
- rev: v1.18.2
33
- hooks:
34
- - id: mypy
35
- additional_dependencies: [orjson]
36
-
37
- - repo: https://github.com/charliermarsh/ruff-pre-commit
38
- rev: v0.13.3
39
- hooks:
40
- - id: ruff
41
- - id: ruff-format
42
-
43
- - repo: https://github.com/commitizen-tools/commitizen
44
- rev: v4.9.1
45
- hooks:
46
- - id: commitizen
47
- stages: [commit-msg]
48
- additional_dependencies: [typing-extensions]
pycons-0.1.1/docs/.empty DELETED
File without changes
pycons-0.1.1/duties.py DELETED
@@ -1,60 +0,0 @@
1
- from __future__ import annotations
2
-
3
- from duty import duty # pyright: ignore[reportMissingImports]
4
-
5
-
6
- @duty(capture=False)
7
- def build(ctx, *args: str):
8
- """Build a MkNodes page."""
9
- args_str = " " + " ".join(args) if args else ""
10
- ctx.run(f"uv run mknodes build{args_str}")
11
-
12
-
13
- @duty(capture=False)
14
- def serve(ctx, *args: str):
15
- """Serve a MkNodes page."""
16
- args_str = " " + " ".join(args) if args else ""
17
- ctx.run(f"uv run mknodes serve{args_str}")
18
-
19
-
20
- @duty(capture=False)
21
- def test(ctx, *args: str):
22
- """Serve a MkNodes page."""
23
- args_str = " " + " ".join(args) if args else ""
24
- ctx.run(f"uv run pytest{args_str}")
25
-
26
-
27
- @duty(capture=False)
28
- def clean(ctx):
29
- """Clean all files from the Git directory except checked-in files."""
30
- ctx.run("git clean -dfX")
31
-
32
-
33
- @duty(capture=False)
34
- def update(ctx):
35
- """Update all environment packages using pip directly."""
36
- ctx.run("uv lock --upgrade")
37
- ctx.run("uv sync --all-extras")
38
-
39
-
40
- @duty(capture=False)
41
- def lint(ctx):
42
- """Lint the code and fix issues if possible."""
43
- ctx.run("uv run ruff check --fix --unsafe-fixes .")
44
- ctx.run("uv run ruff format .")
45
- ctx.run("uv run mypy src/pycons/")
46
-
47
-
48
- @duty(capture=False)
49
- def lint_check(ctx):
50
- """Lint the code."""
51
- ctx.run("uv run ruff check .")
52
- ctx.run("uv run ruff format --check .")
53
- ctx.run("uv run mypy src/pycons/")
54
-
55
-
56
- @duty(capture=False)
57
- def version(ctx, *args: str):
58
- """Bump package version."""
59
- args_str = " " + " ".join(args) if args else ""
60
- ctx.run(f"hatch version{args_str}")
pycons-0.1.1/mkdocs.yml DELETED
@@ -1,92 +0,0 @@
1
- site_name: "Pycons"
2
- site_description: "Icon utilities (Material Design icons & similar)"
3
- repo_url: "https://github.com/phil65/pycons/"
4
- site_url: https://phil65.github.io/pycons/
5
- site_author: "Philipp Temminghoff"
6
- copyright: Copyright &copy; 2025 Philipp Temminghoff
7
-
8
- theme:
9
- name: material
10
- custom_dir: overrides
11
- icon:
12
- logo: material/graph-outline
13
- palette:
14
- # Palette toggle for automatic mode
15
- - media: "(prefers-color-scheme)"
16
- toggle:
17
- icon: material/brightness-auto
18
- name: Switch to light mode
19
-
20
- # Palette toggle for light mode
21
- - media: "(prefers-color-scheme: light)"
22
- scheme: default
23
- primary: red
24
- toggle:
25
- icon: material/brightness-7
26
- name: Switch to dark mode
27
-
28
- # Palette toggle for dark mode
29
- - media: "(prefers-color-scheme: dark)"
30
- scheme: slate
31
- primary: red
32
- toggle:
33
- icon: material/brightness-4
34
- name: Switch to system preference
35
- features:
36
- - announce.dismiss
37
- - content.action.edit
38
- - content.code.copy
39
- - content.code.select
40
- - content.code.annotate
41
- - content.tooltips
42
- # - content.tabs.link
43
- - navigation.tracking # update URL based on current item in TOC
44
- - navigation.path # shows breadcrumbs
45
- - navigation.tabs # make top level tabs
46
- - navigation.indexes # documents can be directly attached to sections (overview pages)
47
- - navigation.footer # next/previous page buttons in footer
48
- - navigation.top # adds back-to-top button
49
- # - navigation.sections # top-level sections are rendered as groups
50
- # - navigation.expand # expand all subsections in left sidebar by default
51
- - toc.follow # makes toc follow scrolling
52
- # - toc.integrate # integrates toc into left menu
53
- - search.highlight
54
- - search.suggest
55
- # - search.share
56
-
57
- plugins:
58
- - search
59
- - autorefs
60
- - mknodes
61
- - mkdocstrings:
62
- default_handler: python
63
- handlers:
64
- python:
65
- import:
66
- - url: https://docs.python.org/3/objects.inv
67
- domains: [std, py]
68
- options:
69
- # https://mkdocstrings.github.io/python/usage/
70
- enable_inventory: !ENV [CI, false]
71
- show_signature_annotations: true
72
- show_symbol_type_toc: true
73
- show_symbol_type_heading: true
74
- show_root_toc_entry: false
75
- # merge_init_into_class: true
76
- ignore_init_summary: true
77
- inherited_members: false
78
- signature_crossrefs: true
79
- separate_signature: true
80
- line_length: 90
81
- markdown_extensions:
82
- - attr_list
83
- - pymdownx.emoji
84
- - toc:
85
- permalink: true
86
-
87
- extra:
88
- social:
89
- - icon: fontawesome/brands/github
90
- link: https://github.com/phil65
91
- - icon: fontawesome/brands/python
92
- link: https://pypi.org/project/pycons/
@@ -1 +0,0 @@
1
- File exists to make sure that folder exists for git
@@ -1,259 +0,0 @@
1
- [tool.hatch.version]
2
- source = "regex_commit"
3
- commit_extra_args = ["-e"]
4
- path = "src/pycons/__init__.py"
5
-
6
- [build-system]
7
- requires = ["hatchling", "hatch-regex-commit"]
8
- build-backend = "hatchling.build"
9
-
10
- [project]
11
- name = "pycons"
12
- description = "Icon utilities (Material Design icons & similar)"
13
- authors = [
14
- { name = "Philipp Temminghoff", email = "philipptemminghoff@googlemail.com" },
15
- ]
16
- readme = "README.md"
17
- dynamic = ["version"]
18
- classifiers = [
19
- "Development Status :: 4 - Beta",
20
- "Intended Audience :: Developers",
21
- "Operating System :: OS Independent",
22
- "Programming Language :: Python :: 3",
23
- "Programming Language :: Python :: 3 :: Only",
24
- "Programming Language :: Python :: 3.12",
25
- "Programming Language :: Python :: 3.13",
26
- "Programming Language :: Python :: 3.14",
27
- "Topic :: Documentation",
28
- "Topic :: Software Development",
29
- "Topic :: Utilities",
30
- "Typing :: Typed",
31
-
32
- ]
33
- keywords = []
34
- requires-python = ">=3.12"
35
- license = { file = "LICENSE" }
36
- dependencies = [
37
- "anyenv>=0.2.0",
38
- "appdirs>=1.4.4",
39
- "hishel>=0.1.1",
40
- # Only add below (Copier)
41
- "httpx>=0.28.1",
42
- ]
43
-
44
- [tool.uv]
45
- default-groups = ["dev", "lint", "docs"]
46
-
47
- [dependency-groups]
48
- dev = [
49
- "pytest",
50
- "pytest-cov",
51
- "pyreadline3",
52
- "devtools",
53
- # Only add below (Copier)
54
- "pytest-asyncio>=0.25.3",
55
- ]
56
- benchmark = ["pyinstrument"]
57
- lint = [
58
- "ruff",
59
- "mypy[faster-cache]; python_version < '3.14'",
60
- "mypy; python_version >= '3.14'",
61
- # Only add below (Copier)
62
- ]
63
- docs = [
64
- "mkdocs-mknodes",
65
- "mkdocs-material",
66
- # Only add below (Copier)
67
- ]
68
-
69
- [project.urls]
70
- Documentation = "https://phil65.github.io/pycons/"
71
- Source = "https://github.com/phil65/pycons"
72
- Issues = "https://github.com/phil65/pycons/issues"
73
- Discussions = "https://github.com/phil65/pycons/discussions"
74
- "Code coverage" = "https://app.codecov.io/gh/phil65/pycons"
75
-
76
- [tool.pytest.ini_options]
77
- testpaths = "tests/"
78
- log_cli = true
79
- log_format = "%(asctime)s %(levelname)s %(message)s"
80
- log_date_format = "%Y-%m-%d %H:%M:%S"
81
- asyncio_mode = "auto"
82
-
83
- [tool.coverage.report]
84
- exclude_lines = [
85
- "pragma: no cover",
86
- "if TYPE_CHECKING:",
87
- "@overload",
88
- "except ImportError",
89
- 'if __name__ == "__main__":',
90
- ]
91
-
92
- [tool.mypy]
93
- python_version = "3.12"
94
- disable_error_code = ["misc", "import"]
95
- pretty = true
96
- check_untyped_defs = true
97
- exclude = ['venv/', '.venv/', 'tests/']
98
- plugins = []
99
-
100
- [tool.ruff]
101
- line-length = 90
102
- extend-exclude = ['docs']
103
- target-version = "py312"
104
-
105
- [tool.ruff.lint]
106
- future-annotations = true
107
- select = [
108
- "A", # Flake8-builtins
109
- # "ANN", # Flake8-Annotations
110
- # "ASYNC", # Flake8-Async
111
- # "ARG", # # Flake8-Unused-Arguments
112
- "B", # flake8-bugbear
113
- "BLE", # Flake8-blind-except
114
- "C",
115
- "C4", # flake8-comprehensions
116
- # "C90", # MCCabe
117
- "COM", # Flake8-commas
118
- # "CPY", # Copyright-related rules
119
- "D", # PyDocStyle
120
- # "DTZ", # Flake8- Datetimez
121
- "E", # PyCodeStyle Error
122
- "EM", # flake8-errmsg
123
- # "ERA", # Eradicate
124
- "EXE", # flake8-executable
125
- "F", # PyFlakes
126
- "FA", # flake8-future-annotations
127
- # "FBT", # flake8-boolean-trap
128
- # "FIX", # flake8-fixme
129
- "FLY", # flynt
130
- "G", # flake8-logging-format
131
- "I", # ISort
132
- "ICN", # Flake8-import-conventions
133
- "INP", # flake8-no-pep420
134
- "INT", # flake8-gettext
135
- "ISC", # flake8-implicit-str-concat
136
- "N", # pep8-naming
137
- # "NPY", # numpy-specific rules
138
- # "PD", # pandas-vet
139
- "PERF", # perflint
140
- # "PGH", # pygrep-hooks
141
- "PIE", # flake8-pie
142
- "PLE", # PyLint Error
143
- "PLC", # PyLint convention
144
- # "PLW", # PyLint Warning
145
- "PLR", # PyLint refactor
146
- "PT", # flake8-pytest-style
147
- "PTH", # flake8-use-pathlib
148
- "PYI", # flake8-pyi
149
- "Q", # flake8-quotes
150
- "RET", # flake8-return
151
- "RSE", # flake8-raise
152
- "RUF", # ruff-specific rules
153
- # "S", # flake8-bandit
154
- "SIM", # flake8-simplify
155
- "SLF", # flake8-self
156
- "SLOT", # flake8-slots
157
- # "T",
158
- # "TD", # flake8-todos
159
- "T10", # flake8-debugger
160
- # "T20", # flake8-print
161
- "TC", # flake8-type-checking
162
- "TID", # flake8-tidy-imports
163
- "TRY", # tryceratops
164
- "UP", # PyUpgrade
165
- "W", # PyCodeStyle warning
166
- "YTT", # flake8-2020
167
- ]
168
- ignore = [
169
- "C408", # Unnecessary {obj_type} call (rewrite as a literal)
170
- "B905", # zip() without an explicit strict= parameter
171
- "C901", # {name} is too complex ({complexity} > {max_complexity})
172
- "COM812",
173
- # "CPY001", # Missing copyright notice at top of file
174
- "D100", # Missing docstring in public module
175
- "D101", # Missing docstring in public class
176
- "D102", # Missing docstring in public method
177
- "D103", # Missing docstring in public function
178
- "D104", # Missing docstring in public package
179
- "D105", # Missing docstring in magic method
180
- "D106", # Missing docstring in public nested class
181
- "D107", # Missing docstring in __init__
182
- "D203", # 1 blank line required before class docstring
183
- "D204", # 1 blank line required after class docstring
184
- "D213", # Multi-line docstring summary should start at the second line
185
- "D215", # Section underline is over-indented ("{name}")
186
- "D400", # First line should end with a period
187
- "D401", # First line of docstring should be in imperative mood: "{first_line}"
188
- "D404", # First word of the docstring should not be "This"
189
- "D406", # Section name should end with a newline ("{name}")
190
- "D407", # Missing dashed underline after section ("{name}")
191
- "D408", # Section underline should be in the line following the section's name ("{name}")
192
- "D409", # Section underline should match the length of its name ("{name}")
193
- "D413", # Missing blank line after last section ("{name}")
194
- "ISC001",
195
- "PLC0415",
196
- "PLR0912", # Too many branches
197
- "PLR0913", # Too many arguments to function call
198
- "PLR0915", # Too many statements
199
- # "PLR2004", # Magic values instead of named consts
200
- "SLF001", # Private member accessed
201
- "TRY003", # Avoid specifying long messages outside the exception class
202
- "TC006", # runtime-cast-value
203
- ]
204
-
205
- [tool.ruff.lint.flake8-quotes]
206
- docstring-quotes = "double"
207
-
208
- [tool.ruff.lint.flake8-type-checking]
209
- runtime-evaluated-base-classes = ["pydantic.BaseModel", "sqlalchemy.orm.DeclarativeBase", "schemez.Schema"]
210
- runtime-evaluated-decorators = ["pydantic.validate_call", "attrs.define", "fastapi.FastAPI.get", "fastapi.FastAPI.post", "fastmcp.FastMCP.tool"]
211
-
212
- [tool.ruff.format]
213
- # Enable preview style formatting.
214
- preview = true
215
-
216
- [tool.ruff.lint.isort]
217
- lines-after-imports = 2
218
- # lines-between-types = 1
219
- # atomic = true
220
- force-sort-within-sections = true
221
- combine-as-imports = true
222
-
223
- [tool.ruff.lint.per-file-ignores]
224
- "__init__.py" = ["E402", "I001"]
225
- "scripts/*" = ["INP001"]
226
-
227
- [tool.ty.environment]
228
- python-version = "3.12"
229
-
230
- [tool.pyright]
231
- venvPath = "."
232
- venv = ".venv"
233
- pythonVersion = "3.12"
234
- pythonPlatform = "All"
235
- typeCheckingMode = "basic"
236
- deprecateTypingAliases = true
237
- reportMissingTypeStubs = false
238
- reportUnusedCallResult = false
239
- reportUnknownVariableType = false
240
- reportAny = false
241
- reportImplicitOverride = false
242
- reportUnusedFunction = false
243
- reportImplicitStringConcatenation = false
244
- reportIgnoreCommentWithoutRule = false
245
- reportUnannotatedClassAttribute = false
246
- reportSelfClsParameterName = false
247
- reportPrivateImportUsage = false
248
-
249
- [tool.mknodes]
250
- allowed-commit-types = [
251
- "fix",
252
- "feat",
253
- "refactor",
254
- "docs",
255
- "test",
256
- "build",
257
- "chore",
258
- ]
259
- docstring-style = "google"
@@ -1,6 +0,0 @@
1
- __version__ = "0.1.1"
2
-
3
-
4
- from pycons.functional import get_icon_sync, get_icon
5
-
6
- __all__ = ["get_icon", "get_icon_sync"]
@@ -1,3 +0,0 @@
1
- from pathlib import Path
2
-
3
- TESTS_DIR = Path(__file__).parent
@@ -1 +0,0 @@
1
- from __future__ import annotations
@@ -1,57 +0,0 @@
1
- """Test the icon providers."""
2
-
3
- import pytest
4
-
5
- from pycons.font_providers.registry import FontRegistry
6
- from pycons.functional import get_icon_from_iconify_id
7
-
8
-
9
- @pytest.mark.parametrize(
10
- ("icon_id", "provider_name"),
11
- [
12
- ("fa.heart", "Font Awesome Regular"),
13
- ("fas.heart", "Font Awesome Solid"),
14
- ("fab.github", "Font Awesome Brands"),
15
- ("mdi.home", "Community Material Design"),
16
- ("mso.home", "Google Material Symbols Outlined"),
17
- ("msr.home", "Google Material Symbols Rounded"),
18
- ("mss.home", "Google Material Symbols Sharp"),
19
- ("msc.home", "VS Code Codicons"),
20
- ("ph.house", "Phosphor"),
21
- ("ri.home-line", "Remix"),
22
- ("el.home", "Elusive"),
23
- ],
24
- )
25
- async def test_standard_provider_format(icon_id, provider_name):
26
- """Test fetching icons using standard provider format."""
27
- registry = FontRegistry()
28
- icon = await registry.get_icon(icon_id)
29
- assert icon.character, f"{provider_name} icon has no character"
30
- assert icon.ttf_path.exists(), f"{provider_name} font file does not exist"
31
-
32
-
33
- @pytest.mark.parametrize(
34
- ("iconify_id", "provider_name"),
35
- [
36
- ("mdi:home", "Community Material Design"),
37
- ("fa6-regular:heart", "Font Awesome Regular"),
38
- ("fa6-solid:heart", "Font Awesome Solid"),
39
- ("fa6-brands:github", "Font Awesome Brands"),
40
- ("material-symbols:home-outline", "Google Material Symbols Outlined"),
41
- ("material-symbols:home-rounded", "Google Material Symbols Rounded"),
42
- ("material-symbols:home-sharp", "Google Material Symbols Sharp"),
43
- ("codicon:home", "VS Code Codicons"),
44
- ("ph:house", "Phosphor"),
45
- ("ri:home-line", "Remix"),
46
- ("el:home", "Elusive"),
47
- ],
48
- )
49
- async def test_iconify_format(iconify_id, provider_name):
50
- """Test fetching icons using Iconify format."""
51
- icon = await get_icon_from_iconify_id(iconify_id)
52
- assert icon.character, f"{provider_name} icon has no character"
53
- assert icon.ttf_path.exists(), f"{provider_name} font file does not exist"
54
-
55
-
56
- if __name__ == "__main__":
57
- pytest.main([__file__])
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes