Skip to content

Commit

Permalink
Restructure layout
Browse files Browse the repository at this point in the history
  • Loading branch information
oleksandr-pavlyk committed Dec 14, 2023
1 parent 1b04142 commit 9eb673b
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 19 deletions.
4 changes: 2 additions & 2 deletions conda-recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ test:
imports:
- itt
source_files:
- tests
- itt/tests
commands:
- pytest -v tests
- pytest -v itt/tests
requires:
- pytest

Expand Down
14 changes: 2 additions & 12 deletions itt/itt-python.c → itt-src/itt-python.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,16 @@ static PyMethodDef itt_methods[] = {
// Note for future modifications, please see this link for INITERROR defines
// https://docs.python.org/3.3/howto/cporting.html#module-initialization-and-state

#if PY_MAJOR_VERSION >= 3
static struct PyModuleDef itt_module =
{
PyModuleDef_HEAD_INIT, "itt", docstring, -1, itt_methods
PyModuleDef_HEAD_INIT, "itt._itt", docstring, -1, itt_methods
};

PyMODINIT_FUNC PyInit_itt(void)
PyMODINIT_FUNC PyInit__itt(void)
{
return PyModule_Create(&itt_module);
}

#else

void inititt(void)
{
Py_InitModule3("itt", itt_methods, docstring);
}

#endif

static PyObject* itt_pause(PyObject* self, PyObject* args)
{
Py_BEGIN_ALLOW_THREADS;
Expand Down
File renamed without changes.
25 changes: 25 additions & 0 deletions itt/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
from ._itt import (
resume,
pause,
detach,
domain_create,
task_begin,
task_end,
pt_region_create,
pt_region_begin,
pt_region_end,
)

__version__ = "0.0.5"

__all__ = [
"detach",
"resume",
"pause",
"domain_create",
"task_begin",
"task_end",
"pt_region_create",
"pt_region_begin",
"pt_region_end",
]
File renamed without changes.
13 changes: 8 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,15 @@


extension = Extension(
"itt",
sources = ["itt/itt-python.c"],
"itt._itt",
sources = ["itt-src/itt-python.c"],
**kwargs
)

setup(name = 'itt',
version = '0.0.5',
description = 'ITT API bindings for Python',
ext_modules = [extension])
version = '0.0.5',
description = 'ITT API bindings for Python',
ext_modules = [extension],
packages=["itt"],
package_data={"itt": ["tests/test_itt.py"]},
)

0 comments on commit 9eb673b

Please sign in to comment.