1{
2 lib,
3 buildPythonPackage,
4 fetchPypi,
5 setuptools,
6 pyyaml,
7 jinja2,
8 mock,
9 fetchpatch2,
10 pytestCheckHook,
11 distutils,
12}:
13
14buildPythonPackage rec {
15 pname = "webassets";
16 version = "2.0";
17 pyproject = true;
18
19 src = fetchPypi {
20 inherit pname version;
21 hash = "sha256-FnEyM3Z3yM7clwUJD21I2j+yYsjgsnc7KfM1LwUBgc0=";
22 };
23
24 patches = [
25 # remove nose and extra mock
26 (fetchpatch2 {
27 name = "remove-nose-and-mock.patch";
28 url = "https://github.com/miracle2k/webassets/commit/26e203929eebbb4cdbb9967cf47fefa95df8f24d.patch?full_index=1";
29 hash = "sha256-+jrMT6Sl/MOLkleUEDZkzRd5tzBTXZYNoCXRrTFVtq4=";
30 excludes = [
31 "requirements-dev.pip"
32 "tox.ini"
33 ];
34 })
35 (fetchpatch2 {
36 name = "fix-missing-zope-skip.patch";
37 url = "https://github.com/miracle2k/webassets/commit/3bfb5ea8223c46c60b922fdbbda36d9b8c5e9c9c.patch?full_index=1";
38 hash = "sha256-dV8bp6vYr56mZpzw5C7ac4rXri04o4MrAhwfWUXLe4s=";
39 })
40 ./migrate_test_setup_to_pytest.patch
41 ];
42
43 build-system = [ setuptools ];
44
45 dependencies = [ pyyaml ];
46
47 nativeCheckInputs = [
48 jinja2
49 mock
50 pytestCheckHook
51 distutils
52 ];
53
54 postPatch = ''
55 # Fix thread attribute "isAlive"
56 substituteInPlace tests/test_script.py \
57 --replace-fail "isAlive" "is_alive"
58 '';
59
60 disabledTests = [
61 "TestFilterBaseClass"
62 "TestAutoprefixer6Filter"
63 "TestBabel"
64 ];
65
66 meta = {
67 description = "Media asset management for Python, with glue code for various web frameworks";
68 mainProgram = "webassets";
69 homepage = "https://github.com/miracle2k/webassets/";
70 license = lib.licenses.bsd2;
71 maintainers = [ ];
72 };
73}