Commit 36609027 authored by Andi Vajda's avatar Andi Vajda
Browse files

- renamed _icu extension module to _icu_ and moved it into icu module

  - moved icu python module sources into py directory
  - deleted long deprecated PyICU.py file
parent c28e916f
Version 2.8 ->
--------------------
- renamed _icu extension module to _icu_ and moved it into icu module
- moved icu python module sources into py directory
- deleted long deprecated PyICU.py file
-
Version 2.7.4 -> 2.8
--------------------
- fixed test failure in test_DateTimeParserGenerator.py with version 70.1rc
......
/* ====================================================================
* Copyright (c) 2005 Open Source Applications Foundation.
* Copyright (c) 2004-2022 Open Source Applications Foundation.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
......
# ====================================================================
# Copyright (c) 2004-2010 Open Source Applications Foundation.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.
# ====================================================================
import warnings as _warnings
_warnings.warn("Module 'PyICU' is deprecated, import 'icu' instead",
category=DeprecationWarning, stacklevel=2)
from icu import *
/* ====================================================================
* Copyright (c) 2004-2021 Open Source Applications Foundation.
* Copyright (c) 2004-2022 Open Source Applications Foundation.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
......@@ -202,7 +202,7 @@ static PyMethodDef _icu_funcs[] = {
{ NULL, NULL, 0, NULL }
};
static PyObject *PyInit_icu(PyObject *m)
static PyObject *PyInit_icu_(PyObject *m)
{
PyObject *ver;
......@@ -283,7 +283,7 @@ static PyObject *PyInit_icu(PyObject *m)
/* TODO: Properly implement http://www.python.org/dev/peps/pep-3121/ */
static struct PyModuleDef moduledef = {
PyModuleDef_HEAD_INIT,
/* m_name */ "_icu",
/* m_name */ "icu._icu_",
/* m_doc */ "PyICU extension module",
/* m_size */ -1,
/* m_methods */ _icu_funcs,
......@@ -292,18 +292,19 @@ static struct PyModuleDef moduledef = {
/* m_free */ NULL,
};
extern "C" {
PyMODINIT_FUNC PyInit__icu(void)
PyMODINIT_FUNC PyInit__icu_(void)
{
PyObject *m = PyModule_Create(&moduledef);
return PyInit_icu(m);
return PyInit_icu_(m);
}
}
#else
extern "C" {
void init_icu(void)
void init_icu_(void)
{
PyObject *m = Py_InitModule3("_icu", _icu_funcs, "_icu");
PyInit_icu(m);
PyObject *m = Py_InitModule3(
"icu._icu_", _icu_funcs, "PyICU extension module");
PyInit_icu_(m);
}
}
#endif
# ====================================================================
# Copyright (c) 2004-2018 Open Source Applications Foundation.
# Copyright (c) 2004-2022 Open Source Applications Foundation.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
......@@ -34,4 +34,4 @@ class InvalidArgsError(Exception):
pass
from _icu import *
from icu._icu_ import *
......@@ -270,13 +270,13 @@ setup(name="PyICU",
'Programming Language :: Python :: Implementation :: PyPy',
'Topic :: Software Development :: Localization',
'Topic :: Software Development :: Internationalization'],
ext_modules=[Extension('_icu',
ext_modules=[Extension('icu._icu_',
[filename for filename in sorted(os.listdir(os.curdir))
if filename.endswith('.cpp')],
include_dirs=_includes,
extra_compile_args=_cflags,
extra_link_args=_lflags,
libraries=_libraries)],
package_dir={"": "py"},
packages=['icu'],
py_modules=['PyICU'],
tests_require=['pytest', 'six'])
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment