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

Version 0.2 - asyncio support. #235

Merged
merged 88 commits into from Aug 16, 2017

Conversation

Projects
None yet
4 participants
@tomchristie
Member

tomchristie commented Aug 1, 2017

Pretty serious re-working in progress here. For an overview you'll want to review the source code of the branch itself rather than attempting to review the diff.

Take a look in particular at interfaces.py and app.py. You'll see that the dependency injection has been completely reworked, and that overriding components on applications looks far neater.

The end result of this work is going to be the ability for API Star to support multiple types of application. asyncio is the obvious first target here, but I'd also like us to have Flask and Django variants. Having the ability to use their ORMs as we currently have is okay, but users still miss out on a vast amount of existing ecosystem.

Update: This branch now introduces asyncio support.

More work on this to come, but looking rather nice so far.

  • MultiDict for headers and queryparams.
  • Schema -> Components.
  • Finesse interface.py/types.py.
  • Finesse view names.
  • CLI support.
  • Component pre-loading.
  • Support defaults on params.
  • Include support.
  • Use Routes in preference to Router in components.
  • Reintroduce remaining commands, and apistar main cli.
  • Clean up response generation.
  • Coverage -> 100%
  • Simplify type->schema mapping.
  • Compile changelist.
  • Update docs.
  • Add asyncio docs.
  • Add Command docs.
  • Improve formatting of argparse commands.
  • Test API docs against 0.2
  • Finish remaining asyncio coverage.
  • Add run command for asyncio.
  • Case-insensitivity on headers.
  • Review typing.newtype() vs typing.integer(...) (Sticking with newtype for now)
  • Reintroduce ORM components.
  • Review statics/sendfile. Consider static docs generation.
  • pip install apistar[asyncio], and update apistar new --layout to apistar new --framework
  • Reintroduce test command, at least for now.
  • Inline typesystem declarations.
  • Review settings.
  • Finesse exception handling. 500 vs raise.
  • CORS handling in finalize_response.
  • Add backend testing docs for DB setup/teardown.
  • Support additional arguments in command line (eg. makemigrations)

Later:

  • Remove coreschema, move form rendering into API Star. Add render_form, render_link.
  • Asyncio support.
  • Flask support.
  • Django support.
  • Reintroduce ORM components.
  • Schema as a well-defined interface.
  • Consider moving away from global settings.
  • Make standalone usage of app.injector easier, eg. static_files = app.injector.run(StaticFiles), update corresponding test cases.
  • Better messages on injector configuration errors. (Use function and parameter name, not Parameter)
  • Coerce primitive types to typesystem types for the purposes of stricter behavior (eg. inf) and validation error messages.
  • Check for repeated list/dict in annotations, or list/dict on GET requests.
  • Support explicit location overrides on parameters.
  • Support form renderering list/dict type schemas fully, and schema output.
  • Support type aliases as parameter annotations. typing.List, typing.NewType etc...
  • Support defaults in params for HTTP.
  • Error details on 404. Consider removing "messages" and always error by key.
  • Finesse argparse support (use help/description generation for schemas too. support list/dict/enum)
  • Support async context managers.
  • Finesse Injector interface for sync/async, and raise error in sync case if coroutines are included.
  • Add logging to components throughout.

Changelist: See README.

Closes #29

@ssteinerx

This comment has been minimized.

ssteinerx commented Aug 1, 2017

@tomchristie Anything in here or the issue tracker that you'd specifically like help with?

@tomchristie

This comment has been minimized.

Member

tomchristie commented Aug 1, 2017

@ssteinerx - Thanks! No not especially, the remaining work on here needs my attention specifically, because it's all design stuff. Where contributions will start to come into their own is once this API gets nailed down and we get to a point that third party components are an easy thing for folks to work on.

tomchristie added some commits Aug 2, 2017

@tomchristie tomchristie merged commit d9639cf into master Aug 16, 2017

3 checks passed

codecov/project 100% (+0%) compared to b831d37
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@tomchristie tomchristie deleted the version-0.2 branch Aug 16, 2017

@audiolion

This comment has been minimized.

Contributor

audiolion commented Aug 16, 2017

HOOOORAY ITS HERE 🎉 🎉

@tomchristie

This comment has been minimized.

Member

tomchristie commented Aug 16, 2017

Few last things that I'd like to get sorted, but I'll defer them to a minor release bump later this week.
Let's get this out!

@tomchristie

This comment has been minimized.

Member

tomchristie commented Aug 16, 2017

Alrighty, pushed to PyPI.

@audiolion

This comment has been minimized.

Contributor

audiolion commented Aug 16, 2017

To migrate from pre 0.2 is the best idea to just start over especially if its a small project?

@tomchristie

This comment has been minimized.

Member

tomchristie commented Aug 16, 2017

@audiolion Probably review https://github.com/tomchristie/apistar#02-release and go from there. If I've missed anything let me know.

@tomchristie

This comment has been minimized.

Member

tomchristie commented Aug 16, 2017

No doubt will discover some bits & pieces to clean up, and there's still some things I'm not sure I'm 100% about (eg. the import layouts), but the architecture is far cleaner now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment