by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Mar 14 19:42
    florimondmanca closed #334
  • Mar 14 19:41
    florimondmanca commented #334
  • Mar 14 19:39

    florimondmanca on pip

    (compare)

  • Mar 14 19:39
    dependabot-preview[bot] commented #342
  • Mar 14 19:39
    florimondmanca closed #342
  • Mar 14 02:00

    dependabot[bot] on npm_and_yarn

    (compare)

  • Mar 14 02:00
    dependabot[bot] commented #343
  • Mar 14 02:00
    florimondmanca closed #343
  • Mar 13 23:34
    codecov-io commented #343
  • Mar 13 23:33
    codecov-io commented #343
  • Mar 13 23:32
    codecov-io commented #343
  • Mar 13 23:29
    dependabot[bot] labeled #343
  • Mar 13 23:29
    dependabot[bot] opened #343
  • Mar 13 23:29

    dependabot[bot] on npm_and_yarn

    Bump acorn from 6.1.1 to 6.4.1 … (compare)

  • Mar 09 05:28
    codecov-io commented #342
  • Mar 09 05:28
    florimondmanca commented #342
  • Mar 09 05:27
    codecov-io commented #342
  • Mar 09 05:26
    codecov-io commented #342
  • Mar 09 05:23
    dependabot-preview[bot] labeled #342
  • Mar 09 05:23
    dependabot-preview[bot] opened #342
Marwan Rabbâa
@waghanza
but later ...
Florimond Manca
@florimondmanca

but readthedocs and sphinx support markdown

Do you refer to https://www.sphinx-doc.org/en/master/usage/markdown.html? :-) For some reason I didn’t find that page while looking for solutions! It supports CommonMark though, and the Vuepress Markdown is supercharged in comparison — you can write Vue components and use them right into the Markdown page.

Marwan Rabbâa
@waghanza
yes, it was that, but ain't nostaligic without any arguments ;-)
Florimond Manca
@florimondmanca
:grinning:
Marlysson Silva
@Marlysson

@florimondmanca I ran this command to install bocadillo:

pip install bocadillo

After installed bocadillo and run the app.py starter file are getting this error message:

Traceback (most recent call last):
  File "app.py", line 1, in <module>
    from bocadillo import App, Templates
ImportError: cannot import name 'App'

There are something that I'm forget about it?

Tobias SN
@TobiasSN
Would you mind running this?
import bocadillo
print(bocadillo.__version__)
It just outputs the version.
Florimond Manca
@florimondmanca
@Marlysson Yup, sounds like pip installed <0.13. Pip installs from cache by default so if you’ve already installed Bocadillo previously it will use whichever version it has in the cache. Use pip install -U bocadillo to force it to download the latest version :)
Marlysson Silva
@Marlysson
@TobiasSN It's shown this:
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: module 'bocadillo' has no attribute '__version__'
Marlysson Silva
@Marlysson

I think the problem it's other..

Failed building wheel for uvicorn

Failed build others resources too ( starlette, httptools .. )

Florimond Manca
@florimondmanca
Could you open a bug report with your specs (OS versions, Python version, etc) @Marlysson ?
That __version__ attribute error is very odd. Bocadillo has had that exposed since 0.1!
Marlysson Silva
@Marlysson

Yes, I will do.

I tested in linux , will test in windows enviroment and report some progress..

EricE
@EricE
Greetings. I have starting to think about some web based projects using Bocadillo as well as async desktop utility type apps that query REST interfaces on the web. I was starting with aiohttp but now that requests-async is out I'm inclined to switch. It looks like Bocadillo is using Starlette to manage requests but I'd like to develop libraries that I can use for both my desktop utilities and Bocadillo. I'm a hardware guy who likes to play with software so this may be an obvious guestion, but if I start working in requests-async, can I drop the code into a Bocadillo project? Or is the interface so similar that I can design it to work with both?
Florimond Manca
@florimondmanca
Hi @EricE! Welcome :) requests-async and Bocadillo are 100% compatible. Requests-async allows to make HTTP requests asynchronously and Bocadillo is asynchronous at its core. So yep, you should be able to drop requests-async code into a Bocadillo project.
From your last sentence I’m not sure I fully understood your question though — feel free to ping back if there’s anything unclear!
Marlysson Silva
@Marlysson

@florimondmanca Great news!!!

I was trying to install again bocadillo and now everything is fine..

I'm able to see version thought bocadillo.version and show 0.13.0.

I ran :

sudo apt-get install python3.6-dev libssl-dev

to be able install bocadillo without errors..

WIll whether is good point out this libs when install it?
Florimond Manca
@florimondmanca

Good stuff @Marlysson! I think we could add this to a troubleshooting section in the FAQ.

Would you mind opening an issue with as many details as you can on the problem and your setup (OS, Python version before/after the fix, any tracebacks, etc)? It would be better than handling this via the chat.

If you know how to use Docker you can try to reproduce the issue in a Linux container, and post the Dockerfile so that we can see how/why this happens. Otherwise I can have a shoot at it myself. :)

Luca Lacerda
@lucawen
Hiii!!
I can create files/folders organization and import in main .py file ?
or anything need to be in the same file ?
like flask
Florimond Manca
@florimondmanca
Hi @lucawen, route registration is indeed Flask-style, so you can register routes anywhere you have access to an app. You can use recipes to separate an app into multiple sub-apps. We also have #234 open for module-based route registration. If that doesn't fit your use case feel free to open a feature request :)
Alfred Chiesa
@alfredchiesa
anyone have examples (or boilerplates) that show a more complete suggested large project structure? There is likely something, but I am having a hard time finding it.
Florimond Manca
@florimondmanca
Hey Alfred, I’m not sure how big of a structure you’re looking for. An example real-life application is TermPair, made by @cs01: https://github.com/cs01/termpair Not sure it qualifies as « large », though. If you think there should be some hints in the docs about this, feel free to open an issue!
By the way everyone, I’ll be on vacation for the next 7 days so might not be able to respond right away. Feel free to help each other out as you can. :-)
Zuhair
@zowhair_twitter
Hi!
How can I clone and built/customize bocadillo locally on my own computer
So that I can contribute
Zuhair
@zowhair_twitter
a problem is that, I have installed python3.6 on my laptop, how to replace it with 3.7?? in ubunut
ubuntu*
Florimond Manca
@florimondmanca
@zowhair_twitter The contributing guide should help you get started :) https://github.com/bocadilloproject/bocadillo/blob/master/CONTRIBUTING.md
As for your question about Python, I’m not an Ubuntu user but I guess you should be able to find an answer by a bit of googling 👍
Zuhair
@zowhair_twitter
@florimondmanca Thanks bro
EricE
@EricE
Thanks for the updated documentation on async. In https://bocadilloproject.github.io/guides/async.html#converting-a-regular-function-to-an-asynchronous-function, if compute is slow, the I assume you would wrap it in run_in_threadpool since wrapping it in an async function doesn't protect you?
Florimond Manca
@florimondmanca
Absolutely @EricE, something like:
async def compute_async(*args, **kwargs):
    return await run_in_threadpool(compute, *args, **kwargs)
Florimond Manca
@florimondmanca
I pushed an update to that section with an additional tip on using partial :)
@alfredchiesa Coming back to your question on larger project structures last time, you may want to check out the new Bocadillo CLI and fiddle around with the create command, it should give you an example of a full-featured project file structure: https://github.com/bocadilloproject/bocadillo-cli
We’re still working towards being able to easily split an app into multiple files :)
^For example via #261
EricE
@EricE
Thanks for the update! For truly CPU bound applications, wouldn't you want to use ProcessPoolExecutor instead of ThreadPoolExecutor (unfortunately not in starlette)? Seems like you would slow down your asyncio app using the ThreadPoolExecutor but have minimal impact with ProcessPoolExecutor. I know it can be more limiting to work with Processes over Threads (pickling) but for maximum speed using ThreadPoolExecutor seems better.
Florimond Manca
@florimondmanca
Yes, I’ve heard that deferring highly CPU-bound operations to a process is more effective in Python. @EricE Maybe you should open a PR to Starlette to add run_in_processpool()? ;)
EricE
@EricE
If I only knew how to use Github :) I just downloaded their desktop app, I'll see if I can figure it out. The hardware guys at my company still use SVN for our FPGA files, etc., and I use it for my Python projects. Our SW guys are switching to Git and it is clearly the winner so time to switch...
Florimond Manca
@florimondmanca
Ah right, you’re into hardware! This website helped me a lot when starting with git two years ago :) http://rogerdudler.github.io/git-guide/
Ilyes Bouchlaghem
@Ibouch
Hi ! I am reading about ASGI servers more precisely on Uvicorn and a framework using it (Starlette.io). It turns out that in their section 'Third Party Packages' they quote you with another framework (FastAPI), so Bocadillo is a framework of another framework? Would not this add unnecessary overlays rather than contribute directly to the Starlette.io project?
Anyway good job, there are features that look cool
Florimond Manca
@florimondmanca

Hi Ilyes! Thanks for pitching in, this is an interesting question!

Actually, Bocadillo uses Starlette as an ASGI toolkit, not as a framework. For example, we reuse Starlette’s HTTP request representation (the Request class), as well as various ASGI middleware classes (eg the CORS middleware) and some other features (eg background tasks). But Bocadillo has a different design for views, and other features completely separate from Starlette (eg dependency injection). This hasn’t happened yet, but I’d be very much keen to bring generic enough features back into Starlette (in fact, I am personally a contributor to Starlette and uvicorn). :)

OTOH, it is true that FastAPI can be seen as a framework of a framework. For example, its app class is a direct subclass of ‘Starlette’ class. I think tiangolo is involved in both Starlette and uvicorn as well though.

Ilyes Bouchlaghem
@Ibouch
Ok thank you for the precision, in the description of your project, would you know what 'asynchronous salsa` means?
Florimond Manca
@florimondmanca
Bocadillo means sandwich in Spanish, and salsa means sauce, so it’s just a pun for the fact that Bocadillo is an async framework :)
Ilyes Bouchlaghem
@Ibouch
hm ok, because I had found on the internet "Salsa: A Framework for Scalable Asynchronous Replica Exchange"
but it did not make sense