osm-python-tools icon indicating copy to clipboard operation
osm-python-tools copied to clipboard

Reduce footprint / make dependencies optional

Open st-a opened this issue 2 years ago • 0 comments

Hi @mocnik-science, thanks a lot for this very useful python package.

I am using OSMPythonTools in a server context and recognized, that there are some really heavy dependencies: matplotlib, numpy and pandas. Would you mind making these optional, as they are only used by the data module?

Here is a comparison of the virtual environment folder (Linux) with and without optional dependencies:

  • all requirements: 260 MB | 24 packages
  • without data requirements: 40 MB | 11 packages

Besides modifying setup.py, I did add some documentation where applicable.

Unfortunately I was not able to run the tests. This should be no problem, as there were no changes to the internal code. The output of pytest --verbose is:

Test session starts (platform: linux, Python 3.11.3, pytest 7.3.1, pytest-sugar 0.9.7)
cachedir: .pytest_cache
rootdir: /home/sta/temp/new
plugins: sugar-0.9.7
collected 0 items

Results (0.01s):

st-a avatar May 23 '23 16:05 st-a