<commit_before>{ lib, stdenv
, buildPythonPackage
, fetchurl
, cffi
, pkgs
}:

buildPythonPackage rec {
  pname = "pyspotify";
  version = "2.1.3";

  src = fetchurl {
    url = "https://github.com/mopidy/pyspotify/archive/v${version}.tar.gz";
    sha256 = "1y1zqkqi9jz5m9bb2z7wmax7g40c1snm3c6di6b63726qrf26rb7";
  };

  propagatedBuildInputs = [ cffi ];
  buildInputs = [ pkgs.libspotify ];

  # python zip complains about old timestamps
  preConfigure = ''
    find -print0 | xargs -0 touch
  '';

  postInstall = lib.optionalString stdenv.isDarwin ''
    find "$out" -name _spotify.so -exec \
        install_name_tool -change \
        @loader_path/../Frameworks/libspotify.framework/libspotify \
        ${pkgs.libspotify}/lib/libspotify.dylib \
        {} \;
  '';

  # There are no tests
  doCheck = false;

  meta = with lib; {
    homepage    = "http://pyspotify.mopidy.com";
    description = "A Python interface to Spotify’s online music streaming service";
    license     = licenses.unfree;
    maintainers = with maintainers; [ lovek323 ];
    platforms   = platforms.unix;
  };

}<commit_msg>pythonPackages.pyspotify: switch to fetchFromGitHub<commit_after>{ lib
, stdenv
, buildPythonPackage
, fetchFromGitHub
, cffi
, pkgs
}:

buildPythonPackage rec {
  pname = "pyspotify";
  version = "2.1.3";

  src = fetchFromGitHub {
    owner = "mopidy";
    repo = "pyspotify";
    rev = "v${version}";
    sha256 = "sha256-CjIRwSlR5HPOJ9tp7lrdcDPiKH3p/PxvEJ8sqVD5s3Q=";
  };

  propagatedBuildInputs = [ cffi ];
  buildInputs = [ pkgs.libspotify ];

  # python zip complains about old timestamps
  preConfigure = ''
    find -print0 | xargs -0 touch
  '';

  postInstall = lib.optionalString stdenv.isDarwin ''
    find "$out" -name _spotify.so -exec \
        install_name_tool -change \
        @loader_path/../Frameworks/libspotify.framework/libspotify \
        ${pkgs.libspotify}/lib/libspotify.dylib \
        {} \;
  '';

  # There are no tests
  doCheck = false;

  meta = with lib; {
    homepage = "http://pyspotify.mopidy.com";
    description = "A Python interface to Spotify’s online music streaming service";
    license = licenses.unfree;
    maintainers = with maintainers; [ lovek323 ];
    platforms = platforms.unix;
  };

}
{'fraction_non_alphanumeric': 0.1238898756660746, 'fraction_numerical': 0.023978685612788632, 'mean_word_length': 3.023214285714286, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 1, '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': '931449', 'n_tokens_mistral': 853, 'n_tokens_neox': 817, 'n_words': 159}