You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21278 lines
616 KiB

# This file contains the Python packages set.
# Each attribute is a Python library or a helper function.
# Expressions for Python libraries are supposed to be in `pkgs/development/python-modules/<name>/default.nix`.
# Python packages that do not need to be available for each interpreter version do not belong in this packages set.
# Examples are Python-based cli tools.
#
# For more details, please see the Python section in the Nixpkgs manual.
{ pkgs
, stdenv
, python
, overrides ? (self: super: {})
}:
with pkgs.lib;
let
packages = ( self:
let
pythonAtLeast = versionAtLeast python.pythonVersion;
pythonOlder = versionOlder python.pythonVersion;
isPy26 = python.pythonVersion == "2.6";
isPy27 = python.pythonVersion == "2.7";
isPy33 = python.pythonVersion == "3.3";
isPy34 = python.pythonVersion == "3.4";
isPy35 = python.pythonVersion == "3.5";
isPy36 = python.pythonVersion == "3.6";
isPyPy = python.executable == "pypy";
isPy3k = strings.substring 0 1 python.pythonVersion == "3";
callPackage = pkgs.newScope self;
namePrefix = python.libPrefix + "-";
bootstrapped-pip = callPackage ../development/python-modules/bootstrapped-pip { };
# Derivations built with `buildPythonPackage` can already be overriden with `override`, `overrideAttrs`, and `overrideDerivation`.
# This function introduces `overridePythonAttrs` and it overrides the call to `buildPythonPackage`.
makeOverridablePythonPackage = f: origArgs:
let
ff = f origArgs;
overrideWith = newArgs: origArgs // (if pkgs.lib.isFunction newArgs then newArgs origArgs else newArgs);
in
if builtins.isAttrs ff then (ff // {
overridePythonAttrs = newArgs: makeOverridablePythonPackage f (overrideWith newArgs);
})
else if builtins.isFunction ff then {
overridePythonAttrs = newArgs: makeOverridablePythonPackage f (overrideWith newArgs);
__functor = self: ff;
}
else ff;
buildPythonPackage = makeOverridablePythonPackage ( makeOverridable (callPackage ../development/interpreters/python/build-python-package.nix {
inherit bootstrapped-pip;
flit = self.flit;
# We want Python libraries to be named like e.g. "python3.6-${name}"
inherit namePrefix;
inherit toPythonModule;
}));
buildPythonApplication = makeOverridablePythonPackage ( makeOverridable (callPackage ../development/interpreters/python/build-python-package.nix {
inherit bootstrapped-pip;
flit = self.flit;
namePrefix = "";
toPythonModule = x: x; # Application does not provide modules.
}));
graphiteVersion = "1.0.2";
fetchPypi = makeOverridable( {format ? "setuptools", ... } @attrs:
let
fetchWheel = {pname, version, sha256, python ? "py2.py3", abi ? "none", platform ? "any"}:
# Fetch a wheel. By default we fetch an universal wheel.
# See https://www.python.org/dev/peps/pep-0427/#file-name-convention for details regarding the optional arguments.
let
url = "https://files.pythonhosted.org/packages/${python}/${builtins.substring 0 1 pname}/${pname}/${pname}-${version}-${python}-${abi}-${platform}.whl";
in pkgs.fetchurl {inherit url sha256;};
fetchSource = {pname, version, sha256, extension ? "tar.gz"}:
# Fetch a source tarball.
let
url = "mirror://pypi/${builtins.substring 0 1 pname}/${pname}/${pname}-${version}.${extension}";
in pkgs.fetchurl {inherit url sha256;};
fetcher = (if format == "wheel" then fetchWheel
else if format == "setuptools" then fetchSource
else throw "Unsupported kind ${kind}");
in fetcher (builtins.removeAttrs attrs ["format"]) );
# Check whether a derivation provides a Python module.
hasPythonModule = drv: drv?pythonModule && drv.pythonModule == python;
# Get list of required Python modules given a list of derivations.
requiredPythonModules = drvs: let
modules = filter hasPythonModule drvs;
in unique ([python] ++ modules ++ concatLists (catAttrs "requiredPythonModules" modules));
# Create a PYTHONPATH from a list of derivations. This function recurses into the items to find derivations
# providing Python modules.
makePythonPath = drvs: stdenv.lib.makeSearchPath python.sitePackages (requiredPythonModules drvs);
# Convert derivation to a Python module.
toPythonModule = drv:
drv.overrideAttrs( oldAttrs: {
# Use passthru in order to prevent rebuilds when possible.
passthru = (oldAttrs.passthru or {})// {
pythonModule = python;
pythonPath = [ ]; # Deprecated, for compatibility.
requiredPythonModules = requiredPythonModules drv.propagatedBuildInputs;
};
});
disabledIf = x: drv:
if x then throw "${removePrefix namePrefix (drv.pname or drv.name)} not supported for interpreter ${python.executable}" else drv;
in {
inherit python bootstrapped-pip pythonAtLeast pythonOlder isPy26 isPy27 isPy33 isPy34 isPy35 isPy36 isPyPy isPy3k buildPythonPackage buildPythonApplication;
inherit fetchPypi callPackage;
inherit hasPythonModule requiredPythonModules makePythonPath disabledIf;
# helpers
wrapPython = callPackage ../development/interpreters/python/wrap-python.nix {inherit python; inherit (pkgs) makeSetupHook makeWrapper; };
# specials
recursivePthLoader = callPackage ../development/python-modules/recursive-pth-loader { };
setuptools = toPythonModule (callPackage ../development/python-modules/setuptools { });
vowpalwabbit = callPackage ../development/python-modules/vowpalwabbit {
pythonPackages = self;
boost = pkgs.boost160;
};
acoustics = callPackage ../development/python-modules/acoustics { };
py3to2 = callPackage ../development/python-modules/3to2 { };
# Left for backwards compatibility
"3to2" = self.py3to2;
absl-py = callPackage ../development/python-modules/absl-py { };
aenum = callPackage ../development/python-modules/aenum { };
affinity = callPackage ../development/python-modules/affinity { };
5 years ago
agate = callPackage ../development/python-modules/agate { };
agate-dbf = callPackage ../development/python-modules/agate-dbf { };
phonenumbers = callPackage ../development/python-modules/phonenumbers { };
agate-excel = callPackage ../development/python-modules/agate-excel { };
agate-sql = callPackage ../development/python-modules/agate-sql { };
aioimaplib = callPackage ../development/python-modules/aioimaplib { };
aioamqp = callPackage ../development/python-modules/aioamqp { };
ansicolor = callPackage ../development/python-modules/ansicolor { };
argon2_cffi = callPackage ../development/python-modules/argon2_cffi { };
asana = callPackage ../development/python-modules/asana { };
asn1crypto = callPackage ../development/python-modules/asn1crypto { };
astral = callPackage ../development/python-modules/astral { };
astropy = callPackage ../development/python-modules/astropy { };
augeas = callPackage ../development/python-modules/augeas {
inherit (pkgs) augeas;
};
automat = callPackage ../development/python-modules/automat { };
aws-xray-sdk = callPackage ../development/python-modules/aws-xray-sdk { };
# packages defined elsewhere
backports_csv = callPackage ../development/python-modules/backports_csv {};
bap = callPackage ../development/python-modules/bap {
5 years ago
bap = pkgs.ocamlPackages.bap;
};
bash_kernel = callPackage ../development/python-modules/bash_kernel { };
bayespy = callPackage ../development/python-modules/bayespy { };
bitcoinlib = callPackage ../development/python-modules/bitcoinlib { };
bitcoin-price-api = callPackage ../development/python-modules/bitcoin-price-api { };
blivet = callPackage ../development/python-modules/blivet { };
breathe = callPackage ../development/python-modules/breathe { };
browsermob-proxy = disabledIf isPy3k (callPackage ../development/python-modules/browsermob-proxy {});
bugseverywhere = callPackage ../applications/version-management/bugseverywhere {};
dendropy = callPackage ../development/python-modules/dendropy { };
5 years ago
dbf = callPackage ../development/python-modules/dbf { };
dbfread = callPackage ../development/python-modules/dbfread { };
dkimpy = callPackage ../development/python-modules/dkimpy { };
diff_cover = callPackage ../development/python-modules/diff_cover { };
emcee = callPackage ../development/python-modules/emcee { };
email_validator = callPackage ../development/python-modules/email-validator { };
dbus-python = callPackage ../development/python-modules/dbus {
dbus = pkgs.dbus;
};
discid = callPackage ../development/python-modules/discid { };
discordpy = callPackage ../development/python-modules/discordpy { };
distorm3 = callPackage ../development/python-modules/distorm3 { };
diff-match-patch = callPackage ../development/python-modules/diff-match-patch { };
globus-sdk = callPackage ../development/python-modules/globus-sdk { };
gssapi = callPackage ../development/python-modules/gssapi { };
h5py = callPackage ../development/python-modules/h5py {
hdf5 = pkgs.hdf5;
};
h5py-mpi = self.h5py.override {
hdf5 = pkgs.hdf5-mpi;
};
habanero = callPackage ../development/python-modules/habanero { };
i3ipc = callPackage ../development/python-modules/i3ipc { };
intelhex = callPackage ../development/python-modules/intelhex { };
lmtpd = callPackage ../development/python-modules/lmtpd { };
mpi4py = callPackage ../development/python-modules/mpi4py {
mpi = pkgs.openmpi;
};
mwoauth = callPackage ../development/python-modules/mwoauth { };
neuron = pkgs.neuron.override {
6 years ago
inherit python;
};
neuron-mpi = pkgs.neuron-mpi.override {
6 years ago
inherit python;
};
nixpart = callPackage ../tools/filesystems/nixpart { };
# This is used for NixOps to make sure we won't break it with the next major
# version of nixpart.
nixpart0 = callPackage ../tools/filesystems/nixpart/0.4 { };
nltk = callPackage ../development/python-modules/nltk { };
ntlm-auth = callPackage ../development/python-modules/ntlm-auth { };
oauthenticator = callPackage ../development/python-modules/oauthenticator { };
plantuml = callPackage ../tools/misc/plantuml { };
Pmw = callPackage ../development/python-modules/Pmw { };
py_stringmatching = callPackage ../development/python-modules/py_stringmatching { };
pyaes = callPackage ../development/python-modules/pyaes { };
pyamf = callPackage ../development/python-modules/pyamf { };
pyatspi = disabledIf (!isPy3k) (callPackage ../development/python-modules/pyatspi { });
pycairo = callPackage ../development/python-modules/pycairo { };
pycangjie = disabledIf (!isPy3k) (callPackage ../development/python-modules/pycangjie { });
pycrypto = callPackage ../development/python-modules/pycrypto { };
pycryptodome = callPackage ../development/python-modules/pycryptodome { };
pycryptodomex = callPackage ../development/python-modules/pycryptodomex { };
PyChromecast = callPackage ../development/python-modules/pychromecast { };
pydbus = callPackage ../development/python-modules/pydbus { };
pydocstyle = callPackage ../development/python-modules/pydocstyle { };
pyexiv2 = disabledIf isPy3k (callPackage ../development/python-modules/pyexiv2 {});
py3exiv2 = callPackage ../development/python-modules/py3exiv2 { };
pyfakefs = callPackage ../development/python-modules/pyfakefs {};
pygame = callPackage ../development/python-modules/pygame { };
pygame-git = callPackage ../development/python-modules/pygame/git.nix { };
pygame_sdl2 = callPackage ../development/python-modules/pygame_sdl2 { };
pygobject2 = callPackage ../development/python-modules/pygobject { };
pygobject3 = callPackage ../development/python-modules/pygobject/3.nix { };
pygtk = callPackage ../development/python-modules/pygtk { libglade = null; };
pygtksourceview = callPackage ../development/python-modules/pygtksourceview { };
pyGtkGlade = self.pygtk.override {
libglade = pkgs.gnome2.libglade;
};
pyjwkest = callPackage ../development/python-modules/pyjwkest { };
pykde4 = callPackage ../development/python-modules/pykde4/default.nix {
inherit (self) pyqt4;
callPackage = pkgs.callPackage;
};
pyparser = callPackage ../development/python-modules/pyparser { };
pyqt4 = callPackage ../development/python-modules/pyqt/4.x.nix {
pythonPackages = self;
};
pyqt5 = pkgs.libsForQt5.callPackage ../development/python-modules/pyqt/5.x.nix {
pythonPackages = self;
8 years ago
};
pysc2 = callPackage ../development/python-modules/pysc2 { };
pyscard = callPackage ../development/python-modules/pyscard { inherit (pkgs.darwin.apple_sdk.frameworks) PCSC; };
pyside = callPackage ../development/python-modules/pyside { };
pysideShiboken = callPackage ../development/python-modules/pyside/shiboken.nix {
inherit (pkgs) libxml2 libxslt; # Do not need the Python bindings.
};
pysideTools = callPackage ../development/python-modules/pyside/tools.nix { };
pyslurm = callPackage ../development/python-modules/pyslurm {
slurm = pkgs.slurm;
};
pytest-tornado = callPackage ../development/python-modules/pytest-tornado { };
python-sql = callPackage ../development/python-modules/python-sql { };
python-stdnum = callPackage ../development/python-modules/python-stdnum { };
python-utils = callPackage ../development/python-modules/python-utils { };
pytimeparse = callPackage ../development/python-modules/pytimeparse { };
PyWebDAV = callPackage ../development/python-modules/pywebdav { };
pyxml = disabledIf isPy3k (callPackage ../development/python-modules/pyxml{ });
relatorio = callPackage ../development/python-modules/relatorio { };
pyzufall = callPackage ../development/python-modules/pyzufall { };
rhpl = disabledIf isPy3k (callPackage ../development/python-modules/rhpl {});
rx = callPackage ../development/python-modules/rx { };
salmon-mail = callPackage ../development/python-modules/salmon-mail { };
serversyncstorage = callPackage ../development/python-modules/serversyncstorage {};
simpleeval = callPackage ../development/python-modules/simpleeval { };
sip = callPackage ../development/python-modules/sip { };
supervise_api = callPackage ../development/python-modules/supervise_api { };
syncserver = callPackage ../development/python-modules/syncserver {};
tables = callPackage ../development/python-modules/tables {
hdf5 = pkgs.hdf5.override { zlib = pkgs.zlib; };
};
tokenserver = callPackage ../development/python-modules/tokenserver {};
unifi = callPackage ../development/python-modules/unifi { };
pyunbound = callPackage ../tools/networking/unbound/python.nix { };
# packages defined here
aafigure = callPackage ../development/python-modules/aafigure { };
altair = callPackage ../development/python-modules/altair { };
vega = callPackage ../development/python-modules/vega { };
acme = callPackage ../development/python-modules/acme { };
acme-tiny = callPackage ../development/python-modules/acme-tiny { };
actdiag = callPackage ../development/python-modules/actdiag { };
adal = callPackage ../development/python-modules/adal { };
aioconsole = callPackage ../development/python-modules/aioconsole { };
aiodns = callPackage ../development/python-modules/aiodns { };
aiofiles = callPackage ../development/python-modules/aiofiles { };
aiohttp = callPackage ../development/python-modules/aiohttp { };
aiohttp-cors = callPackage ../development/python-modules/aiohttp/cors.nix { };
alabaster = callPackage ../development/python-modules/alabaster {};
alembic = callPackage ../development/python-modules/alembic {};
ansicolors = callPackage ../development/python-modules/ansicolors {};
aniso8601 = callPackage ../development/python-modules/aniso8601 {};
asgiref = callPackage ../development/python-modules/asgiref { };
asgi_ipc = callPackage ../development/python-modules/asgi_ipc { };
asgi_redis = callPackage ../development/python-modules/asgi_redis { };
python-editor = callPackage ../development/python-modules/python-editor { };
python-gnupg = callPackage ../development/python-modules/python-gnupg {};
python-uinput = callPackage ../development/python-modules/python-uinput {};
python-sybase = callPackage ../development/python-modules/sybase {};
alot = buildPythonPackage rec {
rev = "0.5.1";
name = "alot-${rev}";
disabled = isPy3k;
src = pkgs.fetchFromGitHub {
owner = "pazz";
repo = "alot";
inherit rev;
sha256 = "0ipkhc5wllfq78lg47aiq4qih0yjq8ad9xkrbgc88xk8pk9166i8";
};
postPatch = ''
substituteInPlace alot/defaults/alot.rc.spec \
--replace "themes_dir = string(default=None)" \
"themes_dir = string(default='$out/share/themes')"
'';
propagatedBuildInputs =
[ self.notmuch
self.urwid
self.urwidtrees
self.twisted
self.python_magic
self.configobj
self.pygpgme
self.mock
];
postInstall = ''
mkdir -p $out/share
cp -r extra/themes $out/share
wrapProgram $out/bin/alot \
--prefix LD_LIBRARY_PATH : '${pkgs.lib.makeLibraryPath [ pkgs.notmuch pkgs.file pkgs.gpgme ]}'
'';
meta = {
homepage = https://github.com/pazz/alot;
description = "Terminal MUA using notmuch mail";
platforms = platforms.linux;
maintainers = with maintainers; [ garbas ];
};
};
anyjson = buildPythonPackage rec {
name = "anyjson-0.3.3";
# The tests are written in a python2 syntax but anyjson is python3 valid
doCheck = !isPy3k;
src = pkgs.fetchurl {
url = "mirror://pypi/a/anyjson/${name}.tar.gz";
sha256 = "37812d863c9ad3e35c0734c42e0bf0320ce8c3bed82cd20ad54cb34d158157ba";
};
buildInputs = with self; [ self.nose ];
meta = {
homepage = https://pypi.python.org/pypi/anyjson/;
description = "Wrapper that selects the best available JSON implementation";
};
};
amqp = buildPythonPackage rec {
name = "amqp-${version}";
version = "2.1.4";
disabled = pythonOlder "2.6";
src = pkgs.fetchurl {
url = "mirror://pypi/a/amqp/${name}.tar.gz";
sha256 = "1ybywzkd840v1qvb1p2bs08js260vq1jscjg8182hv7bmwacqy0k";
};
buildInputs = with self; [ pytest case ];
propagatedBuildInputs = with self; [ vine ];
meta = {
homepage = https://github.com/celery/py-amqp;
description = "Python client for the Advanced Message Queuing Procotol (AMQP). This is a fork of amqplib which is maintained by the Celery project";
license = licenses.lgpl21;
};
};
amqplib = callPackage ../development/python-modules/amqplib {};
<