28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
| # Not sure yet if the pyproject.toml specs allow for reconcilation here.
# <https://github.com/pypa/flit/issues/605>
"""
monkeypatches flit to use pluginconf sources for packaging with a
`pyproject.toml` like:
[build-system]
requires = ["pluginconf", "flit"]
build-backend = "pluginconf.flit"
[project]
name = "foobar"
Can be invoked per `flit-pluginconf build` or `python -m build`.

"""
import sys
import os
import re
import functools
|
>
>
>
>
|
|
|
|
|
>
>
>
>
>
>
>
>
>
>
>
>
|
| 28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
| # Not sure yet if the pyproject.toml specs allow for reconcilation here.
# <https://github.com/pypa/flit/issues/605>
"""
monkeypatches flit to use pluginconf sources for packaging with a
`pyproject.toml` like:
<table>
<tr><th>pyproject.toml</th>
<th>foobar/__init__.py</th></tr>
<tr><td><code><pre>
[build-system]
requires = ["pluginconf", "flit]
build-backend = "pluginconf.flit"
[project]
name = "foobar"
dynamic = ["*"]
</pre></code></td>
<td><code><pre>
# title: foobar
# description: package summary
# version: 2.5.0
# depends: python:requests >= 2.25
# license: MITL
# classifiers: backend, text
# url: http;//example.org
</pre></code></td></tr>
</table>
Can be invoked per `flit-pluginconf build` or `python -m build`.
<img src="/pluginspec/doc/tip/html/flit.gif" alt="flit - can't believe it's not setup.py!!">
"""
import sys
import os
import re
import functools
|
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
| """ @inject different sourcing order to apply plugin meta fields """
meta = {
"name": module.name,
"provides": [module.name]
}
meta.update(ini_info.metadata)
meta.update(
pmd_meta(
pluginconf.plugin_meta(filename=module.file),
ini_info
)
)
if not meta.get("version"):
meta.update(
flit_core.common.get_info_from_module(module.file, ['version'])
)
#print(meta)
return flit_core.common.Metadata(meta)
# map plugin meta to flit Metadata
def pmd_meta(pmd, ini):
""" enjoin PMD fields with flit.common.MetaData """
pmd = psetup.MetaUtils(pmd)
meta = {
"summary": pmd.description,
"version": pmd.version,
"home_page": pmd.url,
"author": pmd.author, # should split this into mail and name
|
|
|
| 107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
| """ @inject different sourcing order to apply plugin meta fields """
meta = {
"name": module.name,
"provides": [module.name]
}
meta.update(ini_info.metadata)
meta.update(
pmd_update(
pluginconf.plugin_meta(filename=module.file),
ini_info
)
)
if not meta.get("version"):
meta.update(
flit_core.common.get_info_from_module(module.file, ['version'])
)
#print(meta)
return flit_core.common.Metadata(meta)
# map plugin meta to flit Metadata
def pmd_update(pmd, ini):
""" enjoin PMD fields with flit.common.MetaData """
pmd = psetup.MetaUtils(pmd)
meta = {
"summary": pmd.description,
"version": pmd.version,
"home_page": pmd.url,
"author": pmd.author, # should split this into mail and name
|