plaster_yaml 2.0.0__tar.gz → 2.0.2__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.
- {plaster_yaml-2.0.0 → plaster_yaml-2.0.2}/CHANGELOG.md +8 -0
- {plaster_yaml-2.0.0 → plaster_yaml-2.0.2}/PKG-INFO +19 -58
- {plaster_yaml-2.0.0 → plaster_yaml-2.0.2}/README.md +17 -56
- {plaster_yaml-2.0.0 → plaster_yaml-2.0.2}/pyproject.toml +7 -2
- {plaster_yaml-2.0.0 → plaster_yaml-2.0.2}/src/plaster_yaml/loader.py +1 -1
- {plaster_yaml-2.0.0 → plaster_yaml-2.0.2}/LICENSE +0 -0
- {plaster_yaml-2.0.0 → plaster_yaml-2.0.2}/src/plaster_yaml/__init__.py +0 -0
- {plaster_yaml-2.0.0 → plaster_yaml-2.0.2}/src/plaster_yaml/compat.py +0 -0
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
## 2.0.2 - 2024-10-22
|
|
2
|
+
|
|
3
|
+
* Fix the loader setup_logging interface method. defaults is not a mandatory parameter.
|
|
4
|
+
|
|
5
|
+
## 2.0.1 - 2024-10-19
|
|
6
|
+
|
|
7
|
+
* Rename plaster_yaml to plaster-yaml
|
|
8
|
+
|
|
1
9
|
## 2.0.0 - 2024-10-19
|
|
2
10
|
|
|
3
11
|
* /!\BREAKING CHANGE Restore the autoregistrion of the plaster-yaml file format in plaster.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
|
-
Name:
|
|
3
|
-
Version: 2.0.
|
|
2
|
+
Name: plaster-yaml
|
|
3
|
+
Version: 2.0.2
|
|
4
4
|
Summary: A plaster plugin to configure pyramid app with Yaml
|
|
5
5
|
Home-page: https://github.com/mardiros/plaster-yaml
|
|
6
6
|
License: BSD-derived
|
|
@@ -35,20 +35,25 @@ https://docs.pylonsproject.org/projects/plaster/en/latest/) loader
|
|
|
35
35
|
interface, accept YAML configuration sources.
|
|
36
36
|
|
|
37
37
|
By default, Pyramid (etc.) uses the PasteDeploy (.ini) file format for
|
|
38
|
-
its configuration.
|
|
38
|
+
its configuration. PasteDeploy has become obsolete and has been replace
|
|
39
|
+
by [plaster](https://docs.pylonsproject.org/projects/plaster/) and accept
|
|
40
|
+
plugins to write more file format.
|
|
41
|
+
|
|
42
|
+
With the `plaster-yaml` plugin, Pyramid
|
|
39
43
|
applications can also be configured with a YAML configuration file.
|
|
40
44
|
|
|
41
45
|
For example, one application can be run either of these ways:
|
|
42
46
|
|
|
43
|
-
```
|
|
44
|
-
pserve development.yaml
|
|
45
|
-
pserve development.ini
|
|
46
|
-
```
|
|
47
|
-
|
|
48
47
|
Because JSON is a subset of YAML `plaster-yaml` also supports JSON
|
|
49
48
|
configuration files. The "With `pyproject.toml` and a `setuptools`
|
|
50
49
|
`build` back-end" section below contains a JSON example.
|
|
51
50
|
|
|
51
|
+
```bash
|
|
52
|
+
pserve development.yaml
|
|
53
|
+
pserve development.json
|
|
54
|
+
pserve development.ini
|
|
55
|
+
```
|
|
56
|
+
|
|
52
57
|
## Installation
|
|
53
58
|
|
|
54
59
|
## With poetry
|
|
@@ -65,41 +70,12 @@ pip install plaster-yaml
|
|
|
65
70
|
|
|
66
71
|
## Usage
|
|
67
72
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
your choice. How this is done depends on the packaging tool.
|
|
71
|
-
Examples are given below.
|
|
72
|
-
|
|
73
|
-
It is the entry point's name, as will be clear in the examples, that
|
|
74
|
-
"connects" the filename extension of a configuration file to the
|
|
75
|
-
loader able to parse it. While it is not necessary to know the
|
|
76
|
-
details, here are the basic concepts: The entry point's name is a
|
|
77
|
-
[config_uri](
|
|
78
|
-
https://docs.pylonsproject.org/projects/plaster/en/latest/glossary.html#term-config-uri).
|
|
79
|
-
The scheme is that part of the URI to the left of the colon, and is
|
|
80
|
-
itself divisible. One of the scheme's components is matched with the
|
|
81
|
-
filename extension to select the correct loader.
|
|
82
|
-
|
|
83
|
-
When developing, using an [editable](
|
|
84
|
-
https://setuptools.pypa.io/en/latest/userguide/development_mode.html)
|
|
85
|
-
install that executes your unpackaged code, after changing your
|
|
86
|
-
package's configuration your packaging tool must be run in order to
|
|
87
|
-
finalize the registration. Examples are given below.
|
|
88
|
-
|
|
89
|
-
No special steps must be taken after configuring a entry point and
|
|
90
|
-
(correctly) packaging your project. The `plaster-yaml` plugin is
|
|
91
|
-
registered when your project's package is installed.
|
|
92
|
-
|
|
93
|
-
NOTE:\
|
|
94
|
-
All of the examples given below show not only how the one entry point
|
|
95
|
-
required to use `plaster-yaml` is configured, but also show how to
|
|
96
|
-
configure the entry point that makes your application into a WSGI,
|
|
97
|
-
web-based, application. The WSGI entry point is always required for
|
|
98
|
-
Pyramid web applications.
|
|
73
|
+
WSGI application that use plaster have to register an [entry point](https://packaging.python.org/en/latest/specifications/entry-points/),
|
|
74
|
+
from a ``paste.app_factory``.
|
|
99
75
|
|
|
100
76
|
## With poetry
|
|
101
77
|
|
|
102
|
-
|
|
78
|
+
App registration is configured in your `pyproject.toml`, as
|
|
103
79
|
follows:
|
|
104
80
|
|
|
105
81
|
```
|
|
@@ -108,12 +84,12 @@ main = "<PATH_TO_MODULE_CONTAINING_MAIN>:main"
|
|
|
108
84
|
|
|
109
85
|
```
|
|
110
86
|
|
|
111
|
-
When developing, run `poetry install` to register your
|
|
87
|
+
When developing, run `poetry install` to register your application after
|
|
112
88
|
adding the above to your `pyproject.toml`.
|
|
113
89
|
|
|
114
90
|
## With setuptools
|
|
115
91
|
|
|
116
|
-
When developing, run `pip install -e .` to register your
|
|
92
|
+
When developing, run `pip install -e .` to register your application after
|
|
117
93
|
using either of approaches below.
|
|
118
94
|
|
|
119
95
|
### With `pyproject.toml` and a `setuptools` `build` back-end
|
|
@@ -134,9 +110,6 @@ in additional to YAML and .ini config files:
|
|
|
134
110
|
```
|
|
135
111
|
[project.entry-points.'paste.app_factory']
|
|
136
112
|
main = '<my_app>:main']
|
|
137
|
-
|
|
138
|
-
[project.entry-points.'plaster.loader_factory']
|
|
139
|
-
'file+json' = 'plaster_yaml:Loader'
|
|
140
113
|
```
|
|
141
114
|
|
|
142
115
|
### With `setup.py`
|
|
@@ -146,7 +119,7 @@ This method is generally obsolete, but it can be used when the
|
|
|
146
119
|
method must be used when the deprecated `python setup.py ...`
|
|
147
120
|
command is the package building method.
|
|
148
121
|
|
|
149
|
-
|
|
122
|
+
Application registration may be configured in your `setup.py`, as
|
|
150
123
|
follows:
|
|
151
124
|
|
|
152
125
|
```
|
|
@@ -159,18 +132,6 @@ setup(
|
|
|
159
132
|
)
|
|
160
133
|
```
|
|
161
134
|
|
|
162
|
-
## Troubleshooting
|
|
163
|
-
|
|
164
|
-
The following exception means that you did not successfully register
|
|
165
|
-
the `plaster-yaml` plugin:
|
|
166
|
-
|
|
167
|
-
```
|
|
168
|
-
plaster.exceptions.LoaderNotFound: Could not find a matching loader for the scheme "file+yaml", protocol "wsgi".
|
|
169
|
-
```
|
|
170
|
-
|
|
171
|
-
Read the relevant "Usage" sub-section, above, to find out how to
|
|
172
|
-
register it properly.
|
|
173
|
-
|
|
174
135
|
## Appendix: A sample YAML config file for Pyramid
|
|
175
136
|
|
|
176
137
|
The sample YAML config file shown here configures the MYAPP Pyramid
|
|
@@ -14,20 +14,25 @@ https://docs.pylonsproject.org/projects/plaster/en/latest/) loader
|
|
|
14
14
|
interface, accept YAML configuration sources.
|
|
15
15
|
|
|
16
16
|
By default, Pyramid (etc.) uses the PasteDeploy (.ini) file format for
|
|
17
|
-
its configuration.
|
|
17
|
+
its configuration. PasteDeploy has become obsolete and has been replace
|
|
18
|
+
by [plaster](https://docs.pylonsproject.org/projects/plaster/) and accept
|
|
19
|
+
plugins to write more file format.
|
|
20
|
+
|
|
21
|
+
With the `plaster-yaml` plugin, Pyramid
|
|
18
22
|
applications can also be configured with a YAML configuration file.
|
|
19
23
|
|
|
20
24
|
For example, one application can be run either of these ways:
|
|
21
25
|
|
|
22
|
-
```
|
|
23
|
-
pserve development.yaml
|
|
24
|
-
pserve development.ini
|
|
25
|
-
```
|
|
26
|
-
|
|
27
26
|
Because JSON is a subset of YAML `plaster-yaml` also supports JSON
|
|
28
27
|
configuration files. The "With `pyproject.toml` and a `setuptools`
|
|
29
28
|
`build` back-end" section below contains a JSON example.
|
|
30
29
|
|
|
30
|
+
```bash
|
|
31
|
+
pserve development.yaml
|
|
32
|
+
pserve development.json
|
|
33
|
+
pserve development.ini
|
|
34
|
+
```
|
|
35
|
+
|
|
31
36
|
## Installation
|
|
32
37
|
|
|
33
38
|
## With poetry
|
|
@@ -44,41 +49,12 @@ pip install plaster-yaml
|
|
|
44
49
|
|
|
45
50
|
## Usage
|
|
46
51
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
your choice. How this is done depends on the packaging tool.
|
|
50
|
-
Examples are given below.
|
|
51
|
-
|
|
52
|
-
It is the entry point's name, as will be clear in the examples, that
|
|
53
|
-
"connects" the filename extension of a configuration file to the
|
|
54
|
-
loader able to parse it. While it is not necessary to know the
|
|
55
|
-
details, here are the basic concepts: The entry point's name is a
|
|
56
|
-
[config_uri](
|
|
57
|
-
https://docs.pylonsproject.org/projects/plaster/en/latest/glossary.html#term-config-uri).
|
|
58
|
-
The scheme is that part of the URI to the left of the colon, and is
|
|
59
|
-
itself divisible. One of the scheme's components is matched with the
|
|
60
|
-
filename extension to select the correct loader.
|
|
61
|
-
|
|
62
|
-
When developing, using an [editable](
|
|
63
|
-
https://setuptools.pypa.io/en/latest/userguide/development_mode.html)
|
|
64
|
-
install that executes your unpackaged code, after changing your
|
|
65
|
-
package's configuration your packaging tool must be run in order to
|
|
66
|
-
finalize the registration. Examples are given below.
|
|
67
|
-
|
|
68
|
-
No special steps must be taken after configuring a entry point and
|
|
69
|
-
(correctly) packaging your project. The `plaster-yaml` plugin is
|
|
70
|
-
registered when your project's package is installed.
|
|
71
|
-
|
|
72
|
-
NOTE:\
|
|
73
|
-
All of the examples given below show not only how the one entry point
|
|
74
|
-
required to use `plaster-yaml` is configured, but also show how to
|
|
75
|
-
configure the entry point that makes your application into a WSGI,
|
|
76
|
-
web-based, application. The WSGI entry point is always required for
|
|
77
|
-
Pyramid web applications.
|
|
52
|
+
WSGI application that use plaster have to register an [entry point](https://packaging.python.org/en/latest/specifications/entry-points/),
|
|
53
|
+
from a ``paste.app_factory``.
|
|
78
54
|
|
|
79
55
|
## With poetry
|
|
80
56
|
|
|
81
|
-
|
|
57
|
+
App registration is configured in your `pyproject.toml`, as
|
|
82
58
|
follows:
|
|
83
59
|
|
|
84
60
|
```
|
|
@@ -87,12 +63,12 @@ main = "<PATH_TO_MODULE_CONTAINING_MAIN>:main"
|
|
|
87
63
|
|
|
88
64
|
```
|
|
89
65
|
|
|
90
|
-
When developing, run `poetry install` to register your
|
|
66
|
+
When developing, run `poetry install` to register your application after
|
|
91
67
|
adding the above to your `pyproject.toml`.
|
|
92
68
|
|
|
93
69
|
## With setuptools
|
|
94
70
|
|
|
95
|
-
When developing, run `pip install -e .` to register your
|
|
71
|
+
When developing, run `pip install -e .` to register your application after
|
|
96
72
|
using either of approaches below.
|
|
97
73
|
|
|
98
74
|
### With `pyproject.toml` and a `setuptools` `build` back-end
|
|
@@ -113,9 +89,6 @@ in additional to YAML and .ini config files:
|
|
|
113
89
|
```
|
|
114
90
|
[project.entry-points.'paste.app_factory']
|
|
115
91
|
main = '<my_app>:main']
|
|
116
|
-
|
|
117
|
-
[project.entry-points.'plaster.loader_factory']
|
|
118
|
-
'file+json' = 'plaster_yaml:Loader'
|
|
119
92
|
```
|
|
120
93
|
|
|
121
94
|
### With `setup.py`
|
|
@@ -125,7 +98,7 @@ This method is generally obsolete, but it can be used when the
|
|
|
125
98
|
method must be used when the deprecated `python setup.py ...`
|
|
126
99
|
command is the package building method.
|
|
127
100
|
|
|
128
|
-
|
|
101
|
+
Application registration may be configured in your `setup.py`, as
|
|
129
102
|
follows:
|
|
130
103
|
|
|
131
104
|
```
|
|
@@ -138,18 +111,6 @@ setup(
|
|
|
138
111
|
)
|
|
139
112
|
```
|
|
140
113
|
|
|
141
|
-
## Troubleshooting
|
|
142
|
-
|
|
143
|
-
The following exception means that you did not successfully register
|
|
144
|
-
the `plaster-yaml` plugin:
|
|
145
|
-
|
|
146
|
-
```
|
|
147
|
-
plaster.exceptions.LoaderNotFound: Could not find a matching loader for the scheme "file+yaml", protocol "wsgi".
|
|
148
|
-
```
|
|
149
|
-
|
|
150
|
-
Read the relevant "Usage" sub-section, above, to find out how to
|
|
151
|
-
register it properly.
|
|
152
|
-
|
|
153
114
|
## Appendix: A sample YAML config file for Pyramid
|
|
154
115
|
|
|
155
116
|
The sample YAML config file shown here configures the MYAPP Pyramid
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
|
-
name = "
|
|
3
|
-
version = "2.0.
|
|
2
|
+
name = "plaster-yaml"
|
|
3
|
+
version = "2.0.2"
|
|
4
4
|
description = "A plaster plugin to configure pyramid app with Yaml"
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
authors = ["Guillaume Gauvrit <guillaume@gauvr.it>"]
|
|
@@ -8,6 +8,9 @@ homepage = "https://github.com/mardiros/plaster-yaml"
|
|
|
8
8
|
repository = "https://github.com/mardiros/plaster-yaml"
|
|
9
9
|
include = ["CHANGELOG.md"]
|
|
10
10
|
license = "BSD-derived"
|
|
11
|
+
packages = [
|
|
12
|
+
{ include = "plaster_yaml", from = "src" },
|
|
13
|
+
]
|
|
11
14
|
|
|
12
15
|
[tool.poetry.dependencies]
|
|
13
16
|
python = "^3.8.1"
|
|
@@ -17,6 +20,8 @@ PyYAML = "^6.0.1"
|
|
|
17
20
|
|
|
18
21
|
[tool.poetry.plugins."plaster.loader_factory"]
|
|
19
22
|
"file+yaml" = "plaster_yaml:Loader"
|
|
23
|
+
"file+yml" = "plaster_yaml:Loader"
|
|
24
|
+
"file+json" = "plaster_yaml:Loader"
|
|
20
25
|
|
|
21
26
|
[tool.poetry.group.dev]
|
|
22
27
|
optional = true
|
|
@@ -106,7 +106,7 @@ class Loader(plaster.ILoader):
|
|
|
106
106
|
def get_wsgi_app_settings(self, name=None, defaults=None):
|
|
107
107
|
return self.get_settings(name, defaults)
|
|
108
108
|
|
|
109
|
-
def setup_logging(self,
|
|
109
|
+
def setup_logging(self, defaults=None):
|
|
110
110
|
dictConfig(self._conf.get("logging", DEFAULT_LOGGING_CONFIG))
|
|
111
111
|
|
|
112
112
|
def get_wsgi_server(self, name=None, defaults=None):
|
|
File without changes
|
|
File without changes
|
|
File without changes
|