Skip to content

Commit 405544e

Browse files
committed
Initialize repository
0 parents  commit 405544e

File tree

5 files changed

+34
-0
lines changed

5 files changed

+34
-0
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
*.pyc
2+
**/__pycache__/
3+
.venv/

requirements-dev.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pytest

setup.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
from setuptools import setup, Extension
2+
3+
4+
setup(
5+
name='cstring',
6+
ext_modules=[Extension('cstring', sources=['src/cstring.c'])]
7+
)

src/cstring.c

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#include <Python.h>
2+
3+
struct cstring {
4+
PyObject_HEAD
5+
};
6+
7+
static struct PyModuleDef module = {
8+
.m_base = PyModuleDef_HEAD_INIT,
9+
.m_name = "cstring",
10+
.m_doc = "",
11+
.m_size = 0,
12+
.m_methods = NULL,
13+
};
14+
15+
PyMODINIT_FUNC PyInit_cstring(void) {
16+
return PyModule_Create(&module);
17+
}

test/test_cstring.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import cstring
2+
3+
4+
def test_cstring():
5+
pass
6+

0 commit comments

Comments
 (0)