Skip to content
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

Make web UI dependencies optional #119

Merged
merged 15 commits into from
Sep 12, 2023
Merged

Conversation

cthoyt
Copy link
Member

@cthoyt cthoyt commented Jul 4, 2023

Update text

This PR makes the UI for the gilda web app optional. This means you don't have to install the flask-bootstrap or flask-wtf dependencies by default. If these aren't available, the home page just redirects to the apidocs.

These changes were made after the original PR (see text below) due to comment in #119 (comment).

Original Text

There are several situations in which installing the web dependencies for Gilda by default is inconvenient. The largest are due to conflicts in versions of werkzeug (which is pinned in gilda) and conflicts between flask-bootstrap (the one gilda uses, but it's abandoned) and bootstrap-flask (fork other former and is currently maintained)

As it is, it's not possible to easily have gilda simultaneously installed with biomappings, and this is a concrete issue for someone who might want to contribute some curations (without doing some more manual dependency management)

This PR simply makes the web dependencies optional. It updates the dockerfile and tests to make sure these are still installed where necessary, and updates relevant documentation accordingly

@bgyori
Copy link
Member

bgyori commented Jul 4, 2023

Honestly, I saw this coming years ago. At the time I felt strongly that Gilda should have a default, built in REST API that can be run locally without any extra dependencies. The issue with problematic additional dependencies is why I didn't want to mix that up with UI elements. So the solution I'd ideally be looking for is the combination is a (1) non-optional programmatic REST API and (2) optional UI elements. Is that possible using either two different modules for web services (that might still reuse some code) or some kind of blueprint-based setup?

@bgyori
Copy link
Member

bgyori commented Jul 4, 2023

See e.g., #41 (comment)

@cthoyt
Copy link
Member Author

cthoyt commented Jul 4, 2023

@bgyori I think this is doable

@cthoyt cthoyt changed the title Make web dependencies optional Make web UI dependencies optional Jul 4, 2023
@cthoyt cthoyt requested a review from bgyori July 5, 2023 09:07
@cthoyt
Copy link
Member Author

cthoyt commented Jul 5, 2023

@bgyori I managed to make the UI optional. If it's flagged to not use the UI or the UI dependencies aren't available, then the home page will automatically redirect to api docs page.

@cthoyt
Copy link
Member Author

cthoyt commented Jul 5, 2023

@bgyori one last thing - can we unrestrict the werkzeug version? The commit where this restriction was added 2a576de doesn't seem to have an explanation of why it was done

There are several situations in which installing the web dependencies for Gilda by default is inconvenient. The largest are due to conflicts in versions of werkzeug (which is pinned in gilda) and conflicts between flask-bootstrap (the one gilda uses, but it's abandoned) and bootstrap-flask (fork other former and is currently maintained)

As it is, it's not possible to easily have gilda simultaneously installed with biomappings, and this is a concrete issue for Jeremy T who wants to contribute some curations (without him doing some more manual dependency management)

This PR simply makes the web dependencies optional. It updates the dockerfile and tests to make sure these are still installed where necessary, and updates relevant documentation accordingly
Copy link
Member

@bgyori bgyori left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works great, thanks!

@bgyori bgyori merged commit c2efdf1 into gyorilab:master Sep 12, 2023
2 checks passed
@cthoyt cthoyt deleted the make-web-optiona branch September 12, 2023 20:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants