pyicu merge requestshttps://gitlab.pyicu.org/main/pyicu/-/merge_requests2023-12-22T04:48:32-08:00https://gitlab.pyicu.org/main/pyicu/-/merge_requests/148Bugfix: Don't use DECLARE_TYPE() with NULL dealloc2023-12-22T04:48:32-08:00Fredrik Roubertroubert@google.comBugfix: Don't use DECLARE_TYPE() with NULL deallocUsing a `NULL` dealloc will result in calling the wrong destructor, the base class destructor (which isn't virtual) instead of the actual one.
In the ICU4C default configuration (`U_OVERRIDE_CXX_ALLOCATION=1`) this isn't immediately not...Using a `NULL` dealloc will result in calling the wrong destructor, the base class destructor (which isn't virtual) instead of the actual one.
In the ICU4C default configuration (`U_OVERRIDE_CXX_ALLOCATION=1`) this isn't immediately noticeable as the operator delete implementation there simply calls `uprv_free()` without caring about what is being deleted, but other implementations (`U_OVERRIDE_CXX_ALLOCATION=0`) aren't always as cavalier about this.
To resolve this, a new macro that declares a type appropriate dealloc is introduced and used to replace `DECLARE_TYPE()` with `NULL` dealloc for all ICU4C types with public destructors.
Tested using `U_OVERRIDE_CXX_ALLOCATION=0` and TCMalloc.https://gitlab.pyicu.org/main/pyicu/-/merge_requests/147Fix build with Python 3.132023-11-03T21:34:57-07:00Gwyn CieslaFix build with Python 3.13<unistd.h> needs to be explicitly included in locale.cpp<unistd.h> needs to be explicitly included in locale.cpphttps://gitlab.pyicu.org/main/pyicu/-/merge_requests/146Add ICU 4.4 TimeZone display name types.2023-05-23T08:02:48-07:00Fredrik Roubertroubert@google.comAdd ICU 4.4 TimeZone display name types.I noticed that these were missing.I noticed that these were missing.https://gitlab.pyicu.org/main/pyicu/-/merge_requests/145Add support for all comparison operators to Locale2023-04-14T11:39:41-07:00Fredrik Roubertroubert@google.comAdd support for all comparison operators to LocaleWhile the C++ implementation only overloads operators == and != I think that a lot of Python programmers would expect all comparison operators to be implemented (at least it surprised me when I couldn't simply sort a list of Locale objec...While the C++ implementation only overloads operators == and != I think that a lot of Python programmers would expect all comparison operators to be implemented (at least it surprised me when I couldn't simply sort a list of Locale objects).https://gitlab.pyicu.org/main/pyicu/-/merge_requests/143Make parameter names in declarations consistent with definitions.2022-04-19T19:35:52-07:00Fredrik Roubertroubert@google.comMake parameter names in declarations consistent with definitions.This is autogenerated using clang-tidy:
https://clang.llvm.org/extra/clang-tidy/checks/readability-inconsistent-declaration-parameter-name.htmlThis is autogenerated using clang-tidy:
https://clang.llvm.org/extra/clang-tidy/checks/readability-inconsistent-declaration-parameter-name.htmlhttps://gitlab.pyicu.org/main/pyicu/-/merge_requests/142Delete unused file.2022-04-13T14:16:06-07:00Fredrik Roubertroubert@google.comDelete unused file.Having an unused file in the repository is just confusing.Having an unused file in the repository is just confusing.https://gitlab.pyicu.org/main/pyicu/-/merge_requests/141Update explanations about strings to reflect Python 3.2021-04-05T17:44:27-07:00Andi VajdaUpdate explanations about strings to reflect Python 3.https://gitlab.pyicu.org/main/pyicu/-/merge_requests/140Add installation instructions to README.md2021-03-02T13:23:57-08:00Andi VajdaAdd installation instructions to README.md*Created by: ddelange*
I've had to point colleagues running Mac to https://gist.github.com/ddelange/6e04e81b99fae08e817a00515d4a378d repeatedly, so why not add it here :)
Closes #139*Created by: ddelange*
I've had to point colleagues running Mac to https://gist.github.com/ddelange/6e04e81b99fae08e817a00515d4a378d repeatedly, so why not add it here :)
Closes #139https://gitlab.pyicu.org/main/pyicu/-/merge_requests/132Remove deprecated API usage2020-06-16T10:03:05-07:00Andi VajdaRemove deprecated API usage*Created by: methane*
`PyUnicode_FromStringAndSize(NULL, size)` usage is also deprecated.*Created by: methane*
`PyUnicode_FromStringAndSize(NULL, size)` usage is also deprecated.https://gitlab.pyicu.org/main/pyicu/-/merge_requests/130Update samples to Python 32020-06-12T17:49:53-07:00Andi VajdaUpdate samples to Python 3*Created by: wannaphong*
I have changed `print` to `print()` in samples.*Created by: wannaphong*
I have changed `print` to `print()` in samples.https://gitlab.pyicu.org/main/pyicu/-/merge_requests/121Adding arm64 Travis Support2020-01-17T10:28:28-08:00Andi VajdaAdding arm64 Travis Support*Created by: ossdev07*
Travis-CI has added support for ARM64. Added ARM64 job in Travis-CI.*Created by: ossdev07*
Travis-CI has added support for ARM64. Added ARM64 job in Travis-CI.https://gitlab.pyicu.org/main/pyicu/-/merge_requests/118Expand Travis-CI scope2019-12-04T15:54:23-08:00Andi VajdaExpand Travis-CI scope*Created by: SethMMorton*
This is intended to address and close issue #117.
This PR will take many iterations to get correct, so I have prefixed the title with WIP to indicate it is a work-in-progress. I will remove WIP when I think ...*Created by: SethMMorton*
This is intended to address and close issue #117.
This PR will take many iterations to get correct, so I have prefixed the title with WIP to indicate it is a work-in-progress. I will remove WIP when I think it is read to merge.
- [x] Testing against multiple `icu4c` versions
- [x] Testing against multiple Python versions
- [x] Testing on Linux
- [x] Testing on macos
- [ ] Testing on Windows
- ~~On Linux, testing against both clang and GCC (not sure if this is needed?)~~
https://gitlab.pyicu.org/main/pyicu/-/merge_requests/109resolve compiler error in visual c++.2019-10-03T08:58:43-07:00Andi Vajdaresolve compiler error in visual c++.*Created by: kochelmonster*
This pull request contains the changes discussed in #98.
Also if it is perfect standard c++, the fact is: msvc does not compile it, and I don't assume Microsoft will change their compiler.
For those who...*Created by: kochelmonster*
This pull request contains the changes discussed in #98.
Also if it is perfect standard c++, the fact is: msvc does not compile it, and I don't assume Microsoft will change their compiler.
For those who are interested: I was able to compile pyicu with the following conda packages:
- icu=64.2=he025d50_1
- vs2017_win-64=19.16.27032.1=hb4161e2_0https://gitlab.pyicu.org/main/pyicu/-/merge_requests/106added info about pkg-config in ICU_VERSION error message2019-08-01T16:23:13-07:00Andi Vajdaadded info about pkg-config in ICU_VERSION error message*Created by: iwsfutcmd*
see issue #105 *Created by: iwsfutcmd*
see issue #105 https://gitlab.pyicu.org/main/pyicu/-/merge_requests/103Upgrade to Xenial and ICU4C 64.2 in Travis CI2019-05-24T00:38:54-07:00Andi VajdaUpgrade to Xenial and ICU4C 64.2 in Travis CI*Created by: sciyoshi*
This also removes Python 2.6 and 3.3 from the test matrix and updates the download URL for ICU4c. Note that it uncovered an issue in Python 2.7, where the script code for surrogates is `Zyyy` instead of `Zzzz`. No...*Created by: sciyoshi*
This also removes Python 2.6 and 3.3 from the test matrix and updates the download URL for ICU4c. Note that it uncovered an issue in Python 2.7, where the script code for surrogates is `Zyyy` instead of `Zzzz`. Not sure why this only seems to happen on Python 2:
https://travis-ci.org/sciyoshi/pyicu/jobs/535936082https://gitlab.pyicu.org/main/pyicu/-/merge_requests/102Clone transliterator object in registerInstance()2019-05-07T10:20:20-07:00Andi VajdaClone transliterator object in registerInstance()*Created by: mjansche*
The underlying Transliterator::registerInstance() takes ownership of the
pointer it gets passed. This conflicts with the reference counting of
the Python wrapper. Work around this by cloning the instance object.*Created by: mjansche*
The underlying Transliterator::registerInstance() takes ownership of the
pointer it gets passed. This conflicts with the reference counting of
the Python wrapper. Work around this by cloning the instance object.https://gitlab.pyicu.org/main/pyicu/-/merge_requests/91add spdx license metadata to setup py2018-10-28T16:38:07-07:00Andi Vajdaadd spdx license metadata to setup py*Created by: ChristianMurphy*
Includes license information in a machine parse-able way for the python package index.
See https://setuptools.readthedocs.io/en/latest/setuptools.html#metadata and https://spdx.org/licenses*Created by: ChristianMurphy*
Includes license information in a machine parse-able way for the python package index.
See https://setuptools.readthedocs.io/en/latest/setuptools.html#metadata and https://spdx.org/licenseshttps://gitlab.pyicu.org/main/pyicu/-/merge_requests/66README: fix typo2018-01-14T10:04:25-08:00Andi VajdaREADME: fix typo*Created by: jwilk*
*Created by: jwilk*
https://gitlab.pyicu.org/main/pyicu/-/merge_requests/54Add Cygwin support to setup.py.2017-05-22T10:59:13-07:00Andi VajdaAdd Cygwin support to setup.py.*Created by: wilx*
*Created by: wilx*
https://gitlab.pyicu.org/main/pyicu/-/merge_requests/51Continuous integration with Travis CI2017-04-26T09:24:30-07:00Andi VajdaContinuous integration with Travis CI*Created by: sciyoshi*
@ovalhub this PR adds a [Travis CI](https://travis-ci.org/) configuration file that automatically builds and runs unit tests for branches and PRs across various Python versions and architectures (currently only Li...*Created by: sciyoshi*
@ovalhub this PR adds a [Travis CI](https://travis-ci.org/) configuration file that automatically builds and runs unit tests for branches and PRs across various Python versions and architectures (currently only Linux). This is a nice sanity check that can give you some confidence that tests are passing when merging PRs.
This PR also builds [manylinux1](https://github.com/pypa/manylinux#manylinux)-compatible (aka [PEP-513](https://www.python.org/dev/peps/pep-0513/)-compliant) wheels using the Docker image provided by that project, and uploads them to GitHub Releases for any git tags. As you noted in #39, PyICU is a C extension that can be built with any combination of ICU version, OS, architecture, and Python version, so cannot support so-called universal wheels. Wheels have a number of benefits that I won't get into here, however they lack the ability to declare platform tags. This has led to problems with our internal [devpi](http://doc.devpi.net/latest/) mirror, where a wheel built on one distro and linked to a specific version of `libicu*.so.<ver>` is cached and cannot be used on platforms with a different ICU version.
Short of re-writing PyICU using cffi/ctypes, PEP-513 provides a solution to this problem, [achieving broad portability by restricting which external shared libraries the wheel is allowed to link to](https://www.python.org/dev/peps/pep-0513/#the-manylinux1-policy). This is done by bundling any external shared libraries and modifying `RPATH` (similar to static linking), which is handled automatically by the [auditwheel](https://github.com/pypa/auditwheel) tool.
This approach comes with its own benefits and drawbacks, which are [outlined in more detail in the PEP](https://www.python.org/dev/peps/pep-0513/#bundled-wheels-on-linux). In particular, PyICU releases would be tied to a specific version of ICU, rather than using the system-provided one. The situation would be much simpler if distros provided [ABI-compatible versions of ICU with function renaming disabled](http://userguide.icu-project.org/design#TOC-ICU-Binary-Compatibility:-Using-ICU-as-an-Operating-System-Level-Library), which [for various reasons](https://bugs.launchpad.net/ubuntu/+source/icu/+bug/675946) is not the case.
However, this opens up the possibility of synchronizing PyICU version numbers with upstream (e.g. pyicu==58.2 for ICU 58.2) and more easily publishing Windows and OSX packages that can be installed and used without a compiler.
You can see the [Travis builds](https://travis-ci.org/sciyoshi/pyicu/builds/221577736) and [the resulting wheels uploaded to GitHub](https://github.com/sciyoshi/pyicu/releases/tag/1.9.7.dev1) if you'd like to try using them locally.
Note that this patch also changes the tests to use [six](https://pythonhosted.org/six/) rather than [2to3](https://docs.python.org/2/library/2to3.html) as a compatibility layer, which means that the _tests_ will now only work on Python 2.6+ and Python 3.3+. Python 2.5 and below are not supported by Travis in any case, but this change is separate and could be reworked. (My editor also trimmed trailing spaces, but `?w=1` in the URL can hide that noise...)
In any case, let me know your thoughts. Thanks!