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 7474 with :
7575 token : ${{ secrets.CODECOV_TOKEN }}
7676
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+
7794 deploy :
7895 name : Deploy
7996 needs : test
Original file line number Diff line number Diff line change @@ -75,6 +75,10 @@ dev = [
7575 " pyqt6" ,
7676]
7777
78+ [project .entry-points ."pyinstaller40" ]
79+ hook-dirs = " cmap.__pyinstaller:get_hook_dirs"
80+ tests = " cmap.__pyinstaller:get_test_dirs"
81+
7882[project .urls ]
7983Homepage = " https://github.com/pyapp-kit/cmap"
8084Repository = " https://github.com/pyapp-kit/cmap"
@@ -139,6 +143,9 @@ filterwarnings = [
139143 " ignore:datetime.datetime.utcfromtimestamp:DeprecationWarning" ,
140144 " ignore::DeprecationWarning:docstring_parser" ,
141145 " ignore:Pyarrow will become a required dependency of pandas" ,
146+ " ignore::DeprecationWarning:Pyinstaller" ,
147+ " ignore::DeprecationWarning:pkg_resources" ,
148+ " ignore::DeprecationWarning:altgraph" ,
142149]
143150
144151# 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 2121
2222import numpy as np
2323
24- try :
25- from pydantic import model_serializer
26- except ImportError :
27- model_serializer = lambda x : x # noqa: E731
28-
2924from . import _external
3025
3126if TYPE_CHECKING :
You can’t perform that action at this time.
0 commit comments