diff --git a/.gitignore b/.gitignore index 8cd0df3..569e6d2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ .vscode -.idea \ No newline at end of file +.idea +.DS_Store \ No newline at end of file diff --git a/cookiecutter.json b/cookiecutter.json index 2fcb3e1..81e16d1 100644 --- a/cookiecutter.json +++ b/cookiecutter.json @@ -7,8 +7,5 @@ "author_name": "", "author_email": "", "github_username": "", - "github_organization": "", - "_extensions": [ - "jinja2_time.TimeExtension" - ] + "github_organization": "" } \ No newline at end of file diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 25bcbdf..0000000 --- a/requirements.txt +++ /dev/null @@ -1,5 +0,0 @@ -bump-my-version -compas_invocations2 -invoke >=0.14 -ruff -sphinx_compas2_theme diff --git a/tasks.py b/tasks.py deleted file mode 100644 index 2099b2c..0000000 --- a/tasks.py +++ /dev/null @@ -1,17 +0,0 @@ -from compas_invocations2 import build -from compas_invocations2 import docs -from compas_invocations2 import style -from compas_invocations2 import tests -from invoke.collection import Collection - -ns = Collection( - style.check, - style.lint, - style.format, - docs.docs, - docs.linkcheck, - tests.test, - tests.testdocs, - tests.testcodeblocks, - build.prepare_changelog, -) diff --git a/tests/test_trivial.py b/tests/test_trivial.py deleted file mode 100644 index 50b2c76..0000000 --- a/tests/test_trivial.py +++ /dev/null @@ -1,2 +0,0 @@ -def test_trivial(): - assert True diff --git a/{{cookiecutter.project_folder}}/.github/workflows/build.yml b/{{cookiecutter.project_folder}}/.github/workflows/build.yml index 5e9ce0d..6cf3c37 100644 --- a/{{cookiecutter.project_folder}}/.github/workflows/build.yml +++ b/{{cookiecutter.project_folder}}/.github/workflows/build.yml @@ -18,7 +18,7 @@ jobs: python: ["3.10", "3.11", "3.12"] steps: - - uses: compas-dev/compas-actions.build@v4 + - uses: compas-dev/compas-actions.build@v5 with: python: ${{ '{{' }} matrix.python {{ '}}' }} invoke_lint: true diff --git a/{{cookiecutter.project_folder}}/.github/workflows/docs.yml b/{{cookiecutter.project_folder}}/.github/workflows/docs.yml index df8fbdc..1ac1657 100644 --- a/{{cookiecutter.project_folder}}/.github/workflows/docs.yml +++ b/{{cookiecutter.project_folder}}/.github/workflows/docs.yml @@ -14,6 +14,8 @@ jobs: docs: runs-on: ubuntu-latest steps: - - uses: compas-dev/compas-actions.docs@v4 + - uses: compas-dev/compas-actions.docs@v5.0.1 with: github_token: ${{ '{{' }} secrets.GITHUB_TOKEN {{ '}}' }} + generator: mkdocs + extras: dev diff --git a/{{cookiecutter.project_folder}}/.github/workflows/pr-checks.yml b/{{cookiecutter.project_folder}}/.github/workflows/pr-checks.yml index b1dffba..25878b5 100644 --- a/{{cookiecutter.project_folder}}/.github/workflows/pr-checks.yml +++ b/{{cookiecutter.project_folder}}/.github/workflows/pr-checks.yml @@ -11,9 +11,9 @@ jobs: name: Check Actions runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v6 - name: Changelog check - uses: Zomzog/changelog-checker@v1.2.0 + uses: Zomzog/changelog-checker@v1.3.0 with: fileName: CHANGELOG.md checkNotification: Simple diff --git a/{{cookiecutter.project_folder}}/.github/workflows/release.yml b/{{cookiecutter.project_folder}}/.github/workflows/release.yml index 6c35830..ed6ad1f 100644 --- a/{{cookiecutter.project_folder}}/.github/workflows/release.yml +++ b/{{cookiecutter.project_folder}}/.github/workflows/release.yml @@ -14,7 +14,7 @@ jobs: python: ['3.9', '3.10', '3.11'] steps: - - uses: compas-dev/compas-actions.build@v4 + - uses: compas-dev/compas-actions.build@v5 with: python: ${{ '{{' }} matrix.python {{ '}}' }} invoke_lint: true @@ -24,7 +24,7 @@ jobs: needs: build runs-on: ubuntu-latest steps: - - uses: compas-dev/compas-actions.publish@v3 + - uses: compas-dev/compas-actions.publish@v3.1.0 with: pypi_token: ${{ '{{' }} secrets.PYPI {{ '}}' }} github_token: ${{ '{{' }} secrets.GITHUB_TOKEN {{ '}}' }} diff --git a/{{cookiecutter.project_folder}}/docs/_images/PLACEHOLDER b/{{cookiecutter.project_folder}}/docs/_images/PLACEHOLDER deleted file mode 100644 index 48f73eb..0000000 --- a/{{cookiecutter.project_folder}}/docs/_images/PLACEHOLDER +++ /dev/null @@ -1 +0,0 @@ -# container for images to be included in the docs diff --git a/{{cookiecutter.project_folder}}/docs/_images/compas_logo_white_transparent.png b/{{cookiecutter.project_folder}}/docs/_images/compas_logo_white_transparent.png new file mode 100644 index 0000000..5dd158c Binary files /dev/null and b/{{cookiecutter.project_folder}}/docs/_images/compas_logo_white_transparent.png differ diff --git a/{{cookiecutter.project_folder}}/docs/api.rst b/{{cookiecutter.project_folder}}/docs/api.rst deleted file mode 100644 index 1cc0e4d..0000000 --- a/{{cookiecutter.project_folder}}/docs/api.rst +++ /dev/null @@ -1,8 +0,0 @@ -******************************************************************************** -API Reference -******************************************************************************** - -.. toctree:: - :maxdepth: 1 - - api/{{cookiecutter.project_slug}} diff --git a/{{cookiecutter.project_folder}}/docs/api/{{cookiecutter.project_slug}}.md b/{{cookiecutter.project_folder}}/docs/api/{{cookiecutter.project_slug}}.md new file mode 100644 index 0000000..563b755 --- /dev/null +++ b/{{cookiecutter.project_folder}}/docs/api/{{cookiecutter.project_slug}}.md @@ -0,0 +1 @@ +# ::: {{ cookiecutter.project_slug }} diff --git a/{{cookiecutter.project_folder}}/docs/api/{{cookiecutter.project_slug}}.rst b/{{cookiecutter.project_folder}}/docs/api/{{cookiecutter.project_slug}}.rst deleted file mode 100644 index 109fcbe..0000000 --- a/{{cookiecutter.project_folder}}/docs/api/{{cookiecutter.project_slug}}.rst +++ /dev/null @@ -1,9 +0,0 @@ -******************************************************************************** -{{cookiecutter.project_slug}} -******************************************************************************** - -.. currentmodule:: {{cookiecutter.project_slug}} - - -.. toctree:: - :maxdepth: 1 diff --git a/{{cookiecutter.project_folder}}/docs/assets/css/custom.css b/{{cookiecutter.project_folder}}/docs/assets/css/custom.css new file mode 100644 index 0000000..2b0551f --- /dev/null +++ b/{{cookiecutter.project_folder}}/docs/assets/css/custom.css @@ -0,0 +1,5 @@ +:root > * { + --md-primary-fg-color: #0092d2; + --md-primary-fg-color--light: #0092d2; + --md-primary-fg-color--dark: #0092d2; +} diff --git a/{{cookiecutter.project_folder}}/docs/conf.py b/{{cookiecutter.project_folder}}/docs/conf.py deleted file mode 100644 index c8ee6ff..0000000 --- a/{{cookiecutter.project_folder}}/docs/conf.py +++ /dev/null @@ -1,160 +0,0 @@ -# flake8: noqa -# -*- coding: utf-8 -*- - -from sphinx.writers import html, html5 -import sphinx_compas2_theme - -# -- General configuration ------------------------------------------------ - -project = "{{ cookiecutter.project_name }}" -copyright = "{{ cookiecutter.copyright }}" -author = "{{ cookiecutter.author_name }}" -package = "{{ cookiecutter.project_slug }}" -organization = "{{ cookiecutter.github_organization }}" - -master_doc = "index" -source_suffix = {".rst": "restructuredtext", ".md": "markdown"} -templates_path = sphinx_compas2_theme.get_autosummary_templates_path() -exclude_patterns = sphinx_compas2_theme.default_exclude_patterns -add_module_names = True -language = "en" - -latest_version = sphinx_compas2_theme.get_latest_version() - -if latest_version == "Unreleased": - release = "Unreleased" - version = "latest" -else: - release = latest_version - version = ".".join(release.split(".")[0:2]) # type: ignore - -# -- Extension configuration ------------------------------------------------ - -extensions = sphinx_compas2_theme.default_extensions -extensions.remove("sphinx.ext.linkcode") - -# numpydoc options - -numpydoc_show_class_members = False -numpydoc_class_members_toctree = False -numpydoc_attributes_as_param_list = True - -# bibtex options - -# autodoc options - -autodoc_type_aliases = {} - -autodoc_typehints = "description" -autodoc_typehints_format = "short" -autodoc_typehints_description_target = "documented" - -autodoc_mock_imports = sphinx_compas2_theme.default_mock_imports - -autodoc_default_options = { - "undoc-members": True, - "show-inheritance": True, -} - -autodoc_member_order = "groupwise" - -autoclass_content = "class" - - -def setup(app): - app.connect("autodoc-skip-member", sphinx_compas2_theme.skip) - - -# autosummary options - -autosummary_generate = True -autosummary_mock_imports = sphinx_compas2_theme.default_mock_imports - -# graph options - -# plot options - -# intersphinx options - -intersphinx_mapping = { - "python": ("https://docs.python.org/", None), - "compas": ("https://compas.dev/compas/latest/", None), -} - -# linkcode - -linkcode_resolve = sphinx_compas2_theme.get_linkcode_resolve(organization, package) - -# extlinks - -extlinks = {} - -# from pytorch - -sphinx_compas2_theme.replace(html.HTMLTranslator) -sphinx_compas2_theme.replace(html5.HTML5Translator) - -# -- Options for HTML output ---------------------------------------------- - -html_theme = "sidebaronly" -html_title = project - -favicons = [ - { - "rel": "icon", - "href": "compas.ico", - } -] - -html_theme_options = { - "icon_links": [ - { - "name": "GitHub", - "url": f"https://github.com/{organization}/{package}", - "icon": "fa-brands fa-github", - "type": "fontawesome", - }, - { - "name": "Discourse", - "url": "http://forum.compas-framework.org/", - "icon": "fa-brands fa-discourse", - "type": "fontawesome", - }, - { - "name": "PyPI", - "url": f"https://pypi.org/project/{package}/", - "icon": "fa-brands fa-python", - "type": "fontawesome", - }, - ], - "switcher": { - "json_url": f"https://raw.githubusercontent.com/{organization}/{package}/gh-pages/versions.json", - "version_match": version, - }, - "check_switcher": False, - "logo": { - "image_light": "_static/compas_icon_white.png", - "image_dark": "_static/compas_icon_white.png", - "text": project, - }, - "navigation_depth": 3, -} - - -html_context = { - "github_url": "https://github.com", - "github_user": organization, - "github_repo": package, - "github_version": "main", - "doc_path": "docs", -} - -html_static_path = sphinx_compas2_theme.get_html_static_path() + ["_static"] -html_css_files = [] -html_extra_path = [] -html_last_updated_fmt = "" -html_copy_source = False -html_show_sourcelink = True -html_permalinks = False -html_permalinks_icon = "" -html_compact_lists = True diff --git a/{{cookiecutter.project_folder}}/docs/examples.md b/{{cookiecutter.project_folder}}/docs/examples.md new file mode 100644 index 0000000..df635b4 --- /dev/null +++ b/{{cookiecutter.project_folder}}/docs/examples.md @@ -0,0 +1 @@ +# Examples diff --git a/{{cookiecutter.project_folder}}/docs/examples.rst b/{{cookiecutter.project_folder}}/docs/examples.rst deleted file mode 100644 index 49e8715..0000000 --- a/{{cookiecutter.project_folder}}/docs/examples.rst +++ /dev/null @@ -1,10 +0,0 @@ -******************************************************************************** -Examples -******************************************************************************** - -.. toctree:: - :maxdepth: 1 - :titlesonly: - :glob: - - examples/* diff --git a/{{cookiecutter.project_folder}}/docs/index.md b/{{cookiecutter.project_folder}}/docs/index.md new file mode 100644 index 0000000..3aa10d7 --- /dev/null +++ b/{{cookiecutter.project_folder}}/docs/index.md @@ -0,0 +1,17 @@ +# {{ cookiecutter.project_name }} + +{{ cookiecutter.project_short_description }} + +## Installation + +Stable releases can be installed from PyPI. + +```bash +pip install {{ cookiecutter.project_slug }} +``` + +## First Steps + +```python +import {{ cookiecutter.project_slug }} +``` diff --git a/{{cookiecutter.project_folder}}/docs/index.rst b/{{cookiecutter.project_folder}}/docs/index.rst deleted file mode 100644 index 35a683d..0000000 --- a/{{cookiecutter.project_folder}}/docs/index.rst +++ /dev/null @@ -1,33 +0,0 @@ -******************************************************************************** -{{cookiecutter.project_slug}} -******************************************************************************** - -.. rst-class:: lead - -{{cookiecutter.project_short_description}} - -.. .. figure:: /_images/ - :figclass: figure - :class: figure-img img-fluid - - -Table of Contents -================= - -.. toctree:: - :maxdepth: 3 - :titlesonly: - - Introduction - installation - tutorial - examples - api - license - - -Indices and tables -================== - -* :ref:`genindex` -* :ref:`modindex` diff --git a/{{cookiecutter.project_folder}}/docs/installation.md b/{{cookiecutter.project_folder}}/docs/installation.md new file mode 100644 index 0000000..e992f89 --- /dev/null +++ b/{{cookiecutter.project_folder}}/docs/installation.md @@ -0,0 +1,29 @@ +# Installation + +## Stable + +Stable releases are available on PyPI and can be installed with pip. + +```bash +pip install {{ cookiecutter.project_slug }} +``` + +## Latest + +The latest version can be installed from local source. + +```bash +git clone https://github.com/{{ cookiecutter.github_organization }}/{{ cookiecutter.project_slug }}.git +cd {{ cookiecutter.project_slug }} +pip install -e . +``` + +## Development + +To install `{{ cookiecutter.project_slug }}` for development, install from local source with the "dev" requirements. + +```bash +git clone https://github.com/{{ cookiecutter.github_organization }}/{{ cookiecutter.project_slug }}.git +cd {{ cookiecutter.project_slug }} +pip install -e .[dev] +``` diff --git a/{{cookiecutter.project_folder}}/docs/installation.rst b/{{cookiecutter.project_folder}}/docs/installation.rst deleted file mode 100644 index 29ffc82..0000000 --- a/{{cookiecutter.project_folder}}/docs/installation.rst +++ /dev/null @@ -1,36 +0,0 @@ -******************************************************************************** -Installation -******************************************************************************** - -Stable -====== - -Stable releases are available on PyPI and can be installed with pip. - -.. code-block:: bash - - pip install {{ cookiecutter.project_slug }} - - -Latest -====== - -The latest version can be installed from local source. - -.. code-block:: bash - - git clone https://github.com/{{ cookiecutter.github_organization }}/{{ cookiecutter.project_slug }}.git - cd compas_tna - pip install -e . - - -Development -=========== - -To install `{{ cookiecutter.project_slug }}` for development, install from local source with the "dev" requirements. - -.. code-block:: bash - - git clone https://github.com/{{ cookiecutter.github_organization }}/{{ cookiecutter.project_slug }}.git - cd compas_tna - pip install -e ".[dev]" diff --git a/{{cookiecutter.project_folder}}/docs/license.md b/{{cookiecutter.project_folder}}/docs/license.md new file mode 100644 index 0000000..0e8c6fc --- /dev/null +++ b/{{cookiecutter.project_folder}}/docs/license.md @@ -0,0 +1,3 @@ +# License + +--8<-- "LICENSE" diff --git a/{{cookiecutter.project_folder}}/docs/license.rst b/{{cookiecutter.project_folder}}/docs/license.rst deleted file mode 100644 index e6a80ce..0000000 --- a/{{cookiecutter.project_folder}}/docs/license.rst +++ /dev/null @@ -1,5 +0,0 @@ -******************************************************************************** -License -******************************************************************************** - -.. literalinclude:: ../LICENSE diff --git a/{{cookiecutter.project_folder}}/docs/tutorial.rst b/{{cookiecutter.project_folder}}/docs/tutorial.rst deleted file mode 100644 index 34e1184..0000000 --- a/{{cookiecutter.project_folder}}/docs/tutorial.rst +++ /dev/null @@ -1,3 +0,0 @@ -******************************************************************************** -Tutorial -******************************************************************************** diff --git a/{{cookiecutter.project_folder}}/mkdocs.yml b/{{cookiecutter.project_folder}}/mkdocs.yml new file mode 100644 index 0000000..0665ff0 --- /dev/null +++ b/{{cookiecutter.project_folder}}/mkdocs.yml @@ -0,0 +1,136 @@ +site_name: {{ cookiecutter.project_name }} +site_url: https://{{ cookiecutter.github_organization }}.github.io/{{ cookiecutter.project_slug }}/ + +repo_name: {{ cookiecutter.github_organization }} +repo_url: https://github.com/{{ cookiecutter.github_organization }}/{{ cookiecutter.project_slug }}/ + +copyright: Copyright © {{ cookiecutter.copyright }} + +extra: + homepage: https://{{ cookiecutter.github_organization }}.github.io/{{ cookiecutter.project_slug }}/ + version: + provider: mike + +theme: + name: material + palette: + # Palette toggle for light mode + - scheme: default + primary: indigo + accent: indigo + toggle: + icon: material/brightness-7 + name: Switch to dark mode + + # Palette toggle for dark mode + - scheme: slate + primary: indigo + accent: indigo + toggle: + icon: material/brightness-4 + name: Switch to light mode + font: + text: Roboto + code: Roboto Mono + logo: _images/compas_logo_white_transparent.png + favicon: _images/compas_logo_white_transparent.png + features: + - content.code.copy + - content.footnote.tooltips + - navigation.expand + - navigation.footer + - navigation.indexes + - navigation.sections + - navigation.top + - search.highlight + - search.suggest + - toc.follow + +extra_css: + - assets/css/custom.css + +markdown_extensions: + - abbr + - attr_list + - admonition + - footnotes + - md_in_html + - pymdownx.caret + - pymdownx.emoji: + emoji_index: !!python/name:material.extensions.emoji.twemoji + emoji_generator: !!python/name:material.extensions.emoji.to_svg + - pymdownx.keys + - pymdownx.mark + - pymdownx.tasklist: + custom_checkbox: true + - pymdownx.tilde + - pymdownx.highlight: + anchor_linenums: true + line_spans: __span + pygments_lang_class: true + - pymdownx.inlinehilite + - pymdownx.snippets: + check_paths: true + - pymdownx.superfences + - toc: + permalink: "ยค" + +plugins: + - search + - mkdocstrings: + default_handler: python + handlers: + python: + paths: [src] + inventories: + - https://docs.python.org/3/objects.inv + - https://compas.dev/compas/latest/objects.inv + options: + allow_inspection: true + backlinks: tree + docstring_options: + ignore_init_summary: true + trim_doctest_flags: true + docstring_style: numpy + docstring_section_style: list + filters: public + group_by_category: true + heading_level: 1 + inherited_members: false + line_length: 88 + merge_init_into_class: true + modernize_annotations: true + parameter_headings: false + preload_modules: [mkdocstrings, compas] + relative_crossrefs: true + scoped_crossrefs: true + separate_signature: true + show_bases: false + show_category_heading: true + show_docstring_attributes: true + show_docstring_functions: true + show_docstring_modules: false + show_if_no_docstring: false + show_inheritance_diagram: false + show_root_heading: true + show_root_full_path: true + show_signature: true + show_signature_annotations: true + show_signature_type_parameters: true + show_source: false + show_submodules: false + show_symbol_type_heading: true + show_symbol_type_toc: true + signature_crossrefs: true + summary: + modules: false + type_parameter_headings: true + unwrap_annotated: true + +nav: + - Home: index.md + - Installation: installation.md + - Examples: examples.md + - API Reference: + - {{ cookiecutter.project_slug }}: api/{{ cookiecutter.project_slug }}.md + - License: license.md diff --git a/{{cookiecutter.project_folder}}/pyproject.toml b/{{cookiecutter.project_folder}}/pyproject.toml index 6fc97ab..64c5a55 100644 --- a/{{cookiecutter.project_folder}}/pyproject.toml +++ b/{{cookiecutter.project_folder}}/pyproject.toml @@ -66,7 +66,6 @@ python_files = ["test_*.py", "*_test.py", "test.py"] addopts = [ "-ra", "--strict-markers", - "--doctest-glob=*.rst", "--tb=short", "--import-mode=importlib", ] @@ -83,7 +82,7 @@ doctest_optionflags = [ # ============================================================================ [tool.bumpversion] -current_version = "0.1.0" +current_version = "0.0.0" message = "Bump version to {new_version}" commit = true tag = true diff --git a/{{cookiecutter.project_folder}}/requirements-dev.txt b/{{cookiecutter.project_folder}}/requirements-dev.txt index c03471d..f370adf 100644 --- a/{{cookiecutter.project_folder}}/requirements-dev.txt +++ b/{{cookiecutter.project_folder}}/requirements-dev.txt @@ -1,9 +1,9 @@ attrs >=17.4 build bump-my-version -compas_invocations2 +compas_invocations2[mkdocs] invoke >=0.14 ruff -sphinx_compas2_theme twine wheel +pytest \ No newline at end of file diff --git a/{{cookiecutter.project_folder}}/src/{{cookiecutter.project_slug}}/__init__.py b/{{cookiecutter.project_folder}}/src/{{cookiecutter.project_slug}}/__init__.py index 47aea8b..ff859bb 100644 --- a/{{cookiecutter.project_folder}}/src/{{cookiecutter.project_slug}}/__init__.py +++ b/{{cookiecutter.project_folder}}/src/{{cookiecutter.project_slug}}/__init__.py @@ -2,4 +2,4 @@ __copyright__ = "{{cookiecutter.copyright}}" __license__ = "MIT License" __email__ = "{{cookiecutter.author_email}}" -__version__ = "0.1.0" +__version__ = "0.0.0" diff --git a/{{cookiecutter.project_folder}}/tasks.py b/{{cookiecutter.project_folder}}/tasks.py index ddabbf4..8e42d0b 100644 --- a/{{cookiecutter.project_folder}}/tasks.py +++ b/{{cookiecutter.project_folder}}/tasks.py @@ -1,33 +1,25 @@ import os from compas_invocations2 import build -from compas_invocations2 import docs +from compas_invocations2 import mkdocs from compas_invocations2 import style from compas_invocations2 import tests from invoke.collection import Collection ns = Collection( - docs.help, style.check, style.lint, style.format, - docs.docs, - docs.linkcheck, + mkdocs.docs, tests.test, tests.testdocs, tests.testcodeblocks, build.prepare_changelog, build.clean, build.release, - build.build_ghuser_components, ) ns.configure( { "base_folder": os.path.dirname(__file__), - "ghuser": { - "source_dir": "src/{{ cookiecutter.project_slug }}_ghpython/components", - "target_dir": "src/{{ cookiecutter.project_slug }}_ghpython/components/ghuser", - "prefix": "{{ cookiecutter.project_slug }}: ", - }, } )