Skip to content

Commit 33e84f1

Browse files
Merge pull request #70 from jim-easterbrook/devel
Devel
2 parents ada2236 + 924015d commit 33e84f1

101 files changed

Lines changed: 8966 additions & 31466 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/workflows/build-exiv2-wheels-prebuilt.yml‎

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,36 +30,37 @@ jobs:
3030
runner: windows-2022
3131
exiv2_build: 2022msvc-AMD64
3232
arch: AMD64
33+
env:
34+
EXIV2_VSN: 0.28.8
35+
EXIV2_ROOT: exiv2-0.28.8-${{ matrix.exiv2_build }}
3336
defaults:
3437
run:
3538
shell: bash
36-
env:
37-
EXIV2_VSN: 0.28.8
3839
steps:
3940
- name: Check out repository code
4041
uses: actions/checkout@v6
4142

4243
- name: Download exiv2.tar.gz
4344
if: ${{ runner.os != 'Windows' }}
4445
run: |
45-
wget -nv https://github.com/Exiv2/exiv2/releases/download/v${{ env.EXIV2_VSN }}/exiv2-${{ env.EXIV2_VSN }}-${{ matrix.exiv2_build }}.tar.gz -O - |
46+
wget -nv https://github.com/Exiv2/exiv2/releases/download/v${{ env.EXIV2_VSN }}/${{ env.EXIV2_ROOT }}.tar.gz -O - |
4647
tar zxf -
4748
4849
- name: Download exiv2.zip
4950
if: ${{ runner.os == 'Windows' }}
5051
run: |
51-
c:/msys64/usr/bin/wget.exe -nv https://github.com/Exiv2/exiv2/releases/download/v${{ env.EXIV2_VSN }}/exiv2-${{ env.EXIV2_VSN }}-${{ matrix.exiv2_build }}.zip -O exiv2.zip
52+
c:/msys64/usr/bin/wget.exe -nv https://github.com/Exiv2/exiv2/releases/download/v${{ env.EXIV2_VSN }}/${{ env.EXIV2_ROOT }}.zip -O exiv2.zip
5253
unzip exiv2.zip
5354
5455
- name: Build wheels
55-
# cibuildwheel@v3.x omits Python 3.6 & 3.7
56-
uses: pypa/cibuildwheel@v3.4.0
56+
# cibuildwheel@v4.x does Python 3.9+
57+
uses: pypa/cibuildwheel@v4.2.0
5758
env:
5859
CIBW_ARCHS: ${{ matrix.arch }}
59-
CIBW_ENVIRONMENT: >
60-
EXIV2_ROOT=exiv2-${{ env.EXIV2_VSN }}-${{ matrix.exiv2_build }}
6160
CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_34
6261
CIBW_MANYLINUX_AARCH64_IMAGE: manylinux_2_34
62+
CIBW_ENVIRONMENT_WINDOWS: PATH="$EXIV2_ROOT/bin;$PATH"
63+
CIBW_ENVIRONMENT_PASS_LINUX: EXIV2_ROOT
6364
CIBW_BUILD: "cp*"
6465
CIBW_SKIP: "*musllinux*"
6566
CIBW_BEFORE_ALL_MACOS: brew install inih

‎.github/workflows/build-exiv2-wheels.yml‎

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,29 @@ jobs:
1212
runner: ubuntu-22.04
1313
arch: x86_64
1414
wget: wget
15+
exiv2_build: build-linux-release
1516
- build: Linux-arm64
1617
runner: ubuntu-22.04-arm
1718
arch: aarch64
1819
wget: wget
20+
exiv2_build: build-linux-release
1921
- build: MacOS-x64
2022
runner: macos-15-intel
2123
target: 14.0
2224
arch: x86_64
2325
wget: wget
26+
exiv2_build: build-base_mac
2427
- build: MacOS-arm64
2528
runner: macos-14
2629
target: 14.0
2730
arch: arm64
2831
wget: wget
32+
exiv2_build: build-base_mac
2933
- build: Windows-x64
3034
runner: windows-2022
3135
arch: AMD64
3236
wget: c:/msys64/usr/bin/wget.exe
37+
exiv2_build: build-win-release
3338
env:
3439
EXIV2_SRC: >
3540
https://github.com/Exiv2/exiv2/archive/refs/tags/v0.28.8.tar.gz
@@ -40,6 +45,7 @@ jobs:
4045
-D EXIV2_ENABLE_FILESYSTEM_ACCESS=ON
4146
-D EXIV2_ENABLE_NLS=ON
4247
-D EXIV2_TEAM_WARNINGS_AS_ERRORS=OFF
48+
EXIV2_ROOT: libexiv2/${{ matrix.exiv2_build }}/install
4349
MACOSX_DEPLOYMENT_TARGET: ${{ matrix.target }}
4450
defaults:
4551
run:
@@ -97,23 +103,21 @@ jobs:
97103
cmake --build build-base_mac --config Release &&
98104
cmake --install build-base_mac --config Release
99105
100-
- name: Build wheels (Python 3.6 & 3.7)
101-
if: ${{ runner.os != 'macOS' }}
102-
# cibuildwheel@v3.x omits Python 3.6 & 3.7
106+
- name: Build wheels (Python 3.6 - 3.8)
107+
# cibuildwheel@v4.x does Python 3.9+
103108
uses: pypa/cibuildwheel@v2.23.3
104109
env:
105110
CIBW_ARCHS: ${{ matrix.arch }}
106111
CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_28
107112
CIBW_MANYLINUX_AARCH64_IMAGE: manylinux_2_28
108113
CIBW_ENVIRONMENT_LINUX: >
109-
EXIV2_ROOT=libexiv2/build-linux-release/install
110-
CIBW_ENVIRONMENT_MACOS: >
111-
EXIV2_ROOT=libexiv2/build-base_mac/install
112-
CIBW_ENVIRONMENT_WINDOWS: >
113-
EXIV2_ROOT=libexiv2/build-win-release/install
114-
CIBW_ENVIRONMENT_PASS_LINUX: EXIV2_OPTIONS
115-
CIBW_BUILD: "cp36* cp37*"
116-
CIBW_SKIP: "*musllinux*"
114+
AUDITWHEEL_PLAT=manylinux_2_27_${{ matrix.arch }}
115+
CIBW_ENVIRONMENT_WINDOWS: PATH="$EXIV2_ROOT/bin;$PATH"
116+
CIBW_ENVIRONMENT_PASS_LINUX: EXIV2_OPTIONS EXIV2_ROOT
117+
CIBW_BUILD: "cp3*"
118+
CIBW_SKIP: "*musllinux* cp39* cp31*"
119+
CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: >
120+
delvewheel repair -w {dest_dir} -v {wheel}
117121
CIBW_TEST_COMMAND: >
118122
python -m exiv2 -v &&
119123
python -m unittest discover {project}/tests -v
@@ -131,21 +135,19 @@ jobs:
131135
-D CONAN_AUTO_INSTALL=OFF &&
132136
cmake --build build-linux-release --config Release &&
133137
cmake --install build-linux-release --config Release
138+
CIBW_BEFORE_ALL_WINDOWS: pip install delvewheel
134139

135-
- name: Build wheels (Python 3.8+)
136-
uses: pypa/cibuildwheel@v3.4.0
140+
- name: Build wheels (Python 3.9+)
141+
uses: pypa/cibuildwheel@v4.2.0
137142
env:
138143
CIBW_ARCHS: ${{ matrix.arch }}
139144
CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_28
140145
CIBW_MANYLINUX_AARCH64_IMAGE: manylinux_2_28
141146
CIBW_ENVIRONMENT_LINUX: >
142-
EXIV2_ROOT=libexiv2/build-linux-release/install
143-
CIBW_ENVIRONMENT_MACOS: >
144-
EXIV2_ROOT=libexiv2/build-base_mac/install
145-
CIBW_ENVIRONMENT_WINDOWS: >
146-
EXIV2_ROOT=libexiv2/build-win-release/install
147-
CIBW_ENVIRONMENT_PASS_LINUX: EXIV2_OPTIONS
148-
CIBW_BUILD: "cp*"
147+
AUDITWHEEL_PLAT=manylinux_2_27_${{ matrix.arch }}
148+
CIBW_ENVIRONMENT_WINDOWS: PATH="$EXIV2_ROOT/bin;$PATH"
149+
CIBW_ENVIRONMENT_PASS_LINUX: EXIV2_OPTIONS EXIV2_ROOT
150+
CIBW_BUILD: "cp3*"
149151
CIBW_SKIP: "*musllinux*"
150152
CIBW_TEST_COMMAND: >
151153
python -m exiv2 -v &&
@@ -161,8 +163,8 @@ jobs:
161163
cd ../../libexiv2 &&
162164
cmake --preset linux-release $EXIV2_OPTIONS
163165
-D CONAN_AUTO_INSTALL=OFF &&
164-
cmake --build build-linux-release --config Release &&
165-
cmake --install build-linux-release --config Release
166+
cmake --build ${{ matrix.exiv2_build }} --config Release &&
167+
cmake --install ${{ matrix.exiv2_build }} --config Release
166168
167169
- name: Store results
168170
uses: actions/upload-artifact@v6

‎CHANGELOG.txt‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ You should have received a copy of the GNU General Public License
1616
along with this program. If not, see
1717
<http://www.gnu.org/licenses/>.
1818

19+
Changes in v0.19.1:
20+
1/ Reduce chance of "DLL hell" with Windows binary wheel.
21+
2/ XmpValueArray constructor checks typeId value.
22+
1923
Changes in v0.19.0:
2024
1/ Add exiv2.XmpParser.encode() to Python interface.
2125
2/ Fix crash when getting strings of malformed values.

‎README.rst‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
python-exiv2 v\ 0.19.0
1+
python-exiv2 v\ 0.19.1
22
======================
33

44
python-exiv2 is a low level interface (or binding) to the exiv2_ C++ library.

‎setup.py‎

Lines changed: 26 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# python-exiv2 - Python interface to libexiv2
22
# http://github.com/jim-easterbrook/python-exiv2
3-
# Copyright (C) 2021-25 Jim Easterbrook jim@jim-easterbrook.me.uk
3+
# Copyright (C) 2021-26 Jim Easterbrook jim@jim-easterbrook.me.uk
44
#
55
# This program is free software: you can redistribute it and/or modify
66
# it under the terms of the GNU General Public License as published by
@@ -73,6 +73,7 @@ def get_mod_src_dir(exiv2_version):
7373
packages = ['exiv2', 'exiv2.examples']
7474
package_dir = {'exiv2.examples': 'examples'}
7575
package_data = {'exiv2.examples': ['*.py', '*.rst']}
76+
extra_link_args = []
7677

7778
if 'EXIV2_ROOT' in os.environ:
7879
# use local copy of libexiv2
@@ -83,29 +84,39 @@ def get_mod_src_dir(exiv2_version):
8384
print('ERROR: Include files not found')
8485
sys.exit(1)
8586
include_dirs = [path]
86-
# library files
87-
packages.append('exiv2.lib')
87+
# find library files
8888
if platform == 'linux':
8989
path = os.path.join(exiv2_root, 'lib64')
9090
if not os.path.exists(path):
9191
path = os.path.join(exiv2_root, 'lib')
92-
library_dirs = [path]
93-
package_dir['exiv2.lib'] = path
94-
package_data['exiv2.lib'] = [x for x in os.listdir(path)
95-
if re.fullmatch(r'libexiv2\.so\.\d+', x)]
92+
files = [x for x in os.listdir(path)
93+
if re.fullmatch(r'libexiv2\.so\.\d+', x)]
9694
elif platform == 'darwin':
9795
path = os.path.join(exiv2_root, 'lib')
98-
library_dirs = [path]
99-
package_dir['exiv2.lib'] = path
100-
package_data['exiv2.lib'] = [x for x in os.listdir(path)
101-
if re.fullmatch(r'libexiv2\.\d+\.dylib', x)]
96+
files = [x for x in os.listdir(path)
97+
if re.fullmatch(r'libexiv2\.\d+\.dylib', x)]
10298
elif platform in ('win32', 'mingw'):
103-
library_dirs = [os.path.join(exiv2_root, 'lib')]
104-
package_dir['exiv2.lib'] = os.path.join(exiv2_root, 'bin')
105-
package_data['exiv2.lib'] = ['*.dll']
106-
if not os.path.isdir(package_dir['exiv2.lib']):
99+
path = os.path.join(exiv2_root, 'lib')
100+
files = '*.dll'
101+
if not os.path.isdir(path):
107102
print('ERROR: Library files not found')
108103
sys.exit(1)
104+
library_dirs = [path]
105+
if 'CIBUILDWHEEL' in os.environ:
106+
# include library files in "system" libraries to be renamed
107+
if platform in ('linux', 'darwin'):
108+
extra_link_args = ['-Wl,-rpath,{}'.format(os.path.abspath(path))]
109+
else:
110+
# add library files to package data
111+
packages.append('exiv2.lib')
112+
package_dir['exiv2.lib'] = path
113+
package_data['exiv2.lib'] = files
114+
if platform == 'linux':
115+
extra_link_args = ['-Wl,-rpath,$ORIGIN/lib']
116+
elif platform == 'darwin':
117+
extra_link_args = ['-Wl,-rpath,@loader_path/lib']
118+
elif platform in ('win32', 'mingw'):
119+
package_dir['exiv2.lib'] = os.path.join(exiv2_root, 'bin')
109120
# locale files
110121
path = os.path.join(exiv2_root, 'share', 'locale')
111122
if not os.path.isdir(path):
@@ -121,12 +132,6 @@ def get_mod_src_dir(exiv2_version):
121132
# get exiv2 version from include files
122133
exiv2_version = get_version(include_dirs[0])
123134
mod_src_dir = get_mod_src_dir(exiv2_version)
124-
if platform == 'linux':
125-
extra_link_args = ['-Wl,-rpath,$ORIGIN/lib']
126-
elif platform == 'darwin':
127-
extra_link_args = ['-Wl,-rpath,@loader_path/lib']
128-
else:
129-
extra_link_args = []
130135
else:
131136
# use installed libexiv2
132137
exiv2_version = pkg_config('exiv2', 'modversion')

‎src/doc/requirements.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
exiv2 == 0.19.0
1+
exiv2 == 0.19.1
22
sphinx == 8.2.3
33
sphinx-rtd-theme == 3.0.2
44
enum_tools[sphinx] >= 0.13

‎src/interface/value.i‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -489,6 +489,13 @@ PyObject* data() {
489489
%feature("python:slot", "sq_item", functype="ssizeargfunc")
490490
Exiv2::XmpArrayValue::toString;
491491
%typemap(default) Exiv2::TypeId typeId_xmpBag {$1 = Exiv2::xmpBag;}
492+
%typemap(check) Exiv2::TypeId typeId_xmpBag {
493+
if (($1 != Exiv2::xmpBag) && ($1 != Exiv2::xmpSeq) &&
494+
($1 != Exiv2::xmpAlt)) {
495+
SWIG_exception_fail(
496+
SWIG_ValueError, "Invalid typeId for XmpArrayValue.");
497+
}
498+
}
492499
%template() std::vector<std::string>;
493500
%extend Exiv2::XmpArrayValue {
494501
// Constructor, reads values from a Python list

‎src/swig-0_27_7/__init__.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
os.environ['PATH'] = _dir + ';' + os.environ['PATH']
1111

1212
#: python-exiv2 version as a string
13-
__version__ = "0.19.0"
13+
__version__ = "0.19.1"
1414
#: python-exiv2 version as a tuple of ints
15-
__version_tuple__ = tuple((0, 19, 0))
15+
__version_tuple__ = tuple((0, 19, 1))
1616

1717
from exiv2.extras import Exiv2Error
1818
__all__ = ["Exiv2Error"]

‎src/swig-0_27_7/basicio.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# This file was automatically generated by SWIG (https://www.swig.org).
2-
# Version 4.4.1
2+
# Version 4.5.0
33
#
44
# Do not make changes to this file unless you know what you are doing - modify
55
# the SWIG interface file instead.
66

7-
from sys import version_info as _swig_python_version_info
7+
import typing
88
import exiv2.types
99

1010
# Pull in all the attributes from the low-level C/C++ module

0 commit comments

Comments
 (0)