stapi-spec / stapi-fastapi

Spatio Temporal Asset Tasking with FastAPI
MIT License
12 stars 4 forks source link

Proposal: separate stapi-fastapi and implementations into individual packages #72

Closed jkeifer closed 1 month ago

jkeifer commented 1 month ago

I was trying to manually test with the TLE backend but couldn't get passed the error Value error, not a valid backend [type=value_error, input_value='stapi_fastapi_tle_backend:StapiMockBackend', input_type=str]. It is unclear to me how anything from the stapi_fastapi_tle_backend package would be available given that it is not installable, i.e., it lacks a pyproject.toml.

In a similar vein, I don't understand how the Landsat backend does work. It seems not installable, but for whatever reason it does seem to be importable in stapi_fastapi.__dev__.

I'd propose restructuring this repo to embrace it as a monorepo of three different packages: stapi-fastapi, stapi-fastapi-landsat, stapi-fastapi-tle-backend. Each of these would be isolated into subdirectories with their own pyproject.toml, allowing each of them to be installed together or independently.

The stapi-fastapi-test-backend appears to be a test-specific implementation for stapi-fastapi testing, and as such I would move its implementation into the tests package for stapi-fastapi.

In the future (hopefully near) when we are ready to release this project to pypi, just the stapi-fastapi package would be built and released. The others would remain accessible via this repo for users that want to use them as examples or for testing.

Maybe if I could figure out how the Landsat backed does work and could get the TLE backend functional then my ideas would be less relevant, but I still think the proposed organization would be cleaner and more straightforward.

I'd be happy to put together a PR for this reorganization if there's appetite for such a change.

c-wygoda commented 1 month ago

Very much in favour of this!

jkeifer commented 1 month ago

I started down this path, but I found more complications than I was expecting. Between scripts, poetry commands, and all the docker/lambda/deployment stuff there's a lot to untangle beyond just moving things around and adding some pyproject.toml files.

As a result I'm not sure when I will be able to get a PR pulled together for this change, but it seems like it would be good to do before setting up package builds to pypi. Hopefully we can get this all straightened out at or shortly after the upcoming STAPI sprint as I'd really like to get this up on pypi as soon as we can implement the spec changes that are sure to come out of sprint.

@c-wygoda Can you confirm that it is your intent to split the TLE backend out into it's own example project in a separate repo, thus it could be completely removed from this one?

c-wygoda commented 1 month ago

Totally! To be fair, we can do this now:

jkeifer commented 1 month ago

Closed by #79.