Skip to content

Conversation

@ericzundel
Copy link
Contributor

Adds the description field from the pypi pyproject.toml metadata to the bundle's json description for each library. If the description is not present, the field will be populated with the empty string.

Adds the description field from the pypi pyproject.toml metadata to the
bundle's json description for each library.  If the description is not
present, the field will be populated with the empty string.
def _git_version():
version_str = subprocess.check_output(["git", "--version"], encoding="ascii", errors="replace")
def _git_version():
version_str = subprocess.check_output(["git", "--version"], encoding="ascii", errors="replace")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No substantive changes, my editor just clobbered all trailing whitespace

pyproject_toml = load_pyproject_toml(lib_path)
py_modules = get_nested(pyproject_toml, "tool", "setuptools", "py-modules", default=[])
packages = get_nested(pyproject_toml, "tool", "setuptools", "packages", default=[])
package_info["description"] = get_nested(pyproject_toml, "project", "description", default="")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note, ChatGPT review suggested that we fallback to tool.setuptools.description if this is not present. The only library I found with no description under project was Adafruit JSON Stream with the description explicitly set blank, and nothing under tool.setuptools.description

package["version"] = package_info["version"]
package["path"] = "lib/" + package_info["module_name"]
package["library_path"] = library_path
package["pypi_description"] = package_info["description"]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I chose the name 'pypi_description' for this field to follow the precedent set by the 'pipy_name' field.

@ericzundel
Copy link
Contributor Author

Addresses issue #130 FYI @urfdvw

@urfdvw
Copy link

urfdvw commented Oct 16, 2025

@ericzundel

Cool!

Will do experiments and add to circuitpy.dev.

source .env/bin/activate
pip install -e . # '-e' is pip's "development" install feature
circuitpython-build-bundles --filename_prefix <output file prefix> --library_location <library location>
circuitpython-build-bundles --filename_prefix <output file prefix> --library_location <library location> --library_depth 2
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated this from the Adafruit_CircuitPython_Bundle README after some trial and error.

There is another problem I ran into when testing my changes. The circuitpython-build-bundles script assumes that it can find a README file in the current working directory, so one more instruction that could be added here is cd <Adafruit_CircuitPython_Bundle checkout dir>

@ericzundel
Copy link
Contributor Author

It's not merged yet, but I've got a build that works locally.

Copy link
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@tannewt tannewt merged commit d39edb4 into adafruit:main Oct 16, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants