Dictionary format of author in package.json not supported
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 24.4k
- Forks
- 2.3k
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 13
Description
This is a minor issue, but I discovered that package.json files (for custom Dash component projects) that uses author field on the more "json-native format"
{
"name" : "Barney Rubble",
"email" : "b@rubble.com",
"url" : "http://barnyrubble.tumblr.com/"
}
instead of
{
"author": "Barney Rubble <b@rubble.com> (http://barnyrubble.tumblr.com/)"
}
fails with
Traceback (most recent call last):
File "[...]/bin/dash-generate-components", line 11, in <module>
load_entry_point('dash==1.19.0', 'console_scripts', 'dash-generate-components')()
File "[...]/site-packages/dash/development/component_generator.py", line 213, in cli
jlprefix=args.jl_prefix,
File "[...]/site-packages/dash/development/component_generator.py", line 137, in generate_components
rsuggests,
File "[...]/site-packages/dash/development/_r_components_generation.py", line 777, in generate_exports
has_wildcards,
File "[...]/site-packages/dash/development/_r_components_generation.py", line 625, in generate_rpkg
package_author_name = package_author.split(" <")[0]
AttributeError: 'collections.OrderedDict' object has no attribute 'split'
Related minor thing is that e-mail is also optional from npm's package.json side, but required by https://github.com/plotly/dash/blob/e8ac94919105a91c76a966c21aca2ec7b0297e22/dash/development/_r_components_generation.py#L626
EDIT: Which by looking at the code I see might fail also if the author string includes homepage, due to [:-1] filtering only.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at dash/development/_r_components_generation.py, especially generate_rpkg and the dash-generate-components entry point shown in the traceback. Reproduce the failure with a package.json using the dictionary author form, then verify generation also handles the optional email or homepage fields without raising the reported error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100