Origen-SDK / o2

MIT License
4 stars 0 forks source link

Invocations #191

Closed coreyeng closed 11 months ago

coreyeng commented 12 months ago

Hello,

This PR focuses on running Origen from various invocation contexts. The current tests assume a development environment, poetry being available, a pyproject, etc. and failure to meet that led to issues.

This PR remedies that and adds some elementary tests that setup Origen in the various invocation contexts. I highlight "elementary tests" though - basically just tries to eval some simple statements - but the frameworks are there and more coverage can be added later. They're a bit hacky in some places - I understand the hacks and why they're needed and left some notes with some TODOs to revisit, but I'm not exactly sure how to best clean up and I'd rather come at that from the "we have tests, let's make them less hacky" than "we have no tests".

The only one that irks me is a poetry/pip (not sure since Poetry uses pip) issue on Windows where a pyproject can't have local dependences on a drive different than the pyproject's. It's fine on Linux, but I don't have a good setup currently to look at this. It's also not new - only that it's just now being noticed from these tests. The workaround uses some hard-coded stuff though because I can't get GA to do what I need, despite what I see in the docs. Will keep looking at it but it’s a clean-up item. Ideally, the problem of pyproject dependencies on different Windows drives will be solved and this will be moot anyway.

Getting back to the invocations, the contexts I'm referring to are: 1) In-App: basically test_apps/python_app 2) Workspace: basically test_apps/no_python_app 3) User-Install: mirrors O1's user installations 4) Global-Install: mirrors O1's tool-repo installations 5) No Workspace: no pyproject and can't use poetry. Essentially the install you'd get if you just install the packages directly using pip.

origen.status will hold the type of invocation, the pyproject path (if applicable), and the CLI root. The first is an enum, defined here.

Plugins and command extensions are supported in each context.

Below is a summary of the major updates:

This is the another development piece I need for "origen as tool platform". Next pieces: