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

Reduce footprint / make dependencies optional #72

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

st-a
Copy link

@st-a st-a commented May 23, 2023

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 added 2 commits May 23, 2023 18:28
Reduce OSMPythonTools' footprint, if use of the data module is not required. Shrink the virtual environment folder from 260 MB / 24 packages to 40 MB / 11 packages.
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.

1 participant