Lighten or make the heavy package dependencies optional

Open
#1,692 24 comments 6 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
jupyter, matplotlib, numpy, pandas, python

Research direction

Start by reviewing the arcgis package's dependency declarations and mapping the listed heavy dependencies to the features that import or require them. Done means users can install and use lightweight functionality without those dependencies, while functionality that needs them remains available through explicit optional dependencies and is documented.

Written by the indexing model from the issue text.

Description

enhancement

Is your feature request related to a problem? Please describe.
My problem is the dependencies of the arcgis package are so big and heavy its extremely onerous to incorporate arcgis into an existing Python application, even though often the features of arcgis we use don't require any of the really heavy dependencies (jupyter, pillow, ipywidgets, pandas, dask, numpy, matplotlib, etc.)

E.g. dependencies for arcgis 2.2.0

dependencies = [
        "pillow",
        "urllib3>=1.21.1,<3",
        "cachetools",
        "lxml",
        "notebook",
        "cryptography",
        "ipywidgets >=7,<8",
        "widgetsnbextension >=3",
        "jupyter-client <=6.1.12",
        "pandas >=2.0.0,<3",
        "numpy >=1.21.6",
        "matplotlib",
        "keyring >=23.3.0",
        "pylerc",
        "ujson >=3",
        "jupyterlab",
        "python-certifi-win32;python_version<'3.10'",
        "truststore>=0.7.0;python_version>'3.9'",
        'pywin32 >=223;platform_system=="Windows"',
        "pyshp >=2",
        "geomet",
        "requests >=2.27.1,<3",
        "requests-oauthlib",
        "requests_toolbelt",
        "pyspnego >=0.8.0",
        "requests-kerberos",
        "requests-gssapi",
        "dask >=2023.3.2",
        "matplotlib-inline",
    ]

Describe the solution you'd like
I'd like the arcgis package restructured or designed to make all the really heavy dependencies optional, so I can only include the ones I need for the functions I use.

Describe alternatives you've considered
The first alternative I tried was continuing to use arcgis as is and tolerating the hundreds of megabytes of additional dependencies it would pull in that we didn't need, and the extra 10+ minutes of dependency resolving time this would incur every time we need to update our own dependencies.

The current alternative I use (which is very time consuming and painful for me) is to perform the operations I do need with arcgis, reverse engineer the requests it makes to the REST API, then re-implement the minimal parts of the arcgis package I need for my own application.

Dominant language
Python
Stars
2.2k
Forks
1.1k
Avg merge
2h 40m
Merged PRs (30d)
2

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Esri/arcgis-python-api

All issues in Esri/arcgis-python-api

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.