File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -41,7 +41,6 @@ setup.cfg
4141
4242# Starting from pip 21.3 setup.py is not needed anymore
4343# and we rely only on setup.cfg for env
44- setup.py
4544environment.yml
4645# requirements.txt
4746conda_env_list_commands.txt
Original file line number Diff line number Diff line change 1+ # only needed for cython extensions, not needed to run normally
2+ import sys
3+ from setuptools import setup , Extension
4+ from Cython .Build import cythonize
5+ import numpy as np
6+
7+ setup (
8+ ext_modules = cythonize (
9+ Extension (
10+ "cellacdc.regionprops_helper" ,
11+ sources = ["cellacdc/regionprops_helper.pyx" ],
12+ include_dirs = [np .get_include ()],
13+ ),
14+ annotate = True ,
15+ build_dir = "build/cython" , # .c and .html files go here
16+ )
17+ )
18+ # move compiled binary to precompiled/
19+ import shutil
20+ import os
21+
22+ src_dir = "cellacdc"
23+ for filename in os .listdir (src_dir ):
24+ if filename .startswith ("regionprops_helper" ) and (filename .endswith (".so" ) or filename .endswith (".pyd" )):
25+ target_path = os .path .join ("cellacdc" , "precompiled" , filename )
26+ shutil .move (os .path .join (src_dir , filename ), target_path )
27+ print (f"Moved { filename } to { target_path } " )
28+
You can’t perform that action at this time.
0 commit comments