This repository was archived by the owner on Jun 27, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +22
-9
lines changed Expand file tree Collapse file tree 4 files changed +22
-9
lines changed Original file line number Diff line number Diff line change @@ -2105,20 +2105,21 @@ PyInit_arraymap(void)
2105
2105
return NULL ;
2106
2106
}
2107
2107
2108
- PyObject * arraymap = PyModule_Create (& arraymap_module );
2108
+ PyObject * m = PyModule_Create (& arraymap_module );
2109
2109
if (
2110
- !arraymap
2110
+ !m
2111
+ || PyModule_AddStringConstant (m , "__version__" , Py_STRINGIFY (AM_VERSION ))
2111
2112
|| PyType_Ready (& AMType )
2112
2113
|| PyType_Ready (& FAMIType )
2113
2114
|| PyType_Ready (& FAMVType )
2114
2115
|| 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 )
2118
2119
) {
2119
- Py_XDECREF (arraymap );
2120
+ Py_XDECREF (m );
2120
2121
return NULL ;
2121
2122
}
2122
- return arraymap ;
2123
+ return m ;
2123
2124
}
2124
2125
Original file line number Diff line number Diff line change 3
3
import site
4
4
import os
5
5
6
+
7
+ AM_VERSION = "0.1.1"
8
+
9
+
6
10
with open ("README.md" ) as file :
7
11
LONG_DESCRIPTION = file .read ()
8
12
@@ -21,12 +25,14 @@ def get_ext_dir(*components: tp.Iterable[str]) -> tp.Sequence[str]:
21
25
["arraymap.c" ],
22
26
include_dirs = get_ext_dir ("numpy" , "core" , "include" ),
23
27
library_dirs = get_ext_dir ("numpy" , "core" , "lib" ),
28
+ define_macros = [("AM_VERSION" , AM_VERSION )],
24
29
libraries = ["npymath" ], # not including mlib at this time
25
30
)
26
31
27
32
28
33
setuptools .setup (
29
34
author = "Christopher Ariza, Brandt Bucher" ,
35
+ version = AM_VERSION ,
30
36
description = "Dictionary-like lookup from NumPy array values to their integer positions" ,
31
37
ext_modules = [extension ],
32
38
license = "MIT" ,
@@ -35,5 +41,4 @@ def get_ext_dir(*components: tp.Iterable[str]) -> tp.Sequence[str]:
35
41
name = "arraymap" ,
36
42
python_requires = ">=3.7.0" ,
37
43
url = "https://github.com/static-frame/arraymap" ,
38
- version = "0.1.0" ,
39
44
)
Original file line number Diff line number Diff line change @@ -28,4 +28,4 @@ def build(context):
28
28
29
29
@invoke .task (build )
30
30
def 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 8
8
from arraymap import FrozenAutoMap
9
9
from arraymap import NonUniqueError
10
10
11
+ def test_version ():
12
+ import arraymap
13
+ assert isinstance (arraymap .__version__ , str )
14
+
15
+
16
+ # ------------------------------------------------------------------------------
17
+
11
18
12
19
def test_am_extend ():
13
20
am1 = AutoMap (("a" , "b" ))
You can’t perform that action at this time.
0 commit comments