mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-08-25 17:55:21 +00:00
Merge master into staging-next
This commit is contained in:
@@ -1,41 +1,66 @@
|
||||
{ lib
|
||||
, stdenv
|
||||
, fetchPypi
|
||||
, buildPythonPackage
|
||||
, isPy27
|
||||
, ansible
|
||||
, pyyaml
|
||||
, ruamel-yaml
|
||||
, rich
|
||||
, pytestCheckHook
|
||||
, pytest-xdist
|
||||
, git
|
||||
, wcmatch
|
||||
, enrich
|
||||
, fetchPypi
|
||||
, python
|
||||
, ansible
|
||||
, enrich
|
||||
, flaky
|
||||
, pyyaml
|
||||
, rich
|
||||
, ruamel-yaml
|
||||
, tenacity
|
||||
, wcmatch
|
||||
, yamllint
|
||||
, pytest-xdist
|
||||
, pytestCheckHook
|
||||
}:
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "ansible-lint";
|
||||
version = "5.0.2";
|
||||
version = "5.0.8";
|
||||
disabled = isPy27;
|
||||
format = "pyproject";
|
||||
|
||||
src = fetchPypi {
|
||||
inherit pname version;
|
||||
sha256 = "sha256-vgt/KqNozTPaON/I19SybBZuo7bbl3Duq5dTBTMlj44=";
|
||||
sha256 = "sha256-tnuWKEB66bwVuwu3H3mHG99ZP+/msGhMDMRL5fyQgD8=";
|
||||
};
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace src/ansiblelint/file_utils.py \
|
||||
--replace 'raise RuntimeError("Unable to determine file type for %s" % pathex)' 'return "playbook"'
|
||||
'';
|
||||
|
||||
buildInputs = [ python ];
|
||||
|
||||
propagatedBuildInputs = [ ansible enrich pyyaml rich ruamel-yaml wcmatch ];
|
||||
propagatedBuildInputs = [
|
||||
ansible
|
||||
enrich
|
||||
flaky
|
||||
pyyaml
|
||||
rich
|
||||
ruamel-yaml
|
||||
tenacity
|
||||
wcmatch
|
||||
yamllint
|
||||
];
|
||||
|
||||
checkInputs = [ pytestCheckHook pytest-xdist git ];
|
||||
checkInputs = [
|
||||
pytest-xdist
|
||||
pytestCheckHook
|
||||
];
|
||||
|
||||
pytestFlagsArray = [
|
||||
"--numprocesses" "auto"
|
||||
];
|
||||
|
||||
postPatch = ''
|
||||
# Both patches are addressed in https://github.com/ansible-community/ansible-lint/pull/1549
|
||||
# and should be removed once merged upstream
|
||||
|
||||
# fixes test_get_yaml_files_umlaut and test_run_inside_role_dir
|
||||
substituteInPlace src/ansiblelint/file_utils.py \
|
||||
--replace 'os.path.join(root, name)' 'os.path.normpath(os.path.join(root, name))'
|
||||
# fixes test_custom_kinds
|
||||
substituteInPlace src/ansiblelint/file_utils.py \
|
||||
--replace "if name.endswith('.yaml') or name.endswith('.yml')" ""
|
||||
'';
|
||||
|
||||
preCheck = ''
|
||||
# ansible wants to write to $HOME and crashes if it can't
|
||||
@@ -46,27 +71,17 @@ buildPythonPackage rec {
|
||||
export PATH=$PATH:$PWD/src/ansiblelint
|
||||
ln -rs src/ansiblelint/__main__.py src/ansiblelint/ansible-lint
|
||||
patchShebangs src/ansiblelint/__main__.py
|
||||
|
||||
# create symlink like in the git repo so test_included_tasks does not fail
|
||||
ln -s ../roles examples/playbooks/roles
|
||||
'';
|
||||
|
||||
disabledTests = [
|
||||
# requires network
|
||||
"test_prerun_reqs_v1"
|
||||
"test_prerun_reqs_v2"
|
||||
# Assertion error with negative numbers; maybe requieres an ansible update?
|
||||
"test_negative"
|
||||
"test_example"
|
||||
"test_playbook"
|
||||
"test_included_tasks"
|
||||
"test_long_line"
|
||||
|
||||
"test_get_yaml_files_umlaut"
|
||||
"test_run_inside_role_dir"
|
||||
"test_role_handler_positive"
|
||||
];
|
||||
|
||||
# fails to run tests due to issues with temporary directory
|
||||
doCheck = !stdenv.isDarwin;
|
||||
|
||||
makeWrapperArgs = [ "--prefix PATH : ${lib.makeBinPath [ ansible ]}" ];
|
||||
|
||||
meta = with lib; {
|
||||
|
||||
78
pkgs/development/python-modules/ansible/base.nix
Normal file
78
pkgs/development/python-modules/ansible/base.nix
Normal file
@@ -0,0 +1,78 @@
|
||||
{ lib
|
||||
, buildPythonPackage
|
||||
, fetchPypi
|
||||
, installShellFiles
|
||||
, ansible-collections
|
||||
, cryptography
|
||||
, jinja2
|
||||
, junit-xml
|
||||
, lxml
|
||||
, ncclient
|
||||
, packaging
|
||||
, paramiko
|
||||
, pexpect
|
||||
, psutil
|
||||
, pycrypto
|
||||
, pyyaml
|
||||
, requests
|
||||
, scp
|
||||
, windowsSupport ? false, pywinrm
|
||||
, xmltodict
|
||||
}:
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "ansible-base";
|
||||
version = "2.10.9";
|
||||
|
||||
src = fetchPypi {
|
||||
inherit pname version;
|
||||
sha256 = "0l91bwbavjnaqsnb4c6f17xl7r0cvglz3rxqfs63aagw10z5sqq4";
|
||||
};
|
||||
|
||||
# ansible_connection is already wrapped, so don't pass it through
|
||||
# the python interpreter again, as it would break execution of
|
||||
# connection plugins.
|
||||
postPatch = ''
|
||||
substituteInPlace lib/ansible/executor/task_executor.py \
|
||||
--replace "[python," "["
|
||||
'';
|
||||
|
||||
nativeBuildInputs = [
|
||||
installShellFiles
|
||||
];
|
||||
|
||||
propagatedBuildInputs = [
|
||||
# depend on ansible-collections instead of the other way around
|
||||
ansible-collections
|
||||
# from requirements.txt
|
||||
cryptography
|
||||
jinja2
|
||||
packaging
|
||||
pyyaml
|
||||
# optional dependencies
|
||||
junit-xml
|
||||
lxml
|
||||
ncclient
|
||||
paramiko
|
||||
pexpect
|
||||
psutil
|
||||
pycrypto
|
||||
requests
|
||||
scp
|
||||
xmltodict
|
||||
] ++ lib.optional windowsSupport pywinrm;
|
||||
|
||||
postInstall = ''
|
||||
installManPage docs/man/man1/*.1
|
||||
'';
|
||||
|
||||
# internal import errors, missing dependencies
|
||||
doCheck = false;
|
||||
|
||||
meta = with lib; {
|
||||
description = "Radically simple IT automation";
|
||||
homepage = "https://www.ansible.com";
|
||||
license = licenses.gpl3Plus;
|
||||
maintainers = with maintainers; [ hexa ];
|
||||
};
|
||||
}
|
||||
77
pkgs/development/python-modules/ansible/collections.nix
Normal file
77
pkgs/development/python-modules/ansible/collections.nix
Normal file
@@ -0,0 +1,77 @@
|
||||
{ lib
|
||||
, buildPythonPackage
|
||||
, fetchPypi
|
||||
, ansible-base
|
||||
, jsonschema
|
||||
, jxmlease
|
||||
, ncclient
|
||||
, netaddr
|
||||
, paramiko
|
||||
, pynetbox
|
||||
, scp
|
||||
, textfsm
|
||||
, ttp
|
||||
, xmltodict
|
||||
, withJunos ? false
|
||||
, withNetbox ? false
|
||||
}:
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "ansible";
|
||||
version = "3.4.0";
|
||||
format = "setuptools";
|
||||
|
||||
src = fetchPypi {
|
||||
inherit pname version;
|
||||
sha256 = "096rbgz730njk0pg8qnc27mmz110wqrw354ca9gasb7rqg0f4d6a";
|
||||
};
|
||||
|
||||
postPatch = ''
|
||||
# make ansible-base depend on ansible-collection, not the other way around
|
||||
sed -i '/ansible-base/d' setup.py
|
||||
'';
|
||||
|
||||
propagatedBuildInputs = lib.unique ([
|
||||
# Support ansible collections by default, make all others optional
|
||||
# ansible.netcommon
|
||||
jxmlease
|
||||
ncclient
|
||||
netaddr
|
||||
paramiko
|
||||
xmltodict
|
||||
# ansible.posix
|
||||
# ansible.utils
|
||||
jsonschema
|
||||
textfsm
|
||||
ttp
|
||||
xmltodict
|
||||
# ansible.windows
|
||||
|
||||
# lots of collections with dedicated requirements.txt and pyproject.toml files,
|
||||
# add the dependencies for the collections you need conditionally and install
|
||||
# ansible using overrides to enable the collections you need.
|
||||
] ++ lib.optionals (withJunos) [
|
||||
# ansible_collections/junipernetworks/junos/requirements.txt
|
||||
jxmlease
|
||||
ncclient
|
||||
paramiko
|
||||
scp
|
||||
xmltodict
|
||||
] ++ lib.optionals (withNetbox) [
|
||||
# ansible_collections/netbox/netbox/pyproject.toml
|
||||
pynetbox
|
||||
]);
|
||||
|
||||
# don't try and fail to strip 48000+ non strippable files, it takes >5 minutes!
|
||||
dontStrip = true;
|
||||
|
||||
# difficult to test
|
||||
doCheck = false;
|
||||
|
||||
meta = with lib; {
|
||||
description = "Radically simple IT automation";
|
||||
homepage = "Radically simple IT automation";
|
||||
license = licenses.gpl3Plus;
|
||||
maintainers = with maintainers; [ hexa ];
|
||||
};
|
||||
}
|
||||
@@ -18,13 +18,13 @@
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "ansible";
|
||||
version = "2.9.12";
|
||||
version = "2.9.21";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "ansible";
|
||||
repo = "ansible";
|
||||
rev = "v${version}";
|
||||
sha256 = "0c794k0cyl54807sh9in0l942ah6g6wlz5kf3qvy5lhd581zlgyb";
|
||||
sha256 = "1pfiwq2wfw11vmxdq2yhk86hm5jljlrnphlzfjr01kwzfikkdp5m";
|
||||
};
|
||||
|
||||
prePatch = ''
|
||||
@@ -42,6 +42,8 @@ buildPythonPackage rec {
|
||||
pythonImportsCheck = [ "hickle" ];
|
||||
|
||||
meta = {
|
||||
# incompatible with h5py>=3.0, see https://github.com/telegraphic/hickle/issues/143
|
||||
broken = true;
|
||||
description = "Serialize Python data to HDF5";
|
||||
homepage = "https://github.com/telegraphic/hickle";
|
||||
license = lib.licenses.mit;
|
||||
|
||||
33
pkgs/development/python-modules/jxmlease/default.nix
Normal file
33
pkgs/development/python-modules/jxmlease/default.nix
Normal file
@@ -0,0 +1,33 @@
|
||||
{ lib
|
||||
, buildPythonPackage
|
||||
, fetchPypi
|
||||
, lxml
|
||||
, python
|
||||
}:
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "jxmlease";
|
||||
version = "1.0.3";
|
||||
|
||||
src = fetchPypi {
|
||||
inherit pname version;
|
||||
sha256 = "17l3w3ak07p72s8kv8hg0ilxs0kkxjn7bfwnl3g2cw58v1siab31";
|
||||
};
|
||||
|
||||
propagatedBuildInputs = [
|
||||
lxml
|
||||
];
|
||||
|
||||
checkPhase = ''
|
||||
runHook preCheck
|
||||
${python.interpreter} -m unittest discover -v
|
||||
runHook postCheck
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "Converts between XML and intelligent Python data structures";
|
||||
homepage = "https://github.com/Juniper/jxmlease";
|
||||
license = licenses.mit;
|
||||
maintainers = with maintainers; [ hexa ];
|
||||
};
|
||||
}
|
||||
@@ -7,13 +7,13 @@
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "karton-config-extractor";
|
||||
version = "1.1.1";
|
||||
version = "2.0.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "CERT-Polska";
|
||||
repo = pname;
|
||||
rev = "v${version}";
|
||||
sha256 = "14592b9vq2iza5agxr29z1mh536if7a9p9hvyjnibsrv22mzwz7l";
|
||||
sha256 = "sha256-vijyqki2x813H2xbmz2JIXlh87J5l6NFoZcOu8xi61o=";
|
||||
};
|
||||
|
||||
propagatedBuildInputs = [
|
||||
@@ -22,8 +22,6 @@ buildPythonPackage rec {
|
||||
];
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace requirements.txt \
|
||||
--replace "karton-core==4.2.0" "karton-core"
|
||||
substituteInPlace requirements.txt \
|
||||
--replace "malduck==4.1.0" "malduck"
|
||||
'';
|
||||
|
||||
@@ -14,16 +14,6 @@ buildPythonPackage rec {
|
||||
|
||||
LC_ALL = "en_US.utf-8";
|
||||
|
||||
# remove version bounds
|
||||
prePatch = ''
|
||||
sed -i -e 's/==.*//g' requirements.txt
|
||||
''
|
||||
# ipaddress is part of the standard library of Python 3.3+
|
||||
+ lib.optionalString (!pythonOlder "3.3") ''
|
||||
substituteInPlace requirements.txt \
|
||||
--replace "ipaddress" ""
|
||||
'';
|
||||
|
||||
nativeBuildInputs = [ glibcLocales ];
|
||||
propagatedBuildInputs = [ simplejson six ] ++ lib.optional (pythonOlder "3.3") ipaddress;
|
||||
|
||||
|
||||
@@ -21,6 +21,9 @@
|
||||
, installShellFiles
|
||||
}:
|
||||
|
||||
let
|
||||
debuggerName = lib.strings.getName debugger;
|
||||
in
|
||||
buildPythonPackage rec {
|
||||
version = "4.3.1";
|
||||
pname = "pwntools";
|
||||
@@ -30,11 +33,15 @@ buildPythonPackage rec {
|
||||
sha256 = "12ja913kz8wl4afrmpzxh9fx6j7rcwc2vqzkvfr1fxn42gkqhqf4";
|
||||
};
|
||||
|
||||
# Upstream has set an upper bound on unicorn because of https://github.com/Gallopsled/pwntools/issues/1538,
|
||||
# but since that is a niche use case and it requires extra work to get unicorn 1.0.2rc3 to work we relax
|
||||
# the bound here. Check if this is still necessary when updating!
|
||||
postPatch = ''
|
||||
# Upstream has set an upper bound on unicorn because of https://github.com/Gallopsled/pwntools/issues/1538,
|
||||
# but since that is a niche use case and it requires extra work to get unicorn 1.0.2rc3 to work we relax
|
||||
# the bound here. Check if this is still necessary when updating!
|
||||
sed -i 's/unicorn>=1.0.2rc1,<1.0.2rc4/unicorn>=1.0.2rc1/' setup.py
|
||||
|
||||
# Upstream hardcoded the check for the command `gdb-multiarch`;
|
||||
# Forcefully use the provided debugger, as `gdb` (hence `pwndbg`) is built with multiarch in `nixpkgs`.
|
||||
sed -i 's/gdb-multiarch/${debuggerName}/' pwnlib/gdb.py
|
||||
'';
|
||||
|
||||
nativeBuildInputs = [
|
||||
@@ -68,7 +75,7 @@ buildPythonPackage rec {
|
||||
|
||||
postFixup = ''
|
||||
mkdir -p "$out/bin"
|
||||
makeWrapper "${debugger}/bin/${lib.strings.getName debugger}" "$out/bin/pwntools-gdb"
|
||||
makeWrapper "${debugger}/bin/${debuggerName}" "$out/bin/pwntools-gdb"
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
|
||||
49
pkgs/development/python-modules/pynetbox/default.nix
Normal file
49
pkgs/development/python-modules/pynetbox/default.nix
Normal file
@@ -0,0 +1,49 @@
|
||||
{ lib
|
||||
, buildPythonPackage
|
||||
, fetchFromGitHub
|
||||
, setuptools-scm
|
||||
, requests
|
||||
, six
|
||||
, pytestCheckHook
|
||||
, pyyaml
|
||||
}:
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "pynetbox";
|
||||
version = "6.1.2";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "netbox-community";
|
||||
repo = pname;
|
||||
rev = "v${version}";
|
||||
sha256 = "0di07rny3gqdfb0rf7hm3x03rpn7rydpv3lrl7cak2ccpqm0wzhl";
|
||||
};
|
||||
|
||||
SETUPTOOLS_SCM_PRETEND_VERSION = version;
|
||||
|
||||
nativeBuildInputs = [
|
||||
setuptools-scm
|
||||
];
|
||||
|
||||
propagatedBuildInputs = [
|
||||
requests
|
||||
six
|
||||
];
|
||||
|
||||
checkInputs = [
|
||||
pytestCheckHook
|
||||
pyyaml
|
||||
];
|
||||
|
||||
disabledTestPaths = [
|
||||
# requires docker for integration test
|
||||
"tests/integration"
|
||||
];
|
||||
|
||||
meta = with lib; {
|
||||
description = "API client library for Netbox";
|
||||
homepage = "https://github.com/netbox-community/pynetbox";
|
||||
license = licenses.asl20;
|
||||
maintainers = with maintainers; [ hexa ];
|
||||
};
|
||||
}
|
||||
@@ -12,12 +12,12 @@
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "python-telegram-bot";
|
||||
version = "13.4.1";
|
||||
version = "13.5";
|
||||
disabled = !isPy3k;
|
||||
|
||||
src = fetchPypi {
|
||||
inherit pname version;
|
||||
sha256 = "141w3701jjl460702xddqvi3hswp24jnkl6cakvz2aqrmcyxq7sc";
|
||||
sha256 = "sha256-g9v0zUYyf9gYu2ZV8lCAJKCt5o69s1RNo1xGmtwjvds=";
|
||||
};
|
||||
|
||||
propagatedBuildInputs = [
|
||||
|
||||
31
pkgs/development/python-modules/pyxb/default.nix
Normal file
31
pkgs/development/python-modules/pyxb/default.nix
Normal file
@@ -0,0 +1,31 @@
|
||||
{ lib
|
||||
, buildPythonPackage
|
||||
, fetchPypi
|
||||
, python
|
||||
}:
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "PyXB";
|
||||
version = "1.2.6";
|
||||
format = "setuptools";
|
||||
|
||||
src = fetchPypi {
|
||||
inherit pname version;
|
||||
sha256 = "1d17pyixbfvjyi2lb0cfp0ch8wwdf44mmg3r5pwqhyyqs66z601a";
|
||||
};
|
||||
|
||||
pythonImportsCheck = [
|
||||
"pyxb"
|
||||
];
|
||||
|
||||
# tests don't complete
|
||||
# https://github.com/pabigot/pyxb/issues/130
|
||||
doCheck = false;
|
||||
|
||||
meta = with lib; {
|
||||
description = "Python XML Schema Bindings";
|
||||
homepage = "https://github.com/pabigot/pyxb";
|
||||
license = licenses.asl20;
|
||||
maintainers = with maintainers; [ hexa ];
|
||||
};
|
||||
}
|
||||
@@ -29,11 +29,11 @@
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "sentry-sdk";
|
||||
version = "1.0.0";
|
||||
version = "1.1.0";
|
||||
|
||||
src = fetchPypi {
|
||||
inherit pname version;
|
||||
sha256 = "71de00c9711926816f750bc0f57ef2abbcb1bfbdf5378c601df7ec978f44857a";
|
||||
sha256 = "sha256-wSJ9ONyjFbo1GCNz8SnD4nIujtmZ5SWE5qyn0oeHBzk=";
|
||||
};
|
||||
|
||||
checkInputs = [ blinker botocore chalice django flask tornado bottle rq falcon sqlalchemy werkzeug trytond
|
||||
|
||||
93
pkgs/development/python-modules/ttp/default.nix
Normal file
93
pkgs/development/python-modules/ttp/default.nix
Normal file
@@ -0,0 +1,93 @@
|
||||
{ lib
|
||||
, buildPythonPackage
|
||||
, callPackage
|
||||
, fetchFromGitHub
|
||||
, cerberus
|
||||
, configparser
|
||||
, deepdiff
|
||||
, geoip2
|
||||
, jinja2
|
||||
, openpyxl
|
||||
, tabulate
|
||||
, yangson
|
||||
, pytestCheckHook
|
||||
, pyyaml
|
||||
}:
|
||||
|
||||
let
|
||||
ttp_templates = callPackage ./templates.nix { };
|
||||
in
|
||||
buildPythonPackage rec {
|
||||
pname = "ttp";
|
||||
version = "0.6.0";
|
||||
format = "setuptools";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "dmulyalin";
|
||||
repo = pname;
|
||||
rev = version;
|
||||
sha256 = "08pglwmnhdrsj9rgys1zclhq1h597izb0jq7waahpdabfg25v2sw";
|
||||
};
|
||||
|
||||
propagatedBuildInputs = [
|
||||
# https://github.com/dmulyalin/ttp/blob/master/docs/source/Installation.rst#additional-dependencies
|
||||
cerberus
|
||||
configparser
|
||||
deepdiff
|
||||
geoip2
|
||||
jinja2
|
||||
# n2g unpackaged
|
||||
# netmiko unpackaged
|
||||
# nornir unpackaged
|
||||
openpyxl
|
||||
tabulate
|
||||
yangson
|
||||
];
|
||||
|
||||
pythonImportsCheck = [
|
||||
"ttp"
|
||||
];
|
||||
|
||||
checkInputs = [
|
||||
pytestCheckHook
|
||||
pyyaml
|
||||
ttp_templates
|
||||
];
|
||||
|
||||
disabledTestPaths = [
|
||||
# missing package n2g
|
||||
"test/pytest/test_N2G_formatter.py"
|
||||
];
|
||||
|
||||
disabledTests = [
|
||||
# data structure mismatches
|
||||
"test_yangson_validate"
|
||||
"test_yangson_validate_yang_lib_in_output_tag_data"
|
||||
"test_yangson_validate_multiple_inputs_mode_per_input_with_yang_lib_in_file"
|
||||
"test_yangson_validate_multiple_inputs_mode_per_template"
|
||||
"test_yangson_validate_multiple_inputs_mode_per_input_with_yang_lib_in_file_to_xml"
|
||||
"test_yangson_validate_multiple_inputs_mode_per_template_to_xml"
|
||||
"test_adding_data_from_files"
|
||||
"test_lookup_include_csv"
|
||||
"test_inputs_with_template_base_path"
|
||||
"test_group_inputs"
|
||||
"test_inputs_url_filters_extensions"
|
||||
# ValueError: dictionary update sequence element #0 has length 1; 2 is required
|
||||
"test_include_attribute_with_yaml_loader"
|
||||
# TypeError: string indices must be integers
|
||||
"test_lookup_include_yaml"
|
||||
# missing package n2g
|
||||
"test_n2g_formatter"
|
||||
];
|
||||
|
||||
pytestFlagsArray = [
|
||||
"test/pytest"
|
||||
];
|
||||
|
||||
meta = with lib; {
|
||||
description = "Template Text Parser";
|
||||
homepage = "https://github.com/dmulyalin/ttp";
|
||||
license = licenses.mit;
|
||||
maintainers = with maintainers; [ hexa ];
|
||||
};
|
||||
}
|
||||
31
pkgs/development/python-modules/ttp/templates.nix
Normal file
31
pkgs/development/python-modules/ttp/templates.nix
Normal file
@@ -0,0 +1,31 @@
|
||||
{ lib
|
||||
, buildPythonPackage
|
||||
, fetchPypi
|
||||
}:
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "ttp-templates";
|
||||
version = "0.1.1";
|
||||
format = "setuptools";
|
||||
|
||||
src = fetchPypi {
|
||||
pname = "ttp_templates";
|
||||
inherit version;
|
||||
sha256 = "0vg7k733i8jqnfz8mpq8kzr2l7b7drk29zkzik91029f6w7li007";
|
||||
};
|
||||
|
||||
# drop circular dependency on ttp
|
||||
postPatch = ''
|
||||
substituteInPlace setup.py --replace '"ttp>=0.6.0"' ""
|
||||
'';
|
||||
|
||||
# circular dependency on ttp
|
||||
doCheck = false;
|
||||
|
||||
meta = with lib; {
|
||||
description = "Template Text Parser Templates";
|
||||
homepage = "https://github.com/dmulyalin/ttp_templates";
|
||||
license = licenses.mit;
|
||||
maintainers = with maintainers; [ hexa ];
|
||||
};
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
{ buildPythonPackage
|
||||
, pytest
|
||||
, nose
|
||||
, pytestCheckHook
|
||||
, cmake
|
||||
, scipy
|
||||
, scikitlearn
|
||||
, stdenv
|
||||
@@ -10,28 +10,52 @@
|
||||
, matplotlib
|
||||
, graphviz
|
||||
, datatable
|
||||
, hypothesis
|
||||
}:
|
||||
|
||||
buildPythonPackage {
|
||||
pname = "xgboost";
|
||||
inherit (xgboost) version src meta;
|
||||
|
||||
patches = [
|
||||
(substituteAll {
|
||||
src = ./lib-path-for-python.patch;
|
||||
libpath = "${xgboost}/lib";
|
||||
extention = stdenv.hostPlatform.extensions.sharedLibrary;
|
||||
})
|
||||
nativeBuildInputs = [ cmake ];
|
||||
buildInputs = [ xgboost ];
|
||||
propagatedBuildInputs = [ scipy ];
|
||||
checkInputs = [
|
||||
pytestCheckHook
|
||||
scikitlearn
|
||||
pandas
|
||||
matplotlib
|
||||
graphviz
|
||||
datatable
|
||||
hypothesis
|
||||
];
|
||||
|
||||
postPatch = "cd python-package";
|
||||
|
||||
propagatedBuildInputs = [ scipy ];
|
||||
buildInputs = [ xgboost ];
|
||||
checkInputs = [ nose pytest scikitlearn pandas matplotlib graphviz datatable ];
|
||||
|
||||
checkPhase = ''
|
||||
ln -sf ../demo .
|
||||
nosetests ../tests/python
|
||||
# Override existing logic for locating libxgboost.so which is not appropriate for Nix
|
||||
prePatch = let
|
||||
libPath = "${xgboost}/lib/libxgboost${stdenv.hostPlatform.extensions.sharedLibrary}";
|
||||
in ''
|
||||
echo 'find_lib_path = lambda: ["${libPath}"]' > python-package/xgboost/libpath.py
|
||||
'';
|
||||
|
||||
dontUseCmakeConfigure = true;
|
||||
|
||||
postPatch = ''
|
||||
cd python-package
|
||||
'';
|
||||
|
||||
preCheck = ''
|
||||
ln -sf ../demo .
|
||||
ln -s ${xgboost}/bin/xgboost ../xgboost
|
||||
'';
|
||||
|
||||
pytestFlagsArray = ["../tests/python"];
|
||||
disabledTestPaths = [
|
||||
# Requires internet access: https://github.com/dmlc/xgboost/blob/03cd087da180b7dff21bd8ef34997bf747016025/tests/python/test_ranking.py#L81
|
||||
"../tests/python/test_ranking.py"
|
||||
];
|
||||
disabledTests = [
|
||||
"test_cli_binary_classification"
|
||||
"test_model_compatibility"
|
||||
];
|
||||
|
||||
}
|
||||
|
||||
@@ -1,38 +0,0 @@
|
||||
diff --git a/python-package/xgboost/libpath.py b/python-package/xgboost/libpath.py
|
||||
index d87922c0..859a30fb 100644
|
||||
--- a/python-package/xgboost/libpath.py
|
||||
+++ b/python-package/xgboost/libpath.py
|
||||
@@ -19,32 +19,4 @@ def find_lib_path():
|
||||
lib_path: list(string)
|
||||
List of all found library path to xgboost
|
||||
"""
|
||||
- curr_path = os.path.dirname(os.path.abspath(os.path.expanduser(__file__)))
|
||||
- # make pythonpack hack: copy this directory one level upper for setup.py
|
||||
- dll_path = [curr_path, os.path.join(curr_path, '../../lib/'),
|
||||
- os.path.join(curr_path, './lib/'),
|
||||
- os.path.join(sys.prefix, 'xgboost')]
|
||||
- if sys.platform == 'win32':
|
||||
- if platform.architecture()[0] == '64bit':
|
||||
- dll_path.append(os.path.join(curr_path, '../../windows/x64/Release/'))
|
||||
- # hack for pip installation when copy all parent source directory here
|
||||
- dll_path.append(os.path.join(curr_path, './windows/x64/Release/'))
|
||||
- else:
|
||||
- dll_path.append(os.path.join(curr_path, '../../windows/Release/'))
|
||||
- # hack for pip installation when copy all parent source directory here
|
||||
- dll_path.append(os.path.join(curr_path, './windows/Release/'))
|
||||
- dll_path = [os.path.join(p, 'xgboost.dll') for p in dll_path]
|
||||
- elif sys.platform.startswith('linux') or sys.platform.startswith('freebsd'):
|
||||
- dll_path = [os.path.join(p, 'libxgboost.so') for p in dll_path]
|
||||
- elif sys.platform == 'darwin':
|
||||
- dll_path = [os.path.join(p, 'libxgboost.dylib') for p in dll_path]
|
||||
-
|
||||
- lib_path = [p for p in dll_path if os.path.exists(p) and os.path.isfile(p)]
|
||||
-
|
||||
- # From github issues, most of installation errors come from machines w/o compilers
|
||||
- if not lib_path and not os.environ.get('XGBOOST_BUILD_DOC', False):
|
||||
- raise XGBoostLibraryNotFound(
|
||||
- 'Cannot find XGBoost Library in the candidate path, ' +
|
||||
- 'did you install compilers and run build.sh in root path?\n'
|
||||
- 'List of candidates:\n' + ('\n'.join(dll_path)))
|
||||
- return lib_path
|
||||
+ return ["@libpath@/libxgboost@extention@"]
|
||||
44
pkgs/development/python-modules/yangson/default.nix
Normal file
44
pkgs/development/python-modules/yangson/default.nix
Normal file
@@ -0,0 +1,44 @@
|
||||
{ lib
|
||||
, buildPythonPackage
|
||||
, fetchPypi
|
||||
, setuptools-scm
|
||||
, pyxb
|
||||
, pytestCheckHook
|
||||
}:
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "yangson";
|
||||
version = "1.4.8";
|
||||
format = "setuptools";
|
||||
|
||||
src = fetchPypi {
|
||||
inherit pname version;
|
||||
sha256 = "11w4aq0w2rnkz1axgmw003z2snd4kc49dil6kp1ajlqnfh1pcx8m";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [
|
||||
setuptools-scm
|
||||
];
|
||||
|
||||
propagatedBuildInputs = [
|
||||
pyxb
|
||||
];
|
||||
|
||||
checkInputs = [
|
||||
pytestCheckHook
|
||||
];
|
||||
|
||||
pythonImportsCheck = [
|
||||
"yangson"
|
||||
];
|
||||
|
||||
meta = with lib; {
|
||||
description = "Library for working with data modelled in YANG";
|
||||
homepage = "https://github.com/CZ-NIC/yangson";
|
||||
license = with licenses; [
|
||||
gpl3Plus
|
||||
lgpl3Plus
|
||||
];
|
||||
maintainers = with maintainers; [ hexa ];
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user