1919ZLIB_NG_SOURCE = os .path .join ("src" , "zlib_ng" , "zlib-ng" )
2020
2121SYSTEM_IS_UNIX = (sys .platform .startswith ("linux" ) or
22- sys .platform .startswith ("darwin" ))
22+ sys .platform .startswith ("darwin" ) or
23+ 'bsd' in sys .platform )
2324SYSTEM_IS_WINDOWS = sys .platform .startswith ("win" )
2425
2526# Since pip builds in a temp directory by default, setting a fixed file in
3839class BuildZlibNGExt (build_ext ):
3940 def build_extension (self , ext ):
4041 # Add option to link dynamically for packaging systems such as conda.
41- # Always link dynamically on readthedocs to simplify install.
42- if (os .getenv ("PYTHON_ZLIB_NG_LINK_DYNAMIC" ) is not None or
43- os .environ .get ("READTHEDOCS" ) is not None ):
42+ if os .getenv ("PYTHON_ZLIB_NG_LINK_DYNAMIC" ) is not None :
4443 # Check for zlib_ng include directories. This is useful when
4544 # installing in a conda environment.
4645 possible_prefixes = [sys .exec_prefix , sys .base_exec_prefix ]
@@ -107,6 +106,9 @@ def build_zlib_ng():
107106 if sys .platform == "darwin" : # Cmake does not work properly
108107 subprocess .run ([os .path .join (build_dir , "configure" )], ** run_args )
109108 subprocess .run (["gmake" , "libz-ng.a" ], ** run_args )
109+ elif sys .platform == "linux" :
110+ subprocess .run ([os .path .join (build_dir , "configure" )], ** run_args )
111+ subprocess .run (["make" , "libz-ng.a" , "-j" , str (cpu_count )], ** run_args )
110112 else :
111113 subprocess .run (["cmake" , build_dir ], ** run_args )
112114 # Do not create test suite and do not perform tests to shorten build times.
@@ -121,7 +123,7 @@ def build_zlib_ng():
121123
122124setup (
123125 name = "zlib-ng" ,
124- version = "0.2 .0" ,
126+ version = "0.3 .0" ,
125127 description = "Drop-in replacement for zlib and gzip modules using zlib-ng" ,
126128 author = "Leiden University Medical Center" ,
127129 author_email = "r.h.p.vorderman@lumc.nl" , # A placeholder for now
@@ -141,11 +143,11 @@ def build_zlib_ng():
141143 classifiers = [
142144 "Programming Language :: Python :: 3 :: Only" ,
143145 "Programming Language :: Python :: 3" ,
144- "Programming Language :: Python :: 3.7" ,
145146 "Programming Language :: Python :: 3.8" ,
146147 "Programming Language :: Python :: 3.9" ,
147148 "Programming Language :: Python :: 3.10" ,
148149 "Programming Language :: Python :: 3.11" ,
150+ "Programming Language :: Python :: 3.12" ,
149151 "Programming Language :: Python :: Implementation :: CPython" ,
150152 "Programming Language :: Python :: Implementation :: PyPy" ,
151153 "Programming Language :: C" ,
@@ -156,6 +158,6 @@ def build_zlib_ng():
156158 "Operating System :: MacOS" ,
157159 "Operating System :: Microsoft :: Windows" ,
158160 ],
159- python_requires = ">=3.7 " , # uses METH_FASTCALL
161+ python_requires = ">=3.8 " , # Earliest version still tested.
160162 ext_modules = EXTENSIONS
161163)
0 commit comments