You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
since the last version we packaged, httpbin grew a hard dependency on flasgger. flasgger is not packaged for Fedora and is a bit tricky to package because it contains several bundled, pre-minified javascript libraries, which is against Fedora's packaging guidelines. (They are also, I'll note, ancient - upstream hasn't updated the bundled libraries for ui2 or ui3 since it added them, six and five years ago respectively.)
We can probably work around this if necessary (perhaps by only packaging ui3, the one httpbin uses, which is simpler as it only bundles jquery 2.x), but another option is to look at having httpbin not use flasgger. It doesn't seem, strictly speaking, to be necessary - all it does (AIUI) is provide API docs in the web UI, which is neat but not critical. Especially not since the main reason we package httpbin in Fedora is as a dependency of requests' test suite - no human is looking at API docs in a web UI there.
Would it be acceptable to send a patch to make the flasgger dependency optional, and just skip all the flasgger setup stuff in httpbin/core.py if it's not present?
I mean, I guess the way I'd address that would be just to make sure whatever process generates the project's homepage honors the optional dependency? I was thinking the setuptools extras_require style, where you can require something like httpbin[apidocs] and flasgger will be pulled in, but if you require just httpbin it won't.
e.g. in a lot of my projects I specify the dependency coverage[toml] because I want to configure coverage via pyproject.toml - in coverage itself this is implemented here. If you just require coverage, you can't configure it with pyproject.toml.
I don't know how you do this if you're not using setuptools, but I'd be surprised if other systems don't make it possible.
oh, I think I'm misunderstanding - you mean it renders the page you see for any instance of httpbin if you just go to the root of the web server? In that case, yeah, I guess we'd need an alternative.
you mean it renders the page you see for any instance of httpbin if you just go to the root of the web server? I
As I understand it, yes, the neat API explorer thingy you get when visiting the homepage of httpbin.org is powered by flasgger.
At one point there was a static html homepage, if someone dug that up from git history and made sure it was up-to-date with all the currently available endpoints and had the app fall back to that static page if flasgger is not installed, then I would merge that PR :)
Activity
kevin1024 commentedon Aug 28, 2023
I'm down, especially since
flasggeradds its own tree of sub-dependencies, and for httpbin's library usecase, it really doesn't matter.However, it DOES render the current homepage for httpbin.
Maybe there's a way to fall back to the old static homepage if flasgger isn't available?
AdamWill commentedon Aug 28, 2023
I mean, I guess the way I'd address that would be just to make sure whatever process generates the project's homepage honors the optional dependency? I was thinking the setuptools
extras_requirestyle, where you can require something likehttpbin[apidocs]and flasgger will be pulled in, but if you require justhttpbinit won't.e.g. in a lot of my projects I specify the dependency
coverage[toml]because I want to configure coverage viapyproject.toml- in coverage itself this is implemented here. If you just requirecoverage, you can't configure it withpyproject.toml.I don't know how you do this if you're not using setuptools, but I'd be surprised if other systems don't make it possible.
AdamWill commentedon Aug 28, 2023
oh, I think I'm misunderstanding - you mean it renders the page you see for any instance of httpbin if you just go to the root of the web server? In that case, yeah, I guess we'd need an alternative.
kevin1024 commentedon Aug 31, 2023
As I understand it, yes, the neat API explorer thingy you get when visiting the homepage of httpbin.org is powered by flasgger.
At one point there was a static html homepage, if someone dug that up from git history and made sure it was up-to-date with all the currently available endpoints and had the app fall back to that static page if flasgger is not installed, then I would merge that PR :)
AdamWill commentedon Aug 31, 2023
awesome, thanks. I will try and get to that then.
AdamWill commentedon Oct 18, 2023
Sorry for the delay, but I finally went ahead and did #32 .
ml31415 commentedon Apr 10, 2024
@sigmavirus24 @nateprewitt Could one of you please have a look at either PR #32 or #44 ? Pretty please? :)
Make flasgger an optional dependency