<commit_before>{ buildPythonPackage, lib, fetchPypi
, pytest, filelock, mock, pep8
, cython, isPy37, glibcLocales
, six, pyshp, shapely, geos, proj, numpy
, gdal, pillow, matplotlib, pyepsg, pykdtree, scipy, owslib, fiona
}:

buildPythonPackage rec {
  pname = "cartopy";
  version = "0.17.0";

  src = fetchPypi {
    inherit version;
    pname = "Cartopy";
    sha256 = "0q9ckfi37cxj7jwnqnzij62vwcf4krccx576vv5lhvpgvplxjjs2";
  };

  checkInputs = [ filelock mock pytest pep8 ];

  # several tests require network connectivity: we disable them
  checkPhase = ''
    export HOME=$(mktemp -d)
    pytest --pyargs cartopy \
      -m "not network and not natural_earth" \
      -k "not test_nightshade_image"
  '';

  buildInputs = [ cython glibcLocales ];
  LC_ALL = "en_US.UTF-8";

  propagatedBuildInputs = [
    # required
    six pyshp shapely geos proj numpy

    # optional<commit_msg>python.pkgs.cartopy: fix build (#58361)<commit_after>{ buildPythonPackage, lib, fetchPypi
, pytest, filelock, mock, pep8
, cython, isPy37, glibcLocales
, six, pyshp, shapely, geos, proj, numpy
, gdal, pillow, matplotlib, pyepsg, pykdtree, scipy, owslib, fiona
}:

buildPythonPackage rec {
  pname = "cartopy";
  version = "0.17.0";

  src = fetchPypi {
    inherit version;
    pname = "Cartopy";
    sha256 = "0q9ckfi37cxj7jwnqnzij62vwcf4krccx576vv5lhvpgvplxjjs2";
  };

  checkInputs = [ filelock mock pytest pep8 ];

  # several tests require network connectivity: we disable them
  checkPhase = ''
    export HOME=$(mktemp -d)
    pytest --pyargs cartopy \
      -m "not network and not natural_earth" \
      -k "not test_nightshade_image"
  '';

  nativeBuildInputs = [
    cython
    geos # for geos-config
    proj
  ];

  buildInputs = [
    geos proj
  ];

  propagatedBuildInputs = [
    # required
    six pyshp shapely numpy

    # optional
{'fraction_non_alphanumeric': 0.10526315789473684, 'fraction_numerical': 0.02930005425935974, 'mean_word_length': 3.380047505938242, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6810397', 'n_tokens_mistral': 742, 'n_tokens_neox': 700, 'n_words': 168}