diff --git a/cookiecutter.json b/cookiecutter.json index ab5bc07..bee958d 100644 --- a/cookiecutter.json +++ b/cookiecutter.json @@ -13,10 +13,10 @@ "create_python_classes": ["Yes", "No"], "use_schemasheets": [ "Yes", - "No (next two questions are ignored)" + "No" ], "google_sheet_id": "1wVoaiFg47aT9YWNeRfTZ8tYHN8s8PAuDx5i2HUcDpvQ", "google_sheet_tabs": "personinfo enums", "__google_sheet_module": "{{ cookiecutter.google_sheet_tabs|lower()|replace(' ', '_')|replace('-', '_') }}", - "github_token_for_pypi_deployment": "PYPI_PASSWORD (leave blank if not a python project)" + "github_token_for_pypi_deployment": "PYPI_PASSWORD" } diff --git a/hooks/post_gen_project.py b/hooks/post_gen_project.py index 0764fcb..0339905 100644 --- a/hooks/post_gen_project.py +++ b/hooks/post_gen_project.py @@ -8,7 +8,7 @@ shutil.rmtree("licenses") project_slug = '{{ cookiecutter.__project_slug}}' -create_python_classes = '{{ cookiecutter.create_python_classes}}' +create_python_classes = '{{ cookiecutter.create_python_classes }}' if create_python_classes == "No": print("TODO - cleanup python") diff --git a/{{cookiecutter.project_name}}/.github/workflows/deploy-docs.yaml b/{{cookiecutter.project_name}}/.github/workflows/deploy-docs.yaml index 2022f04..6e242a8 100644 --- a/{{cookiecutter.project_name}}/.github/workflows/deploy-docs.yaml +++ b/{{cookiecutter.project_name}}/.github/workflows/deploy-docs.yaml @@ -25,6 +25,7 @@ jobs: - name: Build documentation. run: | + mkdir -p docs touch docs/.nojekyll poetry run gen-doc -d docs src/{{cookiecutter.__project_slug}}/schema/{{cookiecutter.__project_slug}}.yaml poetry run mkdocs gh-deploy \ No newline at end of file diff --git a/{{cookiecutter.project_name}}/.github/workflows/pypi-publish.yaml b/{{cookiecutter.project_name}}/.github/workflows/pypi-publish.yaml index 9203cf8..222969c 100644 --- a/{{cookiecutter.project_name}}/.github/workflows/pypi-publish.yaml +++ b/{{cookiecutter.project_name}}/.github/workflows/pypi-publish.yaml @@ -15,7 +15,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v2.2.2 with: - python-version: 3.8 + python-version: 3.9 - name: Install Poetry uses: snok/install-poetry@v1.1.6 diff --git a/{{cookiecutter.project_name}}/Makefile b/{{cookiecutter.project_name}}/Makefile index d5820a1..57b7810 100644 --- a/{{cookiecutter.project_name}}/Makefile +++ b/{{cookiecutter.project_name}}/Makefile @@ -80,7 +80,7 @@ site: gen-project gendoc deploy: all mkd-gh-deploy compile-sheets: -{% if cookiecutter.use_schemasheets %} +{% if cookiecutter.use_schemasheets == "Yes" %} $(RUN) sheets2linkml --gsheet-id $(SHEET_ID) $(SHEET_TABS) > $(SHEET_MODULE_PATH).tmp && mv $(SHEET_MODULE_PATH).tmp $(SHEET_MODULE_PATH) {% endif %} diff --git a/{{cookiecutter.project_name}}/pyproject.toml b/{{cookiecutter.project_name}}/pyproject.toml index 13c71d0..a6e5283 100644 --- a/{{cookiecutter.project_name}}/pyproject.toml +++ b/{{cookiecutter.project_name}}/pyproject.toml @@ -1,7 +1,7 @@ [tool.poetry] name = "{{cookiecutter.__project_slug}}" version = "0.1.0" -description = "Enter description of your project here" +description = "{{cookiecutter.description}}" authors = ["{{cookiecutter.__author}}"] license = "{{cookiecutter.license}}" readme = "README.md" @@ -20,3 +20,6 @@ schemasheets = "^0.1.14" [build-system] requires = ["poetry-core>=1.0.0"] build-backend = "poetry.core.masonry.api" + +[tool.poetry.extras] +docs = ["linkml", "mkdocs-material"] \ No newline at end of file diff --git a/{{cookiecutter.project_name}}/src/{{cookiecutter.__project_slug}}/schema/{{cookiecutter.__project_slug}}.yaml b/{{cookiecutter.project_name}}/src/{{cookiecutter.__project_slug}}/schema/{{cookiecutter.__project_slug}}.yaml index 445e3c6..41c0ef1 100644 --- a/{{cookiecutter.project_name}}/src/{{cookiecutter.__project_slug}}/schema/{{cookiecutter.__project_slug}}.yaml +++ b/{{cookiecutter.project_name}}/src/{{cookiecutter.__project_slug}}/schema/{{cookiecutter.__project_slug}}.yaml @@ -32,8 +32,7 @@ classes: - id - name - description - class_uri: - - schema:Thing + class_uri: schema:Thing {{cookiecutter.main_schema_class}}: is_a: NamedThing diff --git a/{{cookiecutter.project_name}}/tests/test_data.py b/{{cookiecutter.project_name}}/tests/test_data.py index 885046d..7f6fc93 100644 --- a/{{cookiecutter.project_name}}/tests/test_data.py +++ b/{{cookiecutter.project_name}}/tests/test_data.py @@ -4,7 +4,7 @@ import unittest from linkml_runtime.loaders import yaml_loader -from my_awesome_schema.datamodel import {{cookiecutter.main_schema_class}} +from {{cookiecutter.__project_slug}}.datamodel import {{cookiecutter.main_schema_class}} ROOT = os.path.join(os.path.dirname(__file__), '..') DATA_DIR = os.path.join(ROOT, "src", "data", "examples")