Bondify / gtfs_functions

Package with useful functions to create geo-spatial visualizations from a GTFS.
MIT License
114 stars 30 forks source link

Install requirements during the installation process #4

Closed KoszticzaM closed 9 months ago

KoszticzaM commented 3 years ago

Hi,

I installed the package from pypi, and used it from jupyter notebook. At first, it gave me an error saying partridge isn't downloaded, then I read the source:

     try:
         import partridge as ptg
     except ImportError as e:
         os.system('pip install partridge')
         import partridge as ptg

The problem was, that I was using a virtual env, and pip hadn't been aliased correctly, and the pip install installed it into another environment. Is there any specific cause not to install dependencies during installation?

jnh277 commented 2 years ago

Hi,

I just noticed the above and what was even scarier for me was finding

    os.system('apt install libspatialindex-dev')
    os.system('pip install rtree')

inside one of the functions.

Completely unprotected calls to system. This failed for me since it was not run as root and therefore could not use apt install. However, it shouldn't be there in the first place. All these things should be moved into the setup script.

jnh277 commented 2 years ago

@Bondify if you are willing to give me access permissions to publish a branch then I can push a branch that fixes this issue and create a pull request

jnh277 commented 2 years ago

I have made a fork of this package freely available at https://github.com/jnh277/gtfs_functions where the install requirements are fixed up and no installation will happen during run time