-
Notifications
You must be signed in to change notification settings - Fork 428
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
Added load_file_data and load_str_data as functions available in meta.yaml #4480
Conversation
7efe256
to
267b394
Compare
@kenodegard Is there any estimated time frame for the 3.22 release? |
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.
Made some minor suggestions, otherwise LGTM! 👍
Also added documentation to describe these as well as the existing functions Added news entry Added conda-build-testing to gitignore Added API tests
Co-authored-by: Bianca Henderson <beeankha@gmail.com>
@bryevdv We are working to define a release cadence for conda and conda-build (see conda/ceps#26) but I'd expect to see the next release in 1-2 months. |
Hello there 👋 That's a wonderful feature! I stumbled across it in the documentation and tried to use. The loading of the I see that you intend on making regular releases, any plan to make a conda-build release soon? :) 🙏 |
I'd also be glad, if this nice feature could make it to a release soon 👍 @frgfm I agree, that the documentation should point to "stable" instead of latest. It happened to me in the past as well. Discovered a bleeding edge feature in the main branch docs and tried it without success. But that's for another issue, right? |
Continuation of #4465
Credits go to @abrahammurciano
Up until PEPs 517 and 518, the setup.py file was the standard way to declare project metatada. That made the function load_setup_py_data an excellent tool for many projects to avoid repetition of metadata in the meta.yaml file.
No longer. With the introduction of the aforementioned PEPs, metadata can be declared in many different ways. Many (if not most) of these use the pyproject.toml file to store their configurations. A notable example of this is poetry.
Instead of trying to accommodate for each and every tool, I have introduced the function load_file_data which is capable of loading (and parsing) certain common serialisation languages (specifically JSON, TOML, and YAML, but can be easily extended (though that would require changing the source code)). The rationale behind this is that the user can just parse whichever file contains their metadata and structure their meta.yaml to use whichever other tools they use without conda-build having to specifically support it.
As an added bonus, I also added a function which is capable of doing the same but reading from a string instead of from a file, so that users can pass JSON (or any other supported language) via environment variables.
Additionally, I have expounded on the bare documentation of load_setup_py_data, added documentation for the previously undocumented load_file_regex, and added documentation for the two functions I added.
Closes #4207
Related: python-poetry/poetry#3738 (comment)
Possibly related? #3507