mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-17 23:36:17 +01:00
Merge pull request #173090 from dotlambda/odoo-packageOverrides
odoo: use packageOverrides
This commit is contained in:
commit
4e2d2e8e21
3 changed files with 68 additions and 83 deletions
|
@ -2,19 +2,74 @@
|
|||
, lib
|
||||
, fetchurl
|
||||
, python3
|
||||
, python3Packages
|
||||
, nodePackages
|
||||
, wkhtmltopdf
|
||||
, callPackage
|
||||
}:
|
||||
|
||||
with python3Packages;
|
||||
|
||||
let
|
||||
werkzeug = python3Packages.callPackage ../../../development/python-modules/werkzeug/1.nix {};
|
||||
in
|
||||
|
||||
buildPythonApplication rec {
|
||||
python = python3.override {
|
||||
packageOverrides = self: super: {
|
||||
click = super.click.overridePythonAttrs (old: rec {
|
||||
version = "7.1.2";
|
||||
src = old.src.override {
|
||||
inherit version;
|
||||
sha256 = "d2b5255c7c6349bc1bd1e59e08cd12acbbd63ce649f2588755783aa94dfb6b1a";
|
||||
};
|
||||
});
|
||||
flask = super.flask.overridePythonAttrs (old: rec {
|
||||
version = "1.1.4";
|
||||
src = old.src.override {
|
||||
inherit version;
|
||||
sha256 = "0fbeb6180d383a9186d0d6ed954e0042ad9f18e0e8de088b2b419d526927d196";
|
||||
};
|
||||
});
|
||||
itsdangerous = super.itsdangerous.overridePythonAttrs (old: rec {
|
||||
version = "1.1.0";
|
||||
src = old.src.override {
|
||||
inherit version;
|
||||
sha256 = "321b033d07f2a4136d3ec762eac9f16a10ccd60f53c0c91af90217ace7ba1f19";
|
||||
};
|
||||
});
|
||||
jinja2 = super.jinja2.overridePythonAttrs (old: rec {
|
||||
version = "2.11.3";
|
||||
src = old.src.override {
|
||||
inherit version;
|
||||
sha256 = "a6d58433de0ae800347cab1fa3043cebbabe8baa9d29e668f1c768cb87a333c6";
|
||||
};
|
||||
});
|
||||
markupsafe = super.markupsafe.overridePythonAttrs (old: rec {
|
||||
version = "2.0.1";
|
||||
src = old.src.override {
|
||||
inherit version;
|
||||
sha256 = "594c67807fb16238b30c44bdf74f36c02cdf22d1c8cda91ef8a0ed8dabf5620a";
|
||||
};
|
||||
});
|
||||
werkzeug = super.werkzeug.overridePythonAttrs (old: rec {
|
||||
version = "1.0.1";
|
||||
src = old.src.override {
|
||||
inherit version;
|
||||
sha256 = "6c80b1e5ad3665290ea39320b91e1be1e0d5f60652b964a3070216de83d2e47c";
|
||||
};
|
||||
checkInputs = old.checkInputs ++ (with self; [
|
||||
requests
|
||||
]);
|
||||
disabledTests = old.disabledTests ++ [
|
||||
# ResourceWarning: unclosed file
|
||||
"test_basic"
|
||||
"test_date_to_unix"
|
||||
"test_easteregg"
|
||||
"test_file_rfc2231_filename_continuations"
|
||||
"test_find_terminator"
|
||||
"test_save_to_pathlib_dst"
|
||||
];
|
||||
disabledTestPaths = old.disabledTestPaths ++ [
|
||||
# ResourceWarning: unclosed file
|
||||
"tests/test_http.py"
|
||||
];
|
||||
});
|
||||
};
|
||||
};
|
||||
in python.pkgs.buildPythonApplication rec {
|
||||
pname = "odoo";
|
||||
|
||||
major = "15";
|
||||
|
@ -23,6 +78,8 @@ buildPythonApplication rec {
|
|||
|
||||
version = "${major}.${minor}.${patch}";
|
||||
|
||||
format = "setuptools";
|
||||
|
||||
# latest release is at https://github.com/odoo/docker/blob/master/15.0/Dockerfile
|
||||
src = fetchurl {
|
||||
url = "https://nightly.odoo.com/${major}.${minor}/nightly/src/odoo_${version}.tar.gz";
|
||||
|
@ -30,23 +87,12 @@ buildPythonApplication rec {
|
|||
hash = "sha256-mofV0mNCdyzJecp0XegZBR/5NzHjis9kbpsUA/KJbZg=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [
|
||||
setuptools
|
||||
wheel
|
||||
mock
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
wkhtmltopdf
|
||||
nodePackages.rtlcss
|
||||
];
|
||||
|
||||
# needs some investigation
|
||||
doCheck = false;
|
||||
|
||||
makeWrapperArgs = [ "--prefix" "PATH" ":" "${lib.makeBinPath [ wkhtmltopdf nodePackages.rtlcss ]}" ];
|
||||
|
||||
propagatedBuildInputs = [
|
||||
propagatedBuildInputs = with python.pkgs; [
|
||||
Babel
|
||||
chardet
|
||||
decorator
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
, pythonOlder
|
||||
, pytz
|
||||
, six
|
||||
, werkzeug
|
||||
}:
|
||||
|
||||
buildPythonPackage rec {
|
||||
|
@ -25,7 +26,7 @@ buildPythonPackage rec {
|
|||
hash = "sha256-zOxlC4NdSBkhOMhTKa4Dc15s7VjpstnCFG1shMBvpT4=";
|
||||
};
|
||||
|
||||
patches = [
|
||||
patches = lib.optionals (lib.versionAtLeast werkzeug.version "2.1.0") [
|
||||
./werkzeug-2.1.0-compat.patch
|
||||
];
|
||||
|
||||
|
|
|
@ -1,62 +0,0 @@
|
|||
{ lib, stdenv, buildPythonPackage, fetchPypi
|
||||
, itsdangerous, hypothesis
|
||||
, pytestCheckHook, requests
|
||||
, pytest-timeout
|
||||
, isPy3k
|
||||
}:
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "Werkzeug";
|
||||
version = "1.0.1";
|
||||
|
||||
src = fetchPypi {
|
||||
inherit pname version;
|
||||
sha256 = "6c80b1e5ad3665290ea39320b91e1be1e0d5f60652b964a3070216de83d2e47c";
|
||||
};
|
||||
|
||||
propagatedBuildInputs = [ itsdangerous ];
|
||||
checkInputs = [ pytestCheckHook requests hypothesis pytest-timeout ];
|
||||
|
||||
postPatch = ''
|
||||
# ResourceWarning causes tests to fail
|
||||
rm tests/test_routing.py
|
||||
'';
|
||||
|
||||
disabledTests = [
|
||||
"test_save_to_pathlib_dst"
|
||||
"test_cookie_maxsize"
|
||||
"test_cookie_samesite_attribute"
|
||||
"test_cookie_samesite_invalid"
|
||||
"test_range_parsing"
|
||||
"test_content_range_parsing"
|
||||
"test_http_date_lt_1000"
|
||||
"test_best_match_works"
|
||||
"test_date_to_unix"
|
||||
"test_easteregg"
|
||||
|
||||
# Seems to be a problematic test-case:
|
||||
#
|
||||
# > warnings.warn(pytest.PytestUnraisableExceptionWarning(msg))
|
||||
# E pytest.PytestUnraisableExceptionWarning: Exception ignored in: <_io.FileIO [closed]>
|
||||
# E
|
||||
# E Traceback (most recent call last):
|
||||
# E File "/nix/store/cwv8aj4vsqvimzljw5dxsxy663vjgibj-python3.9-Werkzeug-1.0.1/lib/python3.9/site-packages/werkzeug/formparser.py", line 318, in parse_multipart_headers
|
||||
# E return Headers(result)
|
||||
# E ResourceWarning: unclosed file <_io.FileIO name=11 mode='rb+' closefd=True>
|
||||
"test_basic_routing"
|
||||
"test_merge_slashes_match"
|
||||
"test_merge_slashes_build"
|
||||
"TestMultiPart"
|
||||
"TestHTTPUtility"
|
||||
] ++ lib.optionals stdenv.isDarwin [
|
||||
"test_get_machine_id"
|
||||
];
|
||||
|
||||
meta = with lib; {
|
||||
homepage = "https://palletsprojects.com/p/werkzeug/";
|
||||
description = "A WSGI utility library for Python";
|
||||
license = licenses.bsd3;
|
||||
maintainers = [ ];
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in a new issue