Skip to content

Commit

Permalink
Update jinja templates (tektronix#254)
Browse files Browse the repository at this point in the history
* docs: Update Jinja templates to use the `is_public` attribute provided by `griffe` instead of the deprecated `is_public()` method

* ci: Update poetry settings

* ci: Convert toml-sort to an actual pre-commit hook, not a local hook
  • Loading branch information
nfelt14 authored Jul 25, 2024
1 parent 4485fae commit 7786236
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 14 deletions.
11 changes: 4 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ ci:
autoupdate_schedule: quarterly
skip:
- check-poetry
- toml-sort
- pylint
- pyright
- pyright-verifytypes
Expand Down Expand Up @@ -97,14 +96,12 @@ repos:
rev: v1.0.0
hooks:
- id: check-poetry
- repo: https://github.com/pappasam/toml-sort
rev: v0.23.1
hooks:
- id: toml-sort-fix
- repo: local
hooks:
- id: toml-sort
name: toml-sort
entry: toml-sort
language: system
types: [toml]
pass_filenames: true
- id: pylint
name: pylint
entry: pylint
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ Context:
{% endif %}
{% with heading_level = heading_level + extra_level %}
{% for attribute in attributes|order_members(config.members_order, members_list) %}
{% if members_list is not none or attribute.is_public(check_name=False) %}
{% if members_list is not none or attribute.is_public %}
{% include attribute|get_template with context %}
{% endif %}
{% endfor %}
Expand All @@ -147,7 +147,7 @@ Context:
{% endif %}
{% with heading_level = heading_level + extra_level %}
{% for class in classes|order_members(config.members_order, members_list) %}
{% if members_list is not none or class.is_public(check_name=False) %}
{% if members_list is not none or class.is_public %}
{% include class|get_template with context %}
{% endif %}
{% endfor %}
Expand All @@ -168,7 +168,7 @@ Context:
{% with heading_level = heading_level + extra_level %}
{% for function in functions|order_members(config.members_order, members_list) %}
{% if not (obj.kind.value == "class" and function.name == "__init__" and config.merge_init_into_class) %}
{% if members_list is not none or function.is_public(check_name=False) %}
{% if members_list is not none or function.is_public %}
{% include function|get_template with context %}
{% endif %}
{% endif %}
Expand All @@ -190,7 +190,7 @@ Context:
{% endif %}
{% with heading_level = heading_level + extra_level %}
{% for module in modules|order_members(config.members_order, members_list) %}
{% if members_list is not none or module.is_public(check_name=False) %}
{% if members_list is not none or module.is_public %}
{% include module|get_template with context %}
{% endif %}
{% endfor %}
Expand All @@ -214,7 +214,7 @@ Context:

{% if not (obj.is_class and child.name == "__init__" and config.merge_init_into_class) %}

{% if members_list is not none or child.is_public(check_name=False) %}
{% if members_list is not none or child.is_public %}
{% if child.is_attribute %}
{% with attribute = child %}
{% include attribute|get_template with context %}
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[build-system]
build-backend = "poetry.core.masonry.api"
requires = ["poetry-core>=1.0.0"]
requires = ["poetry-core>=1.9.0"]

[tool]

Expand Down Expand Up @@ -93,7 +93,7 @@ zeroconf = "^0.132.2"

[tool.poetry.group.dev.dependencies]
docformatter = {extras = ["tomli"], version = "1.7.5"}
docutils = "^0.20"
docutils = "^0.20" # TODO: remove this when the minimum Python version is >=3.9
docutils-stubs = "^0.0.22"
matplotlib = [
{python = ">=3.9", version = "^3.8"},
Expand Down

0 comments on commit 7786236

Please sign in to comment.