Skip to content

Commit

Permalink
Merge pull request #34 from jim-easterbrook/devel
Browse files Browse the repository at this point in the history
Devel
  • Loading branch information
jim-easterbrook authored Feb 21, 2024
2 parents 11882b0 + cd7e0e2 commit 0c4034a
Show file tree
Hide file tree
Showing 89 changed files with 11,097 additions and 18,036 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/build-linux-27.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,15 @@ jobs:
uses: pypa/[email protected]
env:
CIBW_ARCHS: auto64
CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_28
CIBW_ENVIRONMENT: EXIV2_ROOT=libexiv2/build-linux/install
CIBW_BUILD: cp*-manylinux_x86_64
CIBW_TEST_COMMAND: >
python3 -m exiv2 -v &&
python3 -m unittest discover {project}/tests -v
CIBW_BEFORE_ALL: >
yum install -y zlib-devel expat-devel gettext-devel
libcurl-devel libssh-devel &&
libcurl-devel &&
localedef -c -i de_DE -f UTF-8 de_DE.UTF-8 &&
cd libexiv2 &&
cmake -B build-linux -D CMAKE_BUILD_TYPE=Release
Expand All @@ -44,13 +45,13 @@ jobs:
-D EXIV2_ENABLE_VIDEO=ON
-D EXIV2_ENABLE_WEBREADY=ON
-D EXIV2_ENABLE_CURL=ON
-D EXIV2_ENABLE_SSH=ON
-D EXIV2_ENABLE_SSH=OFF
-D CMAKE_CXX_STANDARD=98 &&
cmake --build build-linux &&
cmake --install build-linux
- name: Store results
uses: actions/upload-artifact@v3
with:
name: manylinux-wheel
name: linux-27-wheels
path: wheelhouse/*.whl
4 changes: 2 additions & 2 deletions .github/workflows/build-linux-28.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
python3 -m unittest discover {project}/tests -v
CIBW_BEFORE_ALL: >
yum install -y --nogpgcheck zlib-devel expat-devel gettext-devel
libcurl-devel libssh-devel brotli-devel meson &&
libcurl-devel brotli-devel meson &&
localedef -c -i de_DE -f UTF-8 de_DE.UTF-8 &&
pip install ninja &&
cd inih && mkdir build && cd build &&
Expand All @@ -62,5 +62,5 @@ jobs:
- name: Store results
uses: actions/upload-artifact@v3
with:
name: manylinux-wheel
name: linux-28-wheels
path: wheelhouse/*.whl
4 changes: 2 additions & 2 deletions .github/workflows/build-macos-27.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
-D EXIV2_ENABLE_VIDEO=ON
-D EXIV2_ENABLE_WEBREADY=ON
-D EXIV2_ENABLE_CURL=ON
-D EXIV2_ENABLE_SSH=ON
-D EXIV2_ENABLE_SSH=OFF
-D CMAKE_CXX_STANDARD=98
-G Ninja &&
cmake --build build-macos --config Release &&
Expand All @@ -51,5 +51,5 @@ jobs:
- name: Store results
uses: actions/upload-artifact@v3
with:
name: macos-wheel
name: macos-27-wheels
path: wheelhouse/*.whl
2 changes: 1 addition & 1 deletion .github/workflows/build-macos-28.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,5 @@ jobs:
- name: Store results
uses: actions/upload-artifact@v3
with:
name: macos-wheel
name: macos-28-wheels
path: wheelhouse/*.whl
6 changes: 3 additions & 3 deletions .github/workflows/build-macos-arm-27.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
python -m unittest discover {project}/tests -v
CIBW_TEST_SKIP: cp38-*
CIBW_BEFORE_ALL: >
brew install ninja libssh curl &&
brew install ninja curl &&
cd libexiv2 &&
cmake . -B build-macos -DCMAKE_BUILD_TYPE=Release
-D CMAKE_INSTALL_PREFIX=build-macos/install
Expand All @@ -46,7 +46,7 @@ jobs:
-D EXIV2_ENABLE_VIDEO=ON
-D EXIV2_ENABLE_WEBREADY=ON
-D EXIV2_ENABLE_CURL=ON
-D EXIV2_ENABLE_SSH=ON
-D EXIV2_ENABLE_SSH=OFF
-D CMAKE_CXX_STANDARD=98
-D CMAKE_OSX_ARCHITECTURES=arm64
-G Ninja &&
Expand All @@ -56,5 +56,5 @@ jobs:
- name: Store results
uses: actions/upload-artifact@v3
with:
name: macos-wheel
name: macos-arm-27-wheels
path: wheelhouse/*.whl
2 changes: 1 addition & 1 deletion .github/workflows/build-macos-arm-28.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,5 @@ jobs:
- name: Store results
uses: actions/upload-artifact@v3
with:
name: macos-wheel
name: macos-arm-28-wheels
path: wheelhouse/*.whl
7 changes: 4 additions & 3 deletions .github/workflows/build-windows-27.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ jobs:
EXIV2_ROOT=libexiv2/build-msvc/install
PATH="$PATH;$(pwd)\\gettext\\bin"
CIBW_TEST_COMMAND: >
python -m exiv2 -v
python -m exiv2 -v &&
python -m unittest discover {project}/tests -v
CIBW_BEFORE_ALL: >
pip install conan==1.59.0 &&
cd libexiv2 &&
Expand All @@ -55,7 +56,7 @@ jobs:
cmake -B build-msvc
-D CMAKE_BUILD_TYPE=Release
-D CMAKE_INSTALL_PREFIX=build-msvc/install
-D EXIV2_ENABLE_WIN_UNICODE=ON
-D EXIV2_ENABLE_WIN_UNICODE=OFF
-D EXIV2_BUILD_SAMPLES=OFF
-D EXIV2_BUILD_EXIV2_COMMAND=OFF
-D EXIV2_ENABLE_BMFF=ON
Expand All @@ -70,5 +71,5 @@ jobs:
- name: Store results
uses: actions/upload-artifact@v3
with:
name: windows-wheel
name: windows-27-wheels
path: wheelhouse/*.whl
2 changes: 1 addition & 1 deletion .github/workflows/build-windows-28.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,5 +64,5 @@ jobs:
- name: Store results
uses: actions/upload-artifact@v3
with:
name: windows-wheel
name: windows-28-wheels
path: wheelhouse/*.whl
3 changes: 3 additions & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see
<http://www.gnu.org/licenses/>.

Changes in v0.17.0:
1/ API change: derived classes of BasicIo are omitted from Python.

Changes in v0.16.3:
1/ Binary wheels incorporate libexiv2 v0.28.2.

Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
python-exiv2 v\ 0.16.3
python-exiv2 v\ 0.17.0
======================

python-exiv2 is a low level interface (or binding) to the exiv2_ C++ library.
Expand Down
11 changes: 4 additions & 7 deletions USAGE.rst
Original file line number Diff line number Diff line change
Expand Up @@ -387,8 +387,8 @@ Doing so will invalidate the memoryview and may cause a segmentation fault:
Buffer interface
----------------

The ``Exiv2::DataBuf``, ``Exiv2::PreviewImage``, and ``Exiv2::MemIO`` classes are all wrappers around a potentially large block of memory.
They each have methods to access that memory without copying, such as ``Exiv2::DataBuf::data()`` and ``Exiv2::MemIo::mmap()`` but in Python these classes also expose a `buffer interface`_. This allows them to be used almost anywhere that a `bytes-like object`_ is expected.
The ``Exiv2::DataBuf``, ``Exiv2::PreviewImage``, and ``Exiv2::BasicIO`` classes are all wrappers around a potentially large block of memory.
They each have methods to access that memory without copying, such as ``Exiv2::DataBuf::data()`` and ``Exiv2::BasicIo::mmap()`` but in Python these classes also expose a `buffer interface`_. This allows them to be used almost anywhere that a `bytes-like object`_ is expected.

For example, you could save a photograph's thumbnail in a separate file like this:

Expand All @@ -406,8 +406,7 @@ In python-exiv2 the ``data`` and ``size`` parameters are replaced with a single
The buffered data isn't actually read until ``Image::readMetadata`` is called, so python-exiv2 stores a reference to the buffer to stop the user accidentally deleting it.

When ``Image::writeMetadata`` is called exiv2 allocates a new block of memory to store the modified data.
The ``Image::io`` method returns an `Exiv2::MemIo`_ object that provides access to this data.
(`Exiv2::MemIo`_ is derived from `Exiv2::BasicIo`_.)
The ``Image::io`` method returns an `Exiv2::BasicIo`_ object that provides access to this data.

The ``BasicIo::mmap`` method allows access to the image file data without unnecessary copying.
However it is rather error prone, crashing your Python program with a segmentation fault if anything goes wrong.
Expand Down Expand Up @@ -453,7 +452,7 @@ Since python-exiv2 v0.15.0 this buffer can be writeable:
data[23] = 157 # modifies data buffer
image.readMetadata() # reads modified buffer data
The modified data is written back to the file (for ``Exiv2::FileIo``) or memory buffer (for `Exiv2::MemIo`_) when the memoryview_ is released.
The modified data is written back to the file or memory buffer when the memoryview_ is released.

.. _bytearray:
https://docs.python.org/3/library/stdtypes.html#bytearray
Expand Down Expand Up @@ -483,8 +482,6 @@ The modified data is written back to the file (for ``Exiv2::FileIo``) or memory
https://exiv2.org/doc/classExiv2_1_1Image.html
.. _Exiv2::ImageFactory:
https://exiv2.org/doc/classExiv2_1_1ImageFactory.html
.. _Exiv2::MemIo:
https://exiv2.org/doc/classExiv2_1_1MemIo.html
.. _Exiv2::Metadatum:
https://exiv2.org/doc/classExiv2_1_1Metadatum.html
.. _Exiv2::TagInfo:
Expand Down
11 changes: 8 additions & 3 deletions src/doc/_templates/module.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,14 @@
:top-classes: exiv2.value.Value
{% endif %}

{% if fullname == "exiv2._basicio" %}
.. inheritance-diagram:: {{ classes | join(" ") }}
:top-classes: exiv2.basicio.BasicIo
{% if fullname in ["exiv2._datasets", "exiv2._metadatum", "exiv2._properties", "exiv2._tags"] %}
.. inheritance-diagram:: exiv2.ExifKey exiv2.IptcKey exiv2.XmpKey
:top-classes: exiv2.metadatum.Key
{% endif %}

{% if fullname in ["exiv2._exif", "exiv2._iptc", "exiv2._metadatum", "exiv2._xmp"] %}
.. inheritance-diagram:: exiv2.Exifdatum exiv2.Iptcdatum exiv2.Xmpdatum
:top-classes: exiv2.metadatum.Metadatum
{% endif %}

.. autosummary::
Expand Down
2 changes: 1 addition & 1 deletion src/doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
import re

class_re = re.compile(r':class:`(\w+?)`')
percent_re = re.compile(r'%(\w+?)([.|(\s]|$)')
percent_re = re.compile(r'%(\w+?)([.,|(\s]|$)')

def process_docstring(app, what, name, obj, options, lines):
# replace/modify some docstrings
Expand Down
1 change: 1 addition & 0 deletions src/doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@ Python-exiv2 documentation
misc/readme
misc/install
misc/usage
misc/changelog
misc/api

10 changes: 10 additions & 0 deletions src/doc/misc/changelog.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.. This is part of the python-exiv2 documentation.
Copyright (C) 2024 Jim Easterbrook.
Release history
===============

.. literalinclude:: ../../../CHANGELOG.txt
:language: none
:start-after: licenses/>
:end-before: Changes in v0.4.0
2 changes: 1 addition & 1 deletion src/doc/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
exiv2 <= 0.16.3
exiv2 <= 0.17.0
sphinx == 7.2.6
sphinx-rtd-theme == 2.0.0
Loading

0 comments on commit 0c4034a

Please sign in to comment.