diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..88bf4d0 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,17 @@ +root = true + +[*] +charset = utf-8 +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true + +[*.{py,toml,yml,yaml}] +indent_style = space +indent_size = 4 + +[*.md] +trim_trailing_whitespace = false + +[Makefile] +indent_style = tab diff --git a/README.md b/README.md index 89b3895..66b62ef 100644 --- a/README.md +++ b/README.md @@ -243,4 +243,4 @@ Contributions are welcome! Please see our [contributing guidelines](CONTRIBUTING ## License -MIT License - see [LICENSE](LICENSE) file for details. +Apache License 2.0 - see [LICENSE](LICENSE) file for details. diff --git a/embody/base.py b/embody/base.py index 9f71670..00b53d1 100644 --- a/embody/base.py +++ b/embody/base.py @@ -167,8 +167,8 @@ class TemplateWrapper: Examples: >>> template = TemplateWrapper({'name': '${user}', 'age': '${years}'}) - >>> template.get_dependencies() - {'user', 'years'} + >>> sorted(template.get_dependencies()) + ['user', 'years'] """ def __init__( diff --git a/embody/naming.py b/embody/naming.py index 3cfb242..944e9eb 100644 --- a/embody/naming.py +++ b/embody/naming.py @@ -311,7 +311,7 @@ def mk_pattern_from_template_and_format_dict(template, format_dict=None, sep=pat ... assert p == re.compile('(?P[^/]+)/and/(?P[^/]+)') >>> p = mk_pattern_from_template_and_format_dict('{here}/and/{there}', {'there': r'\d+'}) >>> if os.name == 'nt': # for windows - ... assert p == re.compile(r'(?P[^\\\\]+)/and/(?P\d+)') + ... assert p == re.compile(r'(?P[^\\]+)/and/(?P\d+)') ... else: ... assert p == re.compile(r'(?P[^/]+)/and/(?P\d+)') >>> type(p) diff --git a/pyproject.toml b/pyproject.toml index e5f417e..c330a85 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,15 +8,38 @@ version = "0.1.9" description = "Generate templated objects" readme = "README.md" requires-python = ">=3.10" -keywords = [] +license = "Apache-2.0" +license-files = ["LICENSE"] +keywords = [ + "templating", + "template", + "object-generation", + "nested-data", + "json-pointer", + "path-addressing", + "mapping", + "configuration", +] +classifiers = [ + "Development Status :: 3 - Alpha", + "Intended Audience :: Developers", + "Operating System :: OS Independent", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", + "Topic :: Software Development :: Libraries :: Python Modules", + "Topic :: Software Development :: Code Generators", +] authors = [{ name = "Thor Whalen" }] dependencies = ["dol"] -[project.license] -text = "Apache-2.0" - [project.urls] Homepage = "https://github.com/i2mint/embody" +Documentation = "https://i2mint.github.io/embody/" +Repository = "https://github.com/i2mint/embody" +Issues = "https://github.com/i2mint/embody/issues" [project.optional-dependencies] dev = ["pytest>=7.0", "pytest-cov>=4.0", "ruff>=0.1.0"] @@ -48,7 +71,15 @@ convention = "google" "**/examples/*" = ["D"] "**/scrap/*" = ["D"] +[tool.wads.ci.testing] +# `scrap/` is throwaway code (already excluded from ruff); wads' default +# exclude of "scrap" only matches a top-level dir, so name the real path. +exclude_paths = ["examples", "embody/scrap"] + [tool.pytest.ini_options] minversion = "6.0" -testpaths = ["tests"] +# CI runs `pytest --doctest-modules` with no path argument, so collection is +# driven entirely by testpaths. The package dir must be listed here or none of +# its doctests ever run. +testpaths = ["tests", "embody"] doctest_optionflags = ["NORMALIZE_WHITESPACE", "ELLIPSIS"]