Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions documentation/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ The library has detailed API documentation which can be found in the menu at the


## Breaking Changes
From 6.4.5, fix for changes in dependency defopt 7.0.0

From 6.2.8, fix mark_data_updated which was broken due to an error in
dataset_update_filestore_resource in which timezone information was
incorrectly added to the iso formatted string
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ requires-python = ">=3.8"

dependencies = [
"ckanapi>=4.8",
"defopt>=6.4.0",
"defopt>=7.0.0",
"email_validator",
"hdx-python-country>=3.9.4",
"hdx-python-utilities>=3.8.7",
Expand Down
33 changes: 18 additions & 15 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ backrefs==5.8
# via mkdocs-material
cachetools==5.5.2
# via google-auth
certifi==2025.4.26
certifi==2025.6.15
# via requests
cfgv==3.4.0
# via pre-commit
Expand All @@ -32,9 +32,9 @@ click==8.2.1
# typer
colorama==0.4.6
# via mkdocs-material
coverage==7.8.2
coverage==7.9.1
# via pytest-cov
defopt==6.4.0
defopt==7.0.0
# via hdx-python-api (pyproject.toml)
distlib==0.3.9
# via virtualenv
Expand All @@ -56,7 +56,7 @@ frictionless==5.18.1
# via hdx-python-utilities
ghp-import==2.1.0
# via mkdocs
google-auth==2.40.2
google-auth==2.40.3
# via
# google-auth-oauthlib
# gspread
Expand Down Expand Up @@ -117,7 +117,7 @@ markdown==3.8
# pymdown-extensions
markdown-it-py==3.0.0
# via rich
marko==2.1.3
marko==2.1.4
# via frictionless
markupsafe==3.0.2
# via
Expand Down Expand Up @@ -166,7 +166,9 @@ platformdirs==4.3.8
# mkdocs-get-deps
# virtualenv
pluggy==1.6.0
# via pytest
# via
# pytest
# pytest-cov
ply==3.11
# via
# jsonpath-ng
Expand All @@ -181,26 +183,27 @@ pyasn1==0.6.1
# rsa
pyasn1-modules==0.4.2
# via google-auth
pydantic==2.11.5
pydantic==2.11.7
# via frictionless
pydantic-core==2.33.2
# via pydantic
pygments==2.19.1
# via
# mkdocs-material
# pytest
# rich
pymdown-extensions==10.15
# via mkdocs-material
pyphonetics==0.5.3
# via hdx-python-utilities
pytest==8.3.5
pytest==8.4.0
# via
# hdx-python-api (pyproject.toml)
# pytest-check
# pytest-cov
pytest-check==2.5.3
# via hdx-python-api (pyproject.toml)
pytest-cov==6.1.1
pytest-cov==6.2.1
# via hdx-python-api (pyproject.toml)
python-dateutil==2.9.0.post0
# via
Expand Down Expand Up @@ -233,7 +236,7 @@ referencing==0.36.2
# via
# jsonschema
# jsonschema-specifications
requests==2.32.3
requests==2.32.4
# via
# hdx-python-api (pyproject.toml)
# ckanapi
Expand All @@ -256,7 +259,7 @@ rpds-py==0.25.1
# referencing
rsa==4.9.1
# via google-auth
ruamel-yaml==0.18.11
ruamel-yaml==0.18.14
# via hdx-python-utilities
ruamel-yaml-clib==0.2.12
# via ruamel-yaml
Expand All @@ -276,7 +279,7 @@ six==1.17.0
# sphinxcontrib-napoleon
sphinxcontrib-napoleon==0.7
# via defopt
structlog==25.3.0
structlog==25.4.0
# via libhxl
tableschema-to-template==0.0.13
# via hdx-python-utilities
Expand All @@ -286,11 +289,11 @@ tenacity==9.1.2
# via hdx-python-country
text-unidecode==1.3
# via python-slugify
typeguard==4.4.2
typeguard==4.4.3
# via inflect
typer==0.16.0
# via frictionless
typing-extensions==4.13.2
typing-extensions==4.14.0
# via
# frictionless
# pydantic
Expand All @@ -316,7 +319,7 @@ watchdog==6.0.0
# via mkdocs
wheel==0.45.1
# via libhxl
xlrd==2.0.1
xlrd==2.0.2
# via hdx-python-utilities
xlrd3==1.1.0
# via libhxl
Expand Down
20 changes: 11 additions & 9 deletions src/hdx/facades/infer_arguments.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,12 @@ def facade(projectmainfn: Callable[[Any], None], **kwargs: Any):
#

parsed_main_doc = defopt._parse_docstring(getdoc(projectmainfn))
main_doc = [f"{parsed_main_doc.first_line}\n\nArgs:"]
no_main_params = len(parsed_main_doc.params)
for param_name, param_info in parsed_main_doc.params.items():
main_doc.append(f"\n {param_name} ({param_info.type}): {param_info.text}")
main_doc = [f"{parsed_main_doc.doc}\n\nArgs:"]
no_main_parameters = len(parsed_main_doc.parameters)
for param_name, param_info in parsed_main_doc.parameters.items():
main_doc.append(
f"\n {param_name} ({param_info.annotation}): {param_info.doc}"
)
create_config_doc = getdoc(Configuration.create)
kwargs_index = create_config_doc.index("**kwargs")
kwargs_index = create_config_doc.index("\n", kwargs_index)
Expand All @@ -54,13 +56,13 @@ def facade(projectmainfn: Callable[[Any], None], **kwargs: Any):
param_names.append(str(param))

parsed_main_doc = defopt._parse_docstring(main_doc)
main_doc = [f"{parsed_main_doc.first_line}\n\nArgs:"]
main_doc = [f"{parsed_main_doc.doc}Args:"]
count = 0
for param_name, param_info in parsed_main_doc.params.items():
param_type = param_info.type
for param_name, param_info in parsed_main_doc.parameters.items():
param_type = param_info.annotation
if param_type == "dict":
continue
if count < no_main_params:
if count < no_main_parameters:
count += 1
else:
if param_type == "str":
Expand All @@ -73,7 +75,7 @@ def facade(projectmainfn: Callable[[Any], None], **kwargs: Any):
"Configuration.create has new parameter with unknown type!"
)
param_names.append(f"{param_name}: {param_type} = {default}")
main_doc.append(f"\n {param_name} ({param_type}): {param_info.text}")
main_doc.append(f"\n {param_name} ({param_type}): {param_info.doc}")
main_doc = "".join(main_doc)

projectmainname = projectmainfn.__name__
Expand Down
Loading