This repository was archived by the owner on Jun 27, 2025. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2105,20 +2105,21 @@ PyInit_arraymap(void)
21052105 return NULL ;
21062106 }
21072107
2108- PyObject * arraymap = PyModule_Create (& arraymap_module );
2108+ PyObject * m = PyModule_Create (& arraymap_module );
21092109 if (
2110- !arraymap
2110+ !m
2111+ || PyModule_AddStringConstant (m , "__version__" , Py_STRINGIFY (AM_VERSION ))
21112112 || PyType_Ready (& AMType )
21122113 || PyType_Ready (& FAMIType )
21132114 || PyType_Ready (& FAMVType )
21142115 || PyType_Ready (& FAMType )
2115- || PyModule_AddObject (arraymap , "AutoMap" , (PyObject * )& AMType )
2116- || PyModule_AddObject (arraymap , "FrozenAutoMap" , (PyObject * )& FAMType )
2117- || PyModule_AddObject (arraymap , "NonUniqueError" , NonUniqueError )
2116+ || PyModule_AddObject (m , "AutoMap" , (PyObject * )& AMType )
2117+ || PyModule_AddObject (m , "FrozenAutoMap" , (PyObject * )& FAMType )
2118+ || PyModule_AddObject (m , "NonUniqueError" , NonUniqueError )
21182119 ) {
2119- Py_XDECREF (arraymap );
2120+ Py_XDECREF (m );
21202121 return NULL ;
21212122 }
2122- return arraymap ;
2123+ return m ;
21232124}
21242125
Original file line number Diff line number Diff line change 33import site
44import os
55
6+
7+ AM_VERSION = "0.1.1"
8+
9+
610with open ("README.md" ) as file :
711 LONG_DESCRIPTION = file .read ()
812
@@ -21,12 +25,14 @@ def get_ext_dir(*components: tp.Iterable[str]) -> tp.Sequence[str]:
2125 ["arraymap.c" ],
2226 include_dirs = get_ext_dir ("numpy" , "core" , "include" ),
2327 library_dirs = get_ext_dir ("numpy" , "core" , "lib" ),
28+ define_macros = [("AM_VERSION" , AM_VERSION )],
2429 libraries = ["npymath" ], # not including mlib at this time
2530)
2631
2732
2833setuptools .setup (
2934 author = "Christopher Ariza, Brandt Bucher" ,
35+ version = AM_VERSION ,
3036 description = "Dictionary-like lookup from NumPy array values to their integer positions" ,
3137 ext_modules = [extension ],
3238 license = "MIT" ,
@@ -35,5 +41,4 @@ def get_ext_dir(*components: tp.Iterable[str]) -> tp.Sequence[str]:
3541 name = "arraymap" ,
3642 python_requires = ">=3.7.0" ,
3743 url = "https://github.com/static-frame/arraymap" ,
38- version = "0.1.0" ,
3944)
Original file line number Diff line number Diff line change @@ -28,4 +28,4 @@ def build(context):
2828
2929@invoke .task (build )
3030def test (context ):
31- run (context , f"{ sys .executable } -m pytest -v " )
31+ run (context , f"{ sys .executable } -m pytest" )
Original file line number Diff line number Diff line change 88from arraymap import FrozenAutoMap
99from arraymap import NonUniqueError
1010
11+ def test_version ():
12+ import arraymap
13+ assert isinstance (arraymap .__version__ , str )
14+
15+
16+ # ------------------------------------------------------------------------------
17+
1118
1219def test_am_extend ():
1320 am1 = AutoMap (("a" , "b" ))
You can’t perform that action at this time.
0 commit comments