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

Add gerrychain recipe #7871

Merged
merged 10 commits into from
Mar 20, 2019
55 changes: 55 additions & 0 deletions recipes/gerrychain/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
{% set name = "gerrychain" %}
{% set version = "0.2.8" %}

package:
name: "{{ name|lower }}"
version: "{{ version }}"

source:
url: https://pypi.io/packages/source/{{ name[0] }}/{{ name }}/{{ name }}-{{ version }}.tar.gz
sha256: 2d3dc1ff35c6f6c1670918f30e8be4c00faed1178b19501e38bfef09c2f023b5

build:
number: 0
script: "{{ PYTHON }} -m pip install . --no-deps --ignore-installed -vv "

requirements:
host:
- geopandas
- matplotlib
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these packages really necessary at install time? If so, it might be good to look at your package's structure to try to make your imports not happen when calling setup.py.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for pointing this out---I don't think they are necessary.

- networkx
- pandas
- pip
- python
- shapely
run:
- geopandas
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

geopandas is broken now b/c, even though the conda-forge stack has gdal pinned to libgdal 2.4.* a geopandas install pulls libgdal 2.3 from defaults. The staged recipes solution could be to use the strict channel option (ping @conda-forge/core) or maybe "wait out" the openssl migration and hopefully things will magically work themselves out (until the next migration).

In geopandas we can:

  • drop the optional dependency on psycopg2, which is causing the libgdal downgrade
  • over-specify libgdal 2.4 to force conda to do the right thing.

Ping @jorisvandenbossche.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even with the new geopandas that pull less dependencies this still solves for libgdal 2.3.3 from defaults 😒

See conda-forge/osmnx-feedstock#40 (comment) for more info.

I'm not sure if we have any other option besides forcing the strict channel option in conda-forge.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that is reasonable to force strict, especially as that has been what we've told other people to do.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll send a PR to conda-smithy and staged-recipes tomorrow to implement that. I "forced" it here on CircleCI just as a test.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@maxhully we can force libgdal 2.4 here to "get this merged" b/c over-specifying the geopandas dependencies will force the right deps. Or we can wait for conda-forge/conda-forge-ci-setup-feedstock#50. The best solution is of course the latter but if you are in a hurry to get this package in we can do the former.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm OK with waiting! Let me know if there's anything I can do to help out, and thanks for all your work on this---both my recipe and conda-forge in general!

- matplotlib
- networkx
- pandas
- python
- shapely

test:
imports:
- gerrychain
- gerrychain.constraints
- gerrychain.graph
- gerrychain.partition
- gerrychain.proposals
- gerrychain.updaters
- gerrychain.vendor
- gerrychain.vendor.utm

about:
home: https://github.com/mggg/GerryChain
license: BSD
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like it is BSD-3-Clause.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Just pushed the fix.

license_family: BSD
license_file: LICENSE
summary: Use Markov chain Monte Carlo to analyze districting plans and gerrymanders
doc_url: https://gerrychain.readthedocs.io/
dev_url: https://github.com/mggg/GerryChain

extra:
recipe-maintainers:
- maxhully