From: jay.ho.park Date: Tue, 12 Jan 2021 20:14:31 +0000 (+0900) Subject: Support python 3.9.1 X-Git-Tag: submit/tizen/20210112.031033~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F44%2F251244%2F2;p=platform%2Fcore%2Fuifw%2Fnlp.git Support python 3.9.1 Change-Id: Ie1981b4d8982484efa18fc3717543ad52164fe8d --- diff --git a/nlp_resource_data/CMakeLists.txt b/nlp_resource_data/CMakeLists.txt index fe943f6..f3269f4 100755 --- a/nlp_resource_data/CMakeLists.txt +++ b/nlp_resource_data/CMakeLists.txt @@ -6,6 +6,6 @@ PROJECT(${fw_name} C) INCLUDE(FindPkgConfig) -INSTALL(DIRECTORY nltk DESTINATION ${LIBDIR}/python3.7/site-packages) -INSTALL(DIRECTORY langdetect DESTINATION ${LIBDIR}/python3.7/site-packages) +INSTALL(DIRECTORY nltk DESTINATION ${LIBDIR}/python3.9/site-packages) +INSTALL(DIRECTORY langdetect DESTINATION ${LIBDIR}/python3.9/site-packages) INSTALL(DIRECTORY nltk_data DESTINATION /usr/local/lib/) diff --git a/packaging/nlp.spec b/packaging/nlp.spec index 0798aad..db7ecfa 100755 --- a/packaging/nlp.spec +++ b/packaging/nlp.spec @@ -12,7 +12,7 @@ BuildRequires: pkgconfig(capi-appfw-service-application) BuildRequires: pkgconfig(libtzplatform-config) BuildRequires: pkgconfig(bundle) BuildRequires: python3-base -BuildRequires: pkgconfig(python3) +BuildRequires: pkgconfig(python3-embed) BuildRequires: pkgconfig(glib-2.0) BuildRequires: pkgconfig(rpc-port) BuildRequires: pkgconfig(ecore) @@ -76,8 +76,8 @@ tpk-backend -d %{name} --preload --force-remove %attr(755,root,root) %{_app_bin_dir}/org.tizen.nlp.service %{_app_bin_dir}/* %{TZ_SYS_RO_PACKAGES}/org.tizen.nlp.service.xml -%{_libdir}/python3.7/site-packages/langdetect/* -%{_libdir}/python3.7/site-packages/nltk/* +%{python3_sitelib}/langdetect/* +%{python3_sitelib}/nltk/* %license LICENSE %files data-en diff --git a/service/CMakeLists.txt b/service/CMakeLists.txt index bfc5fac..5de12b2 100755 --- a/service/CMakeLists.txt +++ b/service/CMakeLists.txt @@ -27,7 +27,7 @@ pkg_check_modules(pkgs REQUIRED capi-base-common capi-appfw-service-application bundle - python3 + python3-embed glib-2.0 rpc-port ecore diff --git a/service/src/service.c b/service/src/service.c index 743df37..9759126 100755 --- a/service/src/service.c +++ b/service/src/service.c @@ -563,7 +563,7 @@ PyObject* nltk_get_module(const char* name) int nltk_get_size_from_list(PyObject* list) { - if PyList_Check(list) + if (PyList_Check(list)) { return PyList_Size(list); } @@ -575,7 +575,7 @@ int nltk_get_size_from_list(PyObject* list) int nltk_get_size_from_tuple(PyObject* tuple) { - if PyTuple_Check(tuple) + if (PyTuple_Check(tuple)) { return PyTuple_Size(tuple); } @@ -588,7 +588,7 @@ int nltk_get_size_from_tuple(PyObject* tuple) PyObject* nltk_get_element_from_list_by_index(PyObject* list, int index) { PyObject* element; - if PyList_Check(list) + if (PyList_Check(list)) { if (index > (PyList_Size(list)-1) || (index < 0 )) { @@ -611,7 +611,7 @@ PyObject* nltk_get_element_from_tuple_by_index(PyObject* tuple, int index) { PRET_VM(!tuple, NULL, "Input parameter [tuple] is NULL!"); PyObject* element; - if PyTuple_Check(tuple) + if (PyTuple_Check(tuple)) { if (index > (PyTuple_Size(tuple)-1) || (index < 0 )) { diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 2a3e630..3e4d5b5 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -7,7 +7,7 @@ pkg_check_modules(pkgs REQUIRED capi-base-common capi-appfw-service-application bundle - python3 + python3-embed glib-2.0 rpc-port ecore