File tree Expand file tree Collapse file tree 7 files changed +72
-5
lines changed Expand file tree Collapse file tree 7 files changed +72
-5
lines changed Original file line number Diff line number Diff line change 74
74
with :
75
75
token : ${{ secrets.CODECOV_TOKEN }}
76
76
77
+ test-pyinstaller-build :
78
+ name : Test pyinstaller
79
+ runs-on : ubuntu-latest
80
+ steps :
81
+ - uses : actions/checkout@v4
82
+ - name : Set up Python
83
+ uses : actions/setup-python@v5
84
+ with :
85
+ python-version : 3.12
86
+ - name : Install package and dev dependencies
87
+ run : |
88
+ python -m pip install --upgrade pip
89
+ pip install .
90
+ pip install pytest pyinstaller
91
+ - name : Unit tests
92
+ run : pytest -v --pyargs cmap.__pyinstaller
93
+
77
94
deploy :
78
95
name : Deploy
79
96
needs : test
Original file line number Diff line number Diff line change @@ -75,6 +75,10 @@ dev = [
75
75
" pyqt6" ,
76
76
]
77
77
78
+ [project .entry-points ."pyinstaller40" ]
79
+ hook-dirs = " cmap.__pyinstaller:get_hook_dirs"
80
+ tests = " cmap.__pyinstaller:get_test_dirs"
81
+
78
82
[project .urls ]
79
83
Homepage = " https://github.com/pyapp-kit/cmap"
80
84
Repository = " https://github.com/pyapp-kit/cmap"
@@ -139,6 +143,9 @@ filterwarnings = [
139
143
" ignore:datetime.datetime.utcfromtimestamp:DeprecationWarning" ,
140
144
" ignore::DeprecationWarning:docstring_parser" ,
141
145
" ignore:Pyarrow will become a required dependency of pandas" ,
146
+ " ignore::DeprecationWarning:Pyinstaller" ,
147
+ " ignore::DeprecationWarning:pkg_resources" ,
148
+ " ignore::DeprecationWarning:altgraph" ,
142
149
]
143
150
144
151
# https://mypy.readthedocs.io/en/stable/config_file.html
Original file line number Diff line number Diff line change
1
+ from os .path import dirname
2
+
3
+ HERE = dirname (__file__ )
4
+
5
+
6
+ def get_hook_dirs () -> list [str ]:
7
+ return [HERE ]
8
+
9
+
10
+ def get_test_dirs () -> list [str ]:
11
+ return [HERE ]
Original file line number Diff line number Diff line change
1
+ import os
2
+
3
+ os .environ ["PYI_BUILDER_CLEANUP" ] = "0"
4
+ from PyInstaller .utils .conftest import * # noqa
Original file line number Diff line number Diff line change
1
+ from PyInstaller .utils .hooks import collect_all
2
+
3
+ datas , binaries , hiddenimports = collect_all (
4
+ "cmap" ,
5
+ # include_datas=["data/"],
6
+ exclude_datas = ["**/__pycache__/" ],
7
+ # filter_submodules=lambda x: x.startswith("cmap.data"),
8
+ )
9
+ excludedimports = [
10
+ "bokeh" ,
11
+ "colorspacious" ,
12
+ "matplotlib" ,
13
+ "napari" ,
14
+ "numpy.typing" ,
15
+ "pydantic_core" ,
16
+ "pydantic" ,
17
+ "numba" ,
18
+ "pygfx" ,
19
+ "pyqtgraph" ,
20
+ "tkinter" ,
21
+ "typing_extensions" ,
22
+ "viscm" ,
23
+ "vispy" ,
24
+ ]
Original file line number Diff line number Diff line change
1
+ from typing import Any
2
+
3
+
4
+ def test_pyi_cmap_data (pyi_builder : Any ) -> None :
5
+ pyi_builder .test_source ("""
6
+ import cmap
7
+ assert isinstance(cmap.Colormap('viridis'), cmap.Colormap)
8
+ assert isinstance(cmap.Colormap('crameri:acton'), cmap.Colormap)
9
+ """ )
Original file line number Diff line number Diff line change 21
21
22
22
import numpy as np
23
23
24
- try :
25
- from pydantic import model_serializer
26
- except ImportError :
27
- model_serializer = lambda x : x # noqa: E731
28
-
29
24
from . import _external
30
25
31
26
if TYPE_CHECKING :
You can’t perform that action at this time.
0 commit comments