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
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions recipes/gerrychain/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
3-Clause BSD License

Copyright (c) 2019 Metric Geometry and Gerrymandering Group

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or other
materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its contributors may
be used to endorse or promote products derived from this software without specific
prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
50 changes: 50 additions & 0 deletions recipes/gerrychain/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{% 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:
noarch: python
number: 0
script: "{{ PYTHON }} -m pip install . --no-deps --ignore-installed -vv "

requirements:
host:
- pip
- python
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!

- 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