Skip to content
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

move bundle config to JSON format #126

Merged
merged 4 commits into from
Sep 8, 2021

Conversation

askpatrickw
Copy link
Contributor

@askpatrickw askpatrickw commented Sep 7, 2021

Fixes #125

  1. This moves the configuration of bundles to a JSON file: bundle_config.json which is added to the setup.py data_files. It is assumed to be in sys.prefix.
  2. Fixes a test which was verifying the use of the old method, by using a test_bundle_config.json
  3. Changes test_bundle_name to use the test_bundle_config.json value
  4. Running the tests didn't work with the first way I was including the config file. I change circup to a package layout, installed it as as package and included the config as package data to fix this and the tests.

@askpatrickw
Copy link
Contributor Author

Looking at the failures... they initially passed on my end. But I can reproduce the failure now.

@askpatrickw
Copy link
Contributor Author

Comment 4 on the description describes how I fixed the tests. Not sure its the best way. But worked.

@askpatrickw askpatrickw requested a review from a team September 7, 2021 01:43
@askpatrickw
Copy link
Contributor Author

We should rev the major version number if we merge this. It might be a breaking change for anyone using the circup.py file name directly.

Copy link
Member

@jepler jepler left a comment

Choose a reason for hiding this comment

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

Makes sense but didn't test.

@jepler
Copy link
Member

jepler commented Sep 7, 2021

As an improvement, consider using https://pypi.org/project/appdirs/ so that you can look for the config json file first in the user's configuration directory and then to the default list shipped in the package.

@ladyada
Copy link
Member

ladyada commented Sep 7, 2021

fyi @tannewt @jwcooper

@askpatrickw
Copy link
Contributor Author

@jepler Good idea... Do you see that overriding the default or supplementing the default?

@Neradoc
Copy link
Contributor

Neradoc commented Sep 7, 2021

My idea for supporting 3rd party bundles was to have new commands (bundle-add, bundle-remove, bundle-info) that manage a separate list, while the default bundles would always remain. But the ability to override the default list, to maybe disable built-in ones, or change the order (to have a 3rd party neopixel implementation override the adafruit one for example) seems a possibly useful idea. Maybe adding also a bundle-reset command to reset the list to the default one.

@jepler
Copy link
Member

jepler commented Sep 7, 2021

Probably supplementing the regular list.. (figuring it out silent block this PR from being merged)

@askpatrickw
Copy link
Contributor Author

We could merge this as-is and then work out the design for these other ideas in a new issue.
They're much larger than the original ask.

@askpatrickw
Copy link
Contributor Author

I opened an issue on the 3rd Party Bundle Support - 127. So we can move this PR along.

@askpatrickw askpatrickw merged commit d467d25 into adafruit:main Sep 8, 2021
@askpatrickw askpatrickw deleted the bundles-json branch September 8, 2021 23:07
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.

list bundle urls in json rather than in code
4 participants