UDST / pandana

Pandas Network Analysis by UrbanSim: fast accessibility metrics and shortest paths, using contraction hierarchies :world_map:
http://udst.github.io/pandana
GNU Affero General Public License v3.0
386 stars 84 forks source link

Proposal to streamline packaging #114

Open smmaurer opened 5 years ago

smmaurer commented 5 years ago

@sablanchard @federicofernandez @janowicz

This is a proposal for how we can manage Pandana packaging going forward. Goals: easy installation, broad compatibility, simpler release process, limited maintenance.

Background

Pandana includes C++ code, so binary distributions need to be compiled for each combination of operating system and Python version it will run on. This is a lot of work and we've never done a good job covering every combination.

I'm proposing that we focus on (a) installation from source and (b) installation from Conda Forge, and not create any binary distributions ourselves.

Installing from source

We should aim to make this as automatic as possible.

Source installation works using compilation settings from setup.py. Running pip install . or python setup.py install (or develop) will attempt to compile the C++ extension accordingly.

This has often been broken, but it's working now (after the latest round of updates for v0.4.2) on all platforms. We'll need to keep setup.py up to date, though.

Requirements for compilation:

On Mac, compilation with multi-threading support requires some extra steps: https://github.com/UDST/pandana/pull/109#issuecomment-485021324

Installing from Conda

This should be the go-to option for users.

Conda Forge automatically compiles binaries for all platforms, using setup.py plus some additional settings in the Conda build recipe. I haven't set it up yet, but it looks pretty straightforward, including multi-threading support for Mac.

Previously we've distributed Pandana on the udst Conda channel, but we're aiming to migrate to conda-forge anyway.

Installing from Pip

This should be somewhat discouraged.

I don't see any way to create binary distributions for Pip without maintaining half a dozen cross-platform VMs. I'm proposing we skip that and only put the source distribution on Pip.

This will generally install fine on Mac and Linux; it will automatically compile on the user's machine, in about 15 seconds. It will not have multi-threading support on Mac.

It probably won't work for most Windows users, but Sam Blanchard reports that some of the other geospatial dependencies don't install well from Pip anyway, and it's best to use Conda on Windows.

federicofernandez commented 5 years ago

I think this is a great idea. Do you know if conde forge supports compiling binary packages on Windows?

smmaurer commented 5 years ago

Yup, it does win-64, osx-64, and linux-64, for whichever versions of Python you request.

Here's their Windows documentation: https://conda-forge.org/docs/maintainer/knowledge_base.html#particularities-on-windows