1515 twine upload dist/* # upload to PyPI
1616"""
1717
18+ import atexit
19+ import glob
1820import os
19- import shutil
2021import platform
21- import glob
22- import atexit
23- from setuptools import setup , Extension
22+ import shutil
23+
24+ from setuptools import Extension , setup
2425
2526# ---------- paths ----------
26- here = os .path .dirname (os .path .abspath (__file__ ))
27+ here = os .path .dirname (os .path .abspath (__file__ ))
2728parent_srcdir = os .path .join (here , ".." , "src" )
2829parent_incdir = os .path .join (here , ".." , "include" )
29- csrc_dir = os .path .join (here , "csrc" )
30+ csrc_dir = os .path .join (here , "csrc" )
3031
3132# items to copy from parent repo into csrc/
3233COPY_ITEMS = [
33- ("src/zmatlib.c" , "src/zmatlib.c" ),
34- ("src/miniz" , "src/miniz" ),
35- ("src/easylzma" , "src/easylzma" ),
36- ("src/lz4" , "src/lz4" ),
37- ("src/blosc2/internal-complibs/zstd" , "src/blosc2/internal-complibs/zstd" ),
38- ("src/blosc2/include" , "src/blosc2/include" ),
39- ("src/blosc2/blosc" , "src/blosc2/blosc" ),
40- ("src/blosc2/plugins" , "src/blosc2/plugins" ),
41- ("include" , "include" ),
34+ ("src/zmatlib.c" , "src/zmatlib.c" ),
35+ ("src/miniz" , "src/miniz" ),
36+ ("src/easylzma" , "src/easylzma" ),
37+ ("src/lz4" , "src/lz4" ),
38+ ("src/blosc2/internal-complibs/zstd" , "src/blosc2/internal-complibs/zstd" ),
39+ ("src/blosc2/include" , "src/blosc2/include" ),
40+ ("src/blosc2/blosc" , "src/blosc2/blosc" ),
41+ ("src/blosc2/plugins" , "src/blosc2/plugins" ),
42+ ("include" , "include" ),
4243]
4344
4445
@@ -61,8 +62,9 @@ def ensure_csrc():
6162 elif os .path .isdir (src_path ):
6263 if os .path .exists (dst_path ):
6364 shutil .rmtree (dst_path )
64- shutil .copytree (src_path , dst_path ,
65- ignore = shutil .ignore_patterns ('*.o' , '*.a' , '*.S' , '*.s' ))
65+ shutil .copytree (
66+ src_path , dst_path , ignore = shutil .ignore_patterns ("*.o" , "*.a" , "*.S" , "*.s" )
67+ )
6668
6769
6870# copy sources into csrc/ so all paths are within setup.py's directory
@@ -76,8 +78,11 @@ def ensure_csrc():
7678csrc_src = os .path .join (csrc_dir , "src" )
7779if not os .path .isdir (csrc_src ):
7880 import warnings
79- warnings .warn ("csrc/src/ not found - C sources may be missing. "
80- "Build from a full git checkout or a complete sdist." )
81+
82+ warnings .warn (
83+ "csrc/src/ not found - C sources may be missing. "
84+ "Build from a full git checkout or a complete sdist."
85+ )
8186
8287# all paths are relative to here, inside csrc/
8388srcdir = os .path .join ("csrc" , "src" )
@@ -195,10 +200,21 @@ def _exists(relpath):
195200 define_macros .append (("HAVE_LZ4" , "1" ))
196201
197202 blosc2_srcs = [
198- "blosc2.c" , "blosc2-stdio.c" , "blosclz.c" , "delta.c" , "directories.c" ,
199- "fastcopy.c" , "frame.c" , "schunk.c" , "sframe.c" , "shuffle.c" ,
200- "shuffle-generic.c" , "bitshuffle-generic.c" , "stune.c" ,
201- "timestamp.c" , "trunc-prec.c" ,
203+ "blosc2.c" ,
204+ "blosc2-stdio.c" ,
205+ "blosclz.c" ,
206+ "delta.c" ,
207+ "directories.c" ,
208+ "fastcopy.c" ,
209+ "frame.c" ,
210+ "schunk.c" ,
211+ "sframe.c" ,
212+ "shuffle.c" ,
213+ "shuffle-generic.c" ,
214+ "bitshuffle-generic.c" ,
215+ "stune.c" ,
216+ "timestamp.c" ,
217+ "trunc-prec.c" ,
202218 ]
203219 for f in blosc2_srcs :
204220 p = os .path .join (blosc2_dir , f )
@@ -247,4 +263,4 @@ def _exists(relpath):
247263
248264setup (
249265 ext_modules = [zmat_ext ],
250- )
266+ )
0 commit comments