Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V0.16 #22

Merged
merged 13 commits into from
Jan 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/build-linux-27.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ jobs:
CIBW_BEFORE_ALL: >
yum install -y zlib-devel expat-devel gettext-devel
libcurl-devel libssh-devel &&
localedef -c -i de_DE -f UTF-8 de_DE.UTF-8 &&
cd libexiv2 &&
cmake -B build-linux -D CMAKE_BUILD_TYPE=Release
-D CMAKE_INSTALL_PREFIX=build-linux/install
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/build-linux-28.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ jobs:
libcurl-devel libssh-devel brotli-devel &&
rpm -Uvh inih*.rpm &&
dnf install inih inih-devel &&
localedef -c -i de_DE -f UTF-8 de_DE.UTF-8 &&
pip install ninja &&
cd libexiv2 &&
cmake --preset linux-release
Expand Down
13 changes: 10 additions & 3 deletions .github/workflows/build-macos-arm-27.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ on: workflow_dispatch

jobs:
build:
runs-on: macos-latest
runs-on: flyci-macos-large-latest-m1
steps:
- name: Check out repository code
uses: actions/checkout@v4
Expand All @@ -20,6 +20,9 @@ jobs:
tar -xzf exiv2.tar.gz
mv exiv2-0.27.7-Source libexiv2

- name: Install pipx
run: pip install pipx

- name: Build wheels
uses: pypa/cibuildwheel@v2.16.2
env:
Expand All @@ -29,17 +32,21 @@ jobs:
CIBW_TEST_COMMAND: >
python -m exiv2 -v &&
python -m unittest discover {project}/tests -v
CIBW_TEST_SKIP: cp38-*
CIBW_BEFORE_ALL: >
brew install ninja &&
brew install ninja libssh curl &&
cd libexiv2 &&
cmake . -B build-macos -DCMAKE_BUILD_TYPE=Release
-D CMAKE_INSTALL_PREFIX=build-macos/install
-D CMAKE_CXX_FLAGS="-Wno-deprecated-declarations"
-D EXIV2_BUILD_SAMPLES=OFF
-D EXIV2_BUILD_EXIV2_COMMAND=OFF
-D EXIV2_ENABLE_BMFF=ON
-D EXIV2_ENABLE_NLS=OFF
-D EXIV2_ENABLE_NLS=ON
-D EXIV2_ENABLE_VIDEO=ON
-D EXIV2_ENABLE_WEBREADY=ON
-D EXIV2_ENABLE_CURL=ON
-D EXIV2_ENABLE_SSH=ON
-D CMAKE_CXX_STANDARD=98
-D CMAKE_OSX_ARCHITECTURES=arm64
-G Ninja &&
Expand Down
42 changes: 31 additions & 11 deletions .github/workflows/build-windows-27.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,19 @@ jobs:
- name: Check out repository code
uses: actions/checkout@v4

- name: Fetch Gettext
run: >
c:\msys64\usr\bin\wget.exe -nv
https://github.com/mlocati/gettext-iconv-windows/releases/download/v0.21-v1.16/gettext0.21-iconv1.16-shared-64.zip
-O gettext.zip

- name: Extract Gettext
shell: bash
run: |
mkdir gettext
cd gettext
unzip ../gettext.zip

- name: Fetch Exiv2 source
run: >
c:\msys64\usr\bin\wget.exe -nv
Expand All @@ -19,13 +32,19 @@ jobs:
run: |
tar -xzf exiv2.tar.gz
mv exiv2-0.27.7-Source libexiv2
# tweaks to allow NLS
rm libexiv2/cmake/FindIconv.cmake
echo -e "24a25\n> self.requires('libgettext/0.21')" |
c:/msys64/usr/bin/patch.exe libexiv2/conanfile.py

- name: Build wheels
uses: pypa/cibuildwheel@v2.16.2
env:
CIBW_ARCHS: auto64
CIBW_SKIP: pp3*
CIBW_ENVIRONMENT: EXIV2_ROOT=libexiv2/build-msvc/install
CIBW_ENVIRONMENT: |
EXIV2_ROOT=libexiv2/build-msvc/install
PATH="$PATH;$(pwd)\\gettext\\bin"
CIBW_TEST_COMMAND: >
python -m exiv2 -v &&
python -m unittest discover {project}/tests -v
Expand All @@ -34,16 +53,17 @@ jobs:
cd libexiv2 &&
conan install . -of build-msvc -if build-msvc -o unitTests=False
-o iconv=True -o webready=True -b missing &&
cmake -B build-msvc -DCMAKE_BUILD_TYPE=Release
-DCMAKE_INSTALL_PREFIX=build-msvc/install
-DEXIV2_ENABLE_WIN_UNICODE=ON
-DEXIV2_BUILD_SAMPLES=OFF
-DEXIV2_BUILD_EXIV2_COMMAND=OFF
-DEXIV2_ENABLE_BMFF=ON
-DEXIV2_ENABLE_NLS=OFF
-DEXIV2_ENABLE_VIDEO=ON
-DEXIV2_ENABLE_WEBREADY=ON
-DCMAKE_CXX_STANDARD=98
cmake -B build-msvc
-D CMAKE_BUILD_TYPE=Release
-D CMAKE_INSTALL_PREFIX=build-msvc/install
-D EXIV2_ENABLE_WIN_UNICODE=ON
-D EXIV2_BUILD_SAMPLES=OFF
-D EXIV2_BUILD_EXIV2_COMMAND=OFF
-D EXIV2_ENABLE_BMFF=ON
-D EXIV2_ENABLE_NLS=ON
-D EXIV2_ENABLE_VIDEO=ON
-D EXIV2_ENABLE_WEBREADY=ON
-D CMAKE_CXX_STANDARD=98
-G "Visual Studio 16 2019" -A x64 &&
cmake --build build-msvc --config Release &&
cmake --install build-msvc --config Release
Expand Down
21 changes: 20 additions & 1 deletion .github/workflows/build-windows-28.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,19 @@ jobs:
- name: Check out repository code
uses: actions/checkout@v4

- name: Fetch Gettext
run: >
c:\msys64\usr\bin\wget.exe -nv
https://github.com/mlocati/gettext-iconv-windows/releases/download/v0.21-v1.16/gettext0.21-iconv1.16-shared-64.zip
-O gettext.zip

- name: Extract Gettext
shell: bash
run: |
mkdir gettext
cd gettext
unzip ../gettext.zip

- name: Fetch Exiv2 source
run: >
c:\msys64\usr\bin\wget.exe -nv
Expand All @@ -19,13 +32,18 @@ jobs:
run: |
tar -xzf exiv2.tar.gz
mv exiv2-0.28.1 libexiv2
# tweaks to allow NLS
echo -e "24a25\n> self.requires('libgettext/0.21')" |
c:/msys64/usr/bin/patch.exe libexiv2/conanfile.py

- name: Build wheels
uses: pypa/cibuildwheel@v2.16.2
env:
CIBW_ARCHS: auto64
CIBW_SKIP: pp3*
CIBW_ENVIRONMENT: EXIV2_ROOT=libexiv2/build-msvc/install
CIBW_ENVIRONMENT: |
EXIV2_ROOT=libexiv2/build-msvc/install
PATH="$PATH;$(pwd)\\gettext\\bin"
CIBW_TEST_COMMAND: >
python -m exiv2 -v &&
python -m unittest discover {project}/tests -v
Expand All @@ -37,6 +55,7 @@ jobs:
-D EXIV2_BUILD_SAMPLES=OFF
-D EXIV2_BUILD_EXIV2_COMMAND=OFF
-D EXIV2_BUILD_UNIT_TESTS=OFF
-D EXIV2_ENABLE_NLS=ON
-G "Visual Studio 16 2019" &&
cmake --build build-msvc --config Release &&
cmake --install build-msvc --config Release &&
Expand Down
24 changes: 13 additions & 11 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
python-exiv2 - Python interface to libexiv2
http://github.com/jim-easterbrook/python-exiv2
Copyright (C) 2022-23 Jim Easterbrook jim@jim-easterbrook.me.uk
Copyright (C) 2022-24 Jim Easterbrook jim@jim-easterbrook.me.uk

This program is free software: you can redistribute it and/or
modify it under the terms of the GNU General Public License as
Expand All @@ -17,16 +17,18 @@ along with this program. If not, see
<http://www.gnu.org/licenses/>.

Changes in v0.16.0:
*/ API change: DateValue.getDate() returns Python dict.
*/ API change: TimeValue.getTime() returns Python dict.
*/ Deprecated: exiv2.Date and exiv2.Time objects.
*/ Add buffer interface to PreviewImage
*/ Set datum value from Python object directly instead of via string.
*/ Add enums for LogMsg.Level
*/ Moved Position enum to BasicIo class.
*/ Moved CharsetId enum to CommentValue class.
*/ Moved XmpArrayType and XmpStruct enums to XmpValue class.
*/ More exiv2 structs are iterable for easy conversion to Python dict.
1/ Binary wheels incorporate libexiv2 v0.28.1.
2/ Include native language support in Windows binary wheel builds.
3/ API change: DateValue.getDate() returns Python dict.
4/ API change: TimeValue.getTime() returns Python dict.
5/ Deprecated: exiv2.Date and exiv2.Time objects.
6/ Added buffer interface to PreviewImage
7/ Set datum value from Python object directly instead of via string.
8/ Moved Position enum to BasicIo class.
9/ Moved CharsetId enum to CommentValue class.
10/ Moved XmpArrayType and XmpStruct enums to XmpValue class.
11/ Added enums for LogMsg.Level
12/ More exiv2 structs are iterable for easy conversion to Python dict.

Changes in v0.15.0:
1/ Added __version_tuple__ for easy runtime version testing.
Expand Down
12 changes: 12 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,18 @@ Here is an example of its use:

Please see `<USAGE.rst>`_ for more help with using the Python interface to libexiv2.

Transition to libexiv2 v0.28.x
------------------------------

Before python-exiv2 v0.16 the "binary wheels" available from PyPI_ incorporated libexiv2 v0.27.7 or earlier.
Binary wheels for python-exiv2 v0.16.0 incorporate libexiv2 v0.28.1, and those for for python-exiv2 v0.16.1 incorporate libexiv2 v0.27.7.
This allows you to test your software with the new version of libexiv2 by explicitly installing python-exiv2 v0.16.0::

$ pip install --user python-exiv2==0.16.0

There are some changes in the libexiv2 API between v0.27.7 and v0.28.x.
Future versions of python-exiv2 will all incorporate libexiv2 v0.28.x, so please test your software with the changed API.

Documentation
-------------

Expand Down
12 changes: 0 additions & 12 deletions src/interface/error.i
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,6 @@

%include "std_except.i"

// Make all exiv2's localised strings UTF-8
%{
#ifdef EXV_ENABLE_NLS
#include "libintl.h"
#endif
%}
%init %{
#ifdef EXV_ENABLE_NLS
bind_textdomain_codeset("exiv2", "UTF-8");
#endif
%}


// Set Python logger as Exiv2 log handler
%{
Expand Down
12 changes: 12 additions & 0 deletions src/interface/types.i
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,20 @@
// (types.hpp includes exiv2's localisation stuff)
%{
#ifdef EXV_ENABLE_NLS
#if defined _WIN32 && !defined __CYGWIN__
// Avoid needing to find libintl.h probably installed with Conan
extern "C" {
extern char* libintl_bindtextdomain(const char* domainname,
const char* dirname);
static inline char* bindtextdomain(const char* __domainname,
const char* __dirname) {
return libintl_bindtextdomain(__domainname, __dirname);
}
}
#else
#include "libintl.h"
#endif
#endif // EXV_ENABLE_NLS
%}
%inline %{
void _set_locale_dir(const char* dirname) {
Expand Down
2 changes: 1 addition & 1 deletion src/swig-0_27_0/basicio.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This file was automatically generated by SWIG (https://www.swig.org).
# Version 4.1.1
# Version 4.2.0
#
# Do not make changes to this file unless you know what you are doing - modify
# the SWIG interface file instead.
Expand Down
Loading