Conversation
… operators This cleans up the codebase a bit and means the JSON schema and OpenAPI models don't overlap and rename themselves through pydantic.
…ackage metadata The package metadata object can now be loaded with the manifest, readme and license inside of the tgz file used to package recipes and operators. This primite can then be re-used by other queenbee clients to make sense of packages (be it locally or from pollination for example).
When package is fetched using the `latest` tag from a repository Queenbee will look for the package with the mosted recent `created` date fix pollination#140
This metadata should help make native Queenbee primitives re-usable accross multiple UIs when searching through indices and packages. close pollination#141
Users can now add repositories to their queenbee config to make packages searchable through the CLI.
Removing use of two different words that mean the same thing. The folder that contains an index file + queenbee packages is called a "repository" not a "registry"
3b6b9a2 to
b3ce1aa
Compare
|
I have copy/pasted an excerpt from the documentation I have added to explain repository management and package fetching using the CLI. This should help @MingboPeng and @chriswmackey get a better idea of what's going on without reading through the PEP8 hell hole that is my code 😄 Manage RepositoriesIn order to make use of Queenbee packages on you local machine you must manage The Queenbee CLI can be used to Local Index ManagementThis sections walks through the basic management commands.
> queenbee repo add ladybug https://api.pollination.cloud/registries/ladybug-tools
> queenbee repo add local-repo path/to/local-queenbee-repo
> queenbee repo list
[
{
"name": "local-repo",
"description": "A Queenbee package repository",
"source": "file:C:\path\to\local-queenbee-repo",
"operator_count": 1,
"recipe_count": 0
},
{
"name": "ladybug",
"description": "The official Ladybug-Tools Queenbee repository",
"source": "https://api.pollination.cloud/registries/ladybug-tools",
"operator_count": 3,
"recipe_count": 8
}
]
> queenbee repo search -s energy-plus
[
{
"name": "honeybee-energy",
"tag": "0.1.0",
"app_version": "1.57.1",
"keywords": [
"ladybug-tools",
"honeybee",
"energy-plus",
"openstudio",
"energy"
],
"maintainers": null,
"home": "https://app.pollination.cloud/operators/ladybug-tools/honeybee-energy",
"sources": [
"https://github.com/ladybug-tools/honeybee-energy"
],
"icon": "https://www.ladybug.tools/assets/img/logo.png",
"deprecated": null,
"description": "An operator to run energyplus using Honeybee and OpenStudio",
"url": "operator/honeybee-energy/36dec1c7b2c169f62ae08d64f6cac6de4b3c192320ed10a0f8283a3be03aa4af",
"created": "2020-06-30T11:07:15.744710",
"digest": "36dec1c7b2c169f62ae08d64f6cac6de4b3c192320ed10a0f8283a3be03aa4af",
"slug": "ladybug/honeybee-energy",
"type": "operator"
},
{
"name": "annual-energy-use",
"tag": "0.2.3",
"app_version": null,
"keywords": [
"ladybug-tools",
"energy-plus",
"openstudio",
"energy",
"default"
],
"maintainers": [
{
"name": "chris",
"email": "chris@ladybug.tools"
}
],
"home": null,
"sources": null,
"icon": "https://raw.githubusercontent.com/ladybug-tools/artwork/master/icons_components/honeybee/png/toidf.png",
"deprecated": null,
"description": "Run an annual energy simulation with default simulation parameters for reporting energy use",
"url": "recipe/annual-energy-use/845b304acc1e1c45df6f6122e4b4955b97d610f3dc51b9e677fab664c6e91679",
"created": "2020-09-02T04:43:10.034394",
"digest": "845b304acc1e1c45df6f6122e4b4955b97d610f3dc51b9e677fab664c6e91679",
"slug": "ladybug/annual-energy-use",
"type": "recipe"
},
{
"name": "energy-plus",
"tag": "0.1.0",
"app_version": "9.0.1",
"keywords": [
"energyplus"
],
"maintainers": null,
"home": "https://energyplus.net",
"sources": [
"https://github.com/nrel/energyplus"
],
"icon": "https://energyplus.net/sites/default/files/eplus_logo.png",
"deprecated": null,
"description": "An operator to run EnergyPlus functions",
"url": "operators/energy-plus-0.1.0.tgz",
"created": "2020-05-19T07:42:20.496003",
"digest": "bff20aae42e62aa084f0f08bf3833674e2bfccd0c6309f65848f089f402716f5",
"slug": "local-repo/energy-plus",
"type": "operator"
}
]
NoteUsing the "latest" tag automatically fetches the most recent version of a given package. > queenbee repo get recipe ladybug daylight-factor latest
{
"name": "daylight-factor",
"tag": "0.3.4",
"app_version": null,
"keywords": [
"ladybug-tools",
"radiance"
],
"maintainers": [
{
"name": "mostapha",
"email": "mostapha@ladybug.tools"
}
],
"home": null,
"sources": null,
"icon": "https://raw.githubusercontent.com/ladybug-tools/artwork/master/icons_components/honeybee/png/dfrecipe.png",
"deprecated": null,
"description": "Run daylight factor for a single model.",
"license": "",
"url": "daylight-factor-latest.tgz",
"created": "2020-09-16T20:56:00.628852",
"digest": "daa96cfcc530e12615af362fafe135c8f2af8b45906bfb1d9f223d5764d269a4",
"slug": "ladybug/daylight-factor",
"type": "recipe",
"readme": "",
"manifest": {
"metatada": {},
"dependencies": [],
"flow": [{
"name": "main",
"inputs": [],
"tasks": [],
"outputs": []
}]
}
} |
|
@cdriesler I'm tagging you here as I can't add you as a reviewer on this PR yet. |
|
@cdriesler still has to accept his invitation to the ladybug-tools/pollination team. Then, we should be able to add him as a reviewer. |
|
done! ty both |
chriswmackey
left a comment
There was a problem hiding this comment.
It generally looks good. My only major feedback is that you should add some more tests before we merge.
| @click.command('add') | ||
| @click.argument('name') | ||
| @click.argument('path') | ||
| @click.option('-f', '--force', help='Boolean toggle to overwrite existing repository with same name', default=False, type=bool, is_flag=True) |
There was a problem hiding this comment.
PEP8 👮 says "The speed limit is 89 characters per line."
There was a problem hiding this comment.
Yep... I'm counting on running a big autopep8 lint on this. Was wanting to let you guys read through it first so the linting changes don't make the PR changes unmanageable 🙃
mostaphaRoudsari
left a comment
There was a problem hiding this comment.
@AntoineDao, thanks! Looks good to me. Let's merge this in and try to update the local repository for the recipes for the plugins as the real testing process. 😁
|
|
||
| return v | ||
|
|
||
| def fetch(self, auth_header: str = '') -> 'RepositoryIndex': |
There was a problem hiding this comment.
I'm unfamiliar with this arrow notation. It looks like it's a type annotation?
Is there a difference between 'returning' a string here and a reference to the actual type? You consistently do strings, and the document says that would have to be interpreted by a third party library, so I'm assuming not. Figured it's still worth learning/confirming here.
There was a problem hiding this comment.
Yep this is type annotations introduced in PEP 484.
You normally would us a class directly rather than a string indeed but in this case I use a string because importing the class in question would either lead to recursive imports or because this is a classmethod (and therefore the class isn't fully declared yet within the scope of this type declaration).
cdriesler
left a comment
There was a problem hiding this comment.
Unhelpful review from me here: all looks well, as far as I understand it. I appreciate the chance to get a closer look, though.
Just left one clarification question on something new I came across.
|
🎉 This PR is included in version 1.17.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
This PR aims to enhance the existing
repositoryprimitives in Queenbee so they can be used byqueenbee-luigi,queenbee-argo,pollination-serverand other client libraries to manage, find and use Queenbee packages (ie: recipes and operators).