From c40010ce548126347c5fd7b36c2a5031bcd0b34b Mon Sep 17 00:00:00 2001 From: Ahmed Ilyas Date: Mon, 24 Jun 2024 11:39:14 +0200 Subject: [PATCH] Minor updates to docs and template (#22) * chore: update nomad versions * refactor: change the module name prompt * refactor: add a test for apps * docs: change icon and edit button * refactor: avoid updating github workflow files --- cookiecutter.json | 5 ++++- nomad-{{cookiecutter.plugin_name}}/mkdocs.yml | 3 +++ .../py_sources/tests/apps/test_app.py | 2 ++ nomad-{{cookiecutter.plugin_name}}/pyproject.toml | 7 +++++-- tox.ini | 3 +-- 5 files changed, 15 insertions(+), 5 deletions(-) diff --git a/cookiecutter.json b/cookiecutter.json index 0301292..145ff39 100644 --- a/cookiecutter.json +++ b/cookiecutter.json @@ -18,5 +18,8 @@ "include_app": true, "_copy_without_render": [ "*.html" - ] + ], + "__prompts__": { + "module_name": "module_name (recommended: press enter to use the default module name)" + } } diff --git a/nomad-{{cookiecutter.plugin_name}}/mkdocs.yml b/nomad-{{cookiecutter.plugin_name}}/mkdocs.yml index c9dd20e..a62c6b9 100644 --- a/nomad-{{cookiecutter.plugin_name}}/mkdocs.yml +++ b/nomad-{{cookiecutter.plugin_name}}/mkdocs.yml @@ -3,6 +3,7 @@ site_description: {{cookiecutter.short_description}} site_author: {{cookiecutter.full_name}} repo_url: https://github.com/{{cookiecutter.github_username}}/nomad-{{cookiecutter.plugin_name}} +edit_uri: "" nav: - Home: index.md @@ -28,6 +29,8 @@ theme: features: - navigation.instant custom_dir: docs/theme + icon: + repo: fontawesome/brands/github markdown_extensions: - attr_list - md_in_html diff --git a/nomad-{{cookiecutter.plugin_name}}/py_sources/tests/apps/test_app.py b/nomad-{{cookiecutter.plugin_name}}/py_sources/tests/apps/test_app.py index ccde9fe..15ffae7 100644 --- a/nomad-{{cookiecutter.plugin_name}}/py_sources/tests/apps/test_app.py +++ b/nomad-{{cookiecutter.plugin_name}}/py_sources/tests/apps/test_app.py @@ -2,3 +2,5 @@ def test_importing_app(): # this will raise an exception if pydantic model validation fails for th app from nomad_{{cookiecutter.module_name}}.apps import myapp + assert myapp.app.label == 'MyApp' + diff --git a/nomad-{{cookiecutter.plugin_name}}/pyproject.toml b/nomad-{{cookiecutter.plugin_name}}/pyproject.toml index ba4cc27..ed0f235 100644 --- a/nomad-{{cookiecutter.plugin_name}}/pyproject.toml +++ b/nomad-{{cookiecutter.plugin_name}}/pyproject.toml @@ -26,7 +26,7 @@ classifiers = [ name = "nomad-{{cookiecutter.plugin_name}}" description = "{{cookiecutter.short_description}}" version = "{{cookiecutter.version}}" -readme = "README.rst" +readme = "README.md" requires-python = ">=3.9" authors = [ { name = "{{cookiecutter.full_name}}", email = "{{cookiecutter.email}}" }, @@ -35,7 +35,7 @@ maintainers = [ { name = "{{cookiecutter.full_name}}", email = "{{cookiecutter.email}}" }, ] license = { file = "LICENSE" } -dependencies = ["nomad-lab>=1.2.2dev578"] +dependencies = ["nomad-lab>=1.3.0"] [project.urls] Repository = "https://github.com/{{cookiecutter.github_username}}/nomad-{{cookiecutter.plugin_name}}" @@ -134,3 +134,6 @@ mynormalizer = "nomad_{{cookiecutter.module_name}}.normalizers:mynormalizer" myapp = "nomad_{{cookiecutter.module_name}}.apps:myapp" {%- endif %} +[tool.cruft] +# Avoid updating workflow files, this leads to permissions issues +skip = [".github/*"] diff --git a/tox.ini b/tox.ini index 238ab33..8f6a118 100644 --- a/tox.ini +++ b/tox.ini @@ -6,12 +6,11 @@ envlist = py39 [testenv] setenv = UV_EXTRA_INDEX_URL=https://gitlab.mpcdf.mpg.de/api/v4/projects/2187/packages/pypi/simple - UV_PRERELEASE=allow deps = pytest pytest-cookies tox - nomad-lab>=1.2.2dev578 + nomad-lab>=1.3.0 commands = pytest {posargs:tests}