-
Notifications
You must be signed in to change notification settings - Fork 18
Adds the description from pyproject.toml to bundle #131
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adds the description from pyproject.toml to bundle #131
Conversation
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") |
There was a problem hiding this comment.
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="") |
There was a problem hiding this comment.
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"] |
There was a problem hiding this comment.
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.
|
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 |
There was a problem hiding this comment.
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>
|
It's not merged yet, but I've got a build that works locally. |
tannewt
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
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.