pyrig-resources 1.0.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.
- pyrig_resources-1.0.0/LICENSE +21 -0
- pyrig_resources-1.0.0/PKG-INFO +96 -0
- pyrig_resources-1.0.0/README.md +70 -0
- pyrig_resources-1.0.0/pyproject.toml +104 -0
- pyrig_resources-1.0.0/src/pyrig_resources/__init__.py +6 -0
- pyrig_resources-1.0.0/src/pyrig_resources/py.typed +0 -0
- pyrig_resources-1.0.0/src/pyrig_resources/rig/__init__.py +5 -0
- pyrig_resources-1.0.0/src/pyrig_resources/rig/configs/__init__.py +6 -0
- pyrig_resources-1.0.0/src/pyrig_resources/rig/configs/resources_init.py +38 -0
- pyrig_resources-1.0.0/src/pyrig_resources/rig/resources/__init__.py +1 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Winipedia
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: pyrig-resources
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: A pyrig plugin that adds resources support.
|
|
5
|
+
Keywords: pyrig
|
|
6
|
+
Author: Winipedia
|
|
7
|
+
License-Expression: MIT
|
|
8
|
+
License-File: LICENSE
|
|
9
|
+
Classifier: Programming Language :: Python
|
|
10
|
+
Classifier: Programming Language :: Python :: 3
|
|
11
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
15
|
+
Classifier: Operating System :: OS Independent
|
|
16
|
+
Classifier: Typing :: Typed
|
|
17
|
+
Requires-Dist: pyrig>=12.16.3
|
|
18
|
+
Maintainer: Winipedia
|
|
19
|
+
Requires-Python: >=3.12
|
|
20
|
+
Project-URL: Homepage, https://github.com/Winipedia/pyrig-resources
|
|
21
|
+
Project-URL: Documentation, https://Winipedia.github.io/pyrig-resources
|
|
22
|
+
Project-URL: Source, https://github.com/Winipedia/pyrig-resources
|
|
23
|
+
Project-URL: Issues, https://github.com/Winipedia/pyrig-resources/issues
|
|
24
|
+
Project-URL: Changelog, https://github.com/Winipedia/pyrig-resources/releases
|
|
25
|
+
Description-Content-Type: text/markdown
|
|
26
|
+
|
|
27
|
+
# pyrig-resources
|
|
28
|
+
|
|
29
|
+
<!-- security -->
|
|
30
|
+
[](https://github.com/pypa/pip-audit)
|
|
31
|
+
[](https://github.com/PyCQA/bandit)
|
|
32
|
+
<!-- ci/cd -->
|
|
33
|
+
[](https://github.com/Winipedia/pyrig-resources/actions/workflows/health_check.yml)
|
|
34
|
+
[](https://github.com/Winipedia/pyrig-resources/actions/workflows/deploy.yml)
|
|
35
|
+
<!-- code-quality -->
|
|
36
|
+
[](https://github.com/rvben/rumdl)
|
|
37
|
+
[](https://github.com/astral-sh/ruff)
|
|
38
|
+
[](https://github.com/astral-sh/ty)
|
|
39
|
+
[](https://github.com/j178/prek)
|
|
40
|
+
<!-- testing -->
|
|
41
|
+
[](https://codecov.io/gh/Winipedia/pyrig-resources)
|
|
42
|
+
[](https://pytest.org)
|
|
43
|
+
<!-- tooling -->
|
|
44
|
+
[](https://github.com/astral-sh/uv)
|
|
45
|
+
[](https://github.com/Winipedia/pyrig)
|
|
46
|
+
[](https://github.com/Winipedia/pyrig-resources)
|
|
47
|
+
[](https://git-scm.com)
|
|
48
|
+
<!-- documentation -->
|
|
49
|
+
[](https://www.mkdocs.org)
|
|
50
|
+
[](https://Winipedia.github.io/pyrig-resources)
|
|
51
|
+
<!-- project-info -->
|
|
52
|
+
[](https://pypi.org/project/pyrig-resources)
|
|
53
|
+
[](https://www.python.org)
|
|
54
|
+
[](https://github.com/Winipedia/pyrig-resources/blob/main/LICENSE)
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
> A pyrig plugin that adds resources support.
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
## What is pyrig-resources
|
|
63
|
+
|
|
64
|
+
pyrig-resources is a plugin for [pyrig](https://github.com/Winipedia/pyrig) that
|
|
65
|
+
adds a dedicated `rig/resources/` package to your project — a conventional home
|
|
66
|
+
for static resource files (templates, data files, assets) that ship with your
|
|
67
|
+
package.
|
|
68
|
+
|
|
69
|
+
## Features
|
|
70
|
+
|
|
71
|
+
### Resources Package
|
|
72
|
+
|
|
73
|
+
Registers a config file that pyrig discovers automatically. When you run
|
|
74
|
+
`pyrig mkroot`, the plugin creates `src/<your_project>/rig/resources/__init__.py`,
|
|
75
|
+
giving you a ready-made package to drop static resources into.
|
|
76
|
+
|
|
77
|
+
### Zero Configuration
|
|
78
|
+
|
|
79
|
+
No setup required. Installing the package as a development dependency is the
|
|
80
|
+
whole configuration — pyrig picks up the plugin's config file the next time you
|
|
81
|
+
regenerate your project.
|
|
82
|
+
|
|
83
|
+
## Usage
|
|
84
|
+
|
|
85
|
+
Add pyrig-resources as a development dependency in your pyrig project and run
|
|
86
|
+
`pyrig mkroot` to generate the project structure:
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
uv add --group dev pyrig-resources
|
|
90
|
+
uv run pyrig mkroot
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
After that, `src/<your_project>/rig/resources/` exists and is ready to hold your
|
|
94
|
+
static resource files.
|
|
95
|
+
|
|
96
|
+
---
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# pyrig-resources
|
|
2
|
+
|
|
3
|
+
<!-- security -->
|
|
4
|
+
[](https://github.com/pypa/pip-audit)
|
|
5
|
+
[](https://github.com/PyCQA/bandit)
|
|
6
|
+
<!-- ci/cd -->
|
|
7
|
+
[](https://github.com/Winipedia/pyrig-resources/actions/workflows/health_check.yml)
|
|
8
|
+
[](https://github.com/Winipedia/pyrig-resources/actions/workflows/deploy.yml)
|
|
9
|
+
<!-- code-quality -->
|
|
10
|
+
[](https://github.com/rvben/rumdl)
|
|
11
|
+
[](https://github.com/astral-sh/ruff)
|
|
12
|
+
[](https://github.com/astral-sh/ty)
|
|
13
|
+
[](https://github.com/j178/prek)
|
|
14
|
+
<!-- testing -->
|
|
15
|
+
[](https://codecov.io/gh/Winipedia/pyrig-resources)
|
|
16
|
+
[](https://pytest.org)
|
|
17
|
+
<!-- tooling -->
|
|
18
|
+
[](https://github.com/astral-sh/uv)
|
|
19
|
+
[](https://github.com/Winipedia/pyrig)
|
|
20
|
+
[](https://github.com/Winipedia/pyrig-resources)
|
|
21
|
+
[](https://git-scm.com)
|
|
22
|
+
<!-- documentation -->
|
|
23
|
+
[](https://www.mkdocs.org)
|
|
24
|
+
[](https://Winipedia.github.io/pyrig-resources)
|
|
25
|
+
<!-- project-info -->
|
|
26
|
+
[](https://pypi.org/project/pyrig-resources)
|
|
27
|
+
[](https://www.python.org)
|
|
28
|
+
[](https://github.com/Winipedia/pyrig-resources/blob/main/LICENSE)
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
> A pyrig plugin that adds resources support.
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## What is pyrig-resources
|
|
37
|
+
|
|
38
|
+
pyrig-resources is a plugin for [pyrig](https://github.com/Winipedia/pyrig) that
|
|
39
|
+
adds a dedicated `rig/resources/` package to your project — a conventional home
|
|
40
|
+
for static resource files (templates, data files, assets) that ship with your
|
|
41
|
+
package.
|
|
42
|
+
|
|
43
|
+
## Features
|
|
44
|
+
|
|
45
|
+
### Resources Package
|
|
46
|
+
|
|
47
|
+
Registers a config file that pyrig discovers automatically. When you run
|
|
48
|
+
`pyrig mkroot`, the plugin creates `src/<your_project>/rig/resources/__init__.py`,
|
|
49
|
+
giving you a ready-made package to drop static resources into.
|
|
50
|
+
|
|
51
|
+
### Zero Configuration
|
|
52
|
+
|
|
53
|
+
No setup required. Installing the package as a development dependency is the
|
|
54
|
+
whole configuration — pyrig picks up the plugin's config file the next time you
|
|
55
|
+
regenerate your project.
|
|
56
|
+
|
|
57
|
+
## Usage
|
|
58
|
+
|
|
59
|
+
Add pyrig-resources as a development dependency in your pyrig project and run
|
|
60
|
+
`pyrig mkroot` to generate the project structure:
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
uv add --group dev pyrig-resources
|
|
64
|
+
uv run pyrig mkroot
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
After that, `src/<your_project>/rig/resources/` exists and is ready to hold your
|
|
68
|
+
static resource files.
|
|
69
|
+
|
|
70
|
+
---
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "pyrig-resources"
|
|
3
|
+
version = "1.0.0"
|
|
4
|
+
description = "A pyrig plugin that adds resources support."
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
requires-python = ">=3.12"
|
|
7
|
+
dependencies = [
|
|
8
|
+
"pyrig>=12.16.3",
|
|
9
|
+
]
|
|
10
|
+
license = "MIT"
|
|
11
|
+
license-files = [
|
|
12
|
+
"LICENSE",
|
|
13
|
+
]
|
|
14
|
+
classifiers = [
|
|
15
|
+
"Programming Language :: Python",
|
|
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
|
+
"Operating System :: OS Independent",
|
|
22
|
+
"Typing :: Typed",
|
|
23
|
+
]
|
|
24
|
+
keywords = [
|
|
25
|
+
"pyrig",
|
|
26
|
+
]
|
|
27
|
+
|
|
28
|
+
[[project.authors]]
|
|
29
|
+
name = "Winipedia"
|
|
30
|
+
|
|
31
|
+
[[project.maintainers]]
|
|
32
|
+
name = "Winipedia"
|
|
33
|
+
|
|
34
|
+
[project.urls]
|
|
35
|
+
Homepage = "https://github.com/Winipedia/pyrig-resources"
|
|
36
|
+
Documentation = "https://Winipedia.github.io/pyrig-resources"
|
|
37
|
+
Source = "https://github.com/Winipedia/pyrig-resources"
|
|
38
|
+
Issues = "https://github.com/Winipedia/pyrig-resources/issues"
|
|
39
|
+
Changelog = "https://github.com/Winipedia/pyrig-resources/releases"
|
|
40
|
+
|
|
41
|
+
[project.scripts]
|
|
42
|
+
pyrig-resources = "pyrig.rig.cli.main:main"
|
|
43
|
+
|
|
44
|
+
[dependency-groups]
|
|
45
|
+
dev = [
|
|
46
|
+
"bandit>=1.9.4",
|
|
47
|
+
"mkdocs>=1.6.1",
|
|
48
|
+
"mkdocs-material>=9.7.6",
|
|
49
|
+
"mkdocs-mermaid2-plugin>=1.2.3",
|
|
50
|
+
"mkdocstrings[python]>=1.0.4",
|
|
51
|
+
"pip-audit>=2.10.1",
|
|
52
|
+
"prek>=0.4.5",
|
|
53
|
+
"pygithub>=2.9.1",
|
|
54
|
+
"pyrig-codecov>=1.3.3",
|
|
55
|
+
"pyrig-dev>=2.9.1",
|
|
56
|
+
"pyrig-pypi>=1.5.4",
|
|
57
|
+
"pytest>=9.1.0",
|
|
58
|
+
"pytest-cov>=7.1.0",
|
|
59
|
+
"pytest-mock>=3.15.1",
|
|
60
|
+
"ruff>=0.15.17",
|
|
61
|
+
"rumdl>=0.2.17",
|
|
62
|
+
"ty>=0.0.49",
|
|
63
|
+
]
|
|
64
|
+
|
|
65
|
+
[build-system]
|
|
66
|
+
requires = [
|
|
67
|
+
"uv_build",
|
|
68
|
+
]
|
|
69
|
+
build-backend = "uv_build"
|
|
70
|
+
|
|
71
|
+
[tool.ruff.lint]
|
|
72
|
+
select = [
|
|
73
|
+
"ALL",
|
|
74
|
+
]
|
|
75
|
+
ignore = [
|
|
76
|
+
"COM812",
|
|
77
|
+
"ANN401",
|
|
78
|
+
]
|
|
79
|
+
fixable = [
|
|
80
|
+
"ALL",
|
|
81
|
+
]
|
|
82
|
+
|
|
83
|
+
[tool.ruff.lint.per-file-ignores]
|
|
84
|
+
"**/tests/**/*.py" = [
|
|
85
|
+
"S101",
|
|
86
|
+
]
|
|
87
|
+
|
|
88
|
+
[tool.ruff.lint.pydocstyle]
|
|
89
|
+
convention = "google"
|
|
90
|
+
|
|
91
|
+
[tool.ty.terminal]
|
|
92
|
+
error-on-warning = true
|
|
93
|
+
|
|
94
|
+
[tool.pytest.ini_options]
|
|
95
|
+
testpaths = [
|
|
96
|
+
"tests",
|
|
97
|
+
]
|
|
98
|
+
addopts = "--cov=pyrig_resources --cov-branch --cov-report=term-missing --cov-fail-under=100 --cov-report=xml"
|
|
99
|
+
|
|
100
|
+
[tool.bandit.assert_used]
|
|
101
|
+
skips = [
|
|
102
|
+
"*/tests/*.py",
|
|
103
|
+
"*/test_*/*.py",
|
|
104
|
+
]
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"""pyrig-resources: a pyrig plugin that scaffolds a static-resources package.
|
|
2
|
+
|
|
3
|
+
Installing this package as a dependency makes ``pyrig mkroot`` create a
|
|
4
|
+
``rig/resources/`` package in the target project, providing a conventional
|
|
5
|
+
home for static resource files bundled with the project.
|
|
6
|
+
"""
|
|
File without changes
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"""Config that scaffolds a ``rig/resources/`` package in pyrig projects.
|
|
2
|
+
|
|
3
|
+
Defines :class:`ResourcesInitConfigFile`, a config file subclass that pyrig
|
|
4
|
+
discovers automatically when this plugin is installed as a dependency. Running
|
|
5
|
+
``pyrig mkroot`` then creates a ``rig/resources/__init__.py`` inside the target
|
|
6
|
+
project, giving it a conventional home for static resource files.
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
from types import ModuleType
|
|
10
|
+
|
|
11
|
+
from pyrig.rig.configs.base.init import InitConfigFile
|
|
12
|
+
|
|
13
|
+
from pyrig_resources.rig import resources
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class ResourcesInitConfigFile(InitConfigFile):
|
|
17
|
+
"""Generate the target project's ``rig/resources/__init__.py``.
|
|
18
|
+
|
|
19
|
+
This config file is picked up by pyrig's cross-package subclass discovery
|
|
20
|
+
when ``pyrig mkroot`` runs in any project that depends on this plugin. The
|
|
21
|
+
inherited :class:`~pyrig.rig.configs.base.init.InitConfigFile` machinery
|
|
22
|
+
resolves the source module's dotted name into the target project's package
|
|
23
|
+
tree, so ``pyrig_resources.rig.resources`` maps to
|
|
24
|
+
``src/<project>/rig/resources/__init__.py``. The generated file carries the
|
|
25
|
+
docstring of the :mod:`pyrig_resources.rig.resources` package, marking the
|
|
26
|
+
directory as the project's location for static resource files.
|
|
27
|
+
"""
|
|
28
|
+
|
|
29
|
+
def copy_module(self) -> ModuleType:
|
|
30
|
+
"""Return the module whose docstring seeds the generated package.
|
|
31
|
+
|
|
32
|
+
Returns:
|
|
33
|
+
The :mod:`pyrig_resources.rig.resources` package, whose dotted name
|
|
34
|
+
determines the generated file's location (``rig/resources/``) and
|
|
35
|
+
whose docstring becomes the content of the generated
|
|
36
|
+
``__init__.py``.
|
|
37
|
+
"""
|
|
38
|
+
return resources
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""Static resource files for this project."""
|