make mesa runable without some dependencies #1950
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I was playing around with Jupyter Lite to create a first version of a Netlogo Web-like experience, where users can try out some models on a statically hosted webpage.
However, Pyodide (the underlying tech) needs either pure python packages or specialized wheels. Mesa itself is pure python, but it depends on mesa-viz-tornado, which depends on tornado, which is not yet compatible with Pyodide. I was trying to install mesa without dependencies, but the way it is currently build it requires mesa_viz_tornado to be present to import mesa.
This PR removes that hard dependency by only trying to import the module. So if users don't use the tornado backend they don't need to have that dependency installed.
I did the same for pandas, which is only used for converting the output of the datacollector and networkx, which is only used for NetworkGrid.
The other dependencies are either already only used on access or an integral part of mesa.