Skip to content

Commit

Permalink
feat: ✨ make build_readme_text() and write_file() public (#1119)
Browse files Browse the repository at this point in the history
## Description

Seems we forgot to export these to be public functions.

<!-- Select quick/in-depth as necessary -->
This PR needs a quick review.

## Checklist

- [x] Updated documentation
- [x] Ran `just run-all`
  • Loading branch information
lwjohnst86 authored Mar 10, 2025
1 parent 45969db commit e827b13
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
2 changes: 2 additions & 0 deletions _quarto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ quartodoc:
contents:
- create_package_properties
- edit_package_properties
- build_readme_text

- subtitle: "Data resource functions"
desc: "Functions to work with and manage data resources found within a data package."
Expand Down Expand Up @@ -131,6 +132,7 @@ quartodoc:
package: "seedcase_sprout.core"
contents:
- example_package_properties
- write_file

metadata-files:
- docs/reference/_sidebar.yml
Expand Down
12 changes: 8 additions & 4 deletions src/seedcase_sprout/core/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,17 @@
# Packages -----
# from .delete_package import *
# Resources -----
# from .delete_resource_raw_file import *
# from .delete_resource_data import *
# from .delete_resource_properties import *

from .build_readme_text import build_readme_text
from .create_package_properties import create_package_properties
from .create_resource_properties import create_resource_properties
from .create_resource_structure import create_resource_structure
from .edit_package_properties import edit_package_properties
from .example_package_properties import example_package_properties

# from .delete_resource_raw_file import *
# from .delete_resource_data import *
# from .delete_resource_properties import *
# Path -----
# TODO: Consider having all these in one module.
from .path_package_functions import (
path_package,
Expand Down Expand Up @@ -46,6 +47,7 @@
from .sprout_checks.check_package_properties import check_package_properties
from .sprout_checks.check_properties import check_properties
from .sprout_checks.check_resource_properties import check_resource_properties
from .write_file import write_file
from .write_package_properties import write_package_properties

# from .extract_resource_properties import *
Expand Down Expand Up @@ -76,6 +78,7 @@
"create_package_properties",
"edit_package_properties",
"write_package_properties",
"build_readme_text",
# "delete_package",
# Resources -----
"create_resource_structure",
Expand All @@ -101,6 +104,7 @@
"path_sprout_global",
# Helpers -----
# "pretty_json",
"write_file",
# Checks -----
"check_package_properties",
"check_properties",
Expand Down
8 changes: 6 additions & 2 deletions src/seedcase_sprout/core/build_readme_text.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,15 @@
def build_readme_text(properties: PackageProperties) -> str:
"""Creates a string containing the README text.
Using a template, this will build a README file with the contents of the
properties object in a human-readable format. Use `write_file()` to save
the text to the `README.md` file.
Args:
properties: An object containing the package and resource properties.
properties: An object containing the package and resource properties.
Returns:
A string with the README text based on the properties.
A string with the README text based on the properties.
"""
env = Environment(loader=FileSystemLoader(TEMPLATES_PATH))
env.filters["join_names"] = join_names
Expand Down

0 comments on commit e827b13

Please sign in to comment.