Index: README.md ================================================================== --- README.md +++ README.md @@ -41,12 +41,10 @@ > * Separates code from meta data. Avoids keeping seldomly used descriptors in variables. > * Does away with externalized ini/json files for modules, yet simplifies use of external tooling. > * Minimizes premature module loading just to inspect meta information. -pluginconf is foremost about the universal meta comment format. - # API Lookup configuration is currently just done through injection: @@ -175,18 +173,20 @@ Alternatively, there's `pluginconf.flit` to utilize pyproject.toml for building packages, while sourcing meta data from the primary package file. [build-system] - requires = ["flit_core", "pluginconf"] + requires = ["pluginconf", "flit"] build-backend = "pluginconf.flit" [project] name = "projectname" -It can be invoked via `python -m pluginconf.flit build` or even -`flit-pluginconf build`. Field mapping isn't very robust yet. +It can be invoked via `flit-pluginconf build` / `python -m pluginconf.flit build` +or even `python -m build`. Field mapping isn't very robust yet, and mercilessly +flaunts the `dynamic=` directive. + ## other modules * `pluginconf.depends` provides `Check` for .valid() and .depends() probing Index: html/depends.html ================================================================== --- html/depends.html +++ html/depends.html @@ -33,16 +33,16 @@

Classes

class Check -(add={}, core=['st2', 'uikit', 'config', 'action']) +(add=None, core=['st2', 'uikit', 'config', 'action'])

Now this definitely requires customization. Each plugin can carry a list of (soft-) dependency names.

-

# depends: config, appcore >= 2.0, bin:wkhtmltoimage, python < 3.5

+

… # depends: config, appcore >= 2.0, bin:wkhtmltoimage, python < 3.5

Here only in-application modules are honored, system references ignored. Unknown plugin names are also skipped. A real install helper might want to auto-tick them on, etc. This example is just meant for probing downloadable plugins.

The .valid() helper only asserts the api: string, or skips existing Index: html/flit.html ================================================================== --- html/flit.html +++ html/flit.html @@ -29,16 +29,10 @@

Functions

-
-def inject(where) -
-
-

monkeypatch into module

-
def make_metadata(module, ini_info)

@inject different sourcing order to apply plugin meta fields

@@ -51,11 +45,11 @@
def read_flit_config(path)
-

@inject read_flit_config() with forced dynamic fields

+

@inject patch_flit_config() with forced dynamic fields

@@ -71,11 +65,10 @@
  • pluginconf
  • Functions

  • Index: html/setup.html ================================================================== --- html/setup.html +++ html/setup.html @@ -42,19 +42,21 @@

    find primary entry point.py from package name

    -def setup(debug=0, **kwargs) +def setup(filename=None, debug=False, **kwargs)

    Wrapper around setuptools.setup() which adds some defaults -and plugin meta data import, with two shortcut params:

    +and plugin meta data import, with some shortcut parameters:

    Parameters

    -
    fn : str
    -
    main file "pkg/main.py"
    +
    filename : str
    +
    main file "pkg/main.py" (else deduced from primary package name)
    +
    debug : bool
    +
    display collected options prior setuptools.setup() invocation
    long_description : str
    e.g. "README.md", else comment block used

    Other setup() params work as usual, and are passed trough. Notably entry_points= or data_files= can be used, even if they get augmented.

    Index: test/basic.py ================================================================== --- test/basic.py +++ test/basic.py @@ -2,10 +2,11 @@ # title: basic PMD # description: check for some fields # version: 0.1-rc1 # # This the doc. + import pytest import pluginconf @pytest.fixture @@ -14,12 +15,17 @@ def type_(pmd): assert pmd["type"] == "test" def version_(pmd): - assert pmd["version"] == "0.1-rc1" + assert pmd.version == "0.1-rc1" def title_(pmd): assert pmd["title"] == "basic PMD" def doc_(pmd): assert pmd["doc"] == "This the doc." + +# Should probably migrate all to pmd.property access now that we have PluginMeta wrapper +def test_all_as_props(pmd): + for key, val in pmd.items(): + assert getattr(pmd, key) == val