Skip to content

swig --version doesn't work in all versions of swig; -version should be used instead #4756

Closed

Description

@ngie-eign

Did code inspection and it looks like setup.py relies on swig --version returning something meaningful (see the linked code below).

--version isn't implemented on all versions of swig (it seems that it's only technically implemented on the MacOS version of the package).

FreeBSD

% swig --version
Unable to find option or file '--version', Use 'swig -help' for more information.
% swig -version 

SWIG Version 4.2.1

Compiled with c++ [amd64-portbld-freebsd14.3]

Configured options: +pcre

Please see https://www.swig.org for reporting bugs and further information

Linux

% lsb_release -a
No LSB modules are available.
Distributor ID: Raspbian
Description:    Raspbian GNU/Linux 12 (bookworm)
Release:        12
Codename:       bookworm
% swig --version
Unable to find option or file '--version', Use 'swig -help' for more information.
% swig -version 

SWIG Version 4.1.0

Compiled with g++ [arm-unknown-linux-gnueabihf]

Configured options: +pcre

Please see https://www.swig.org for reporting bugs and further information

macOS

% swig --version

SWIG Version 4.3.1

Compiled with clang++ [aarch64-apple-darwin24.2.0]

Configured options: +pcre

Please see https://www.swig.org for reporting bugs and further information

swig_version_text = run(f'{swig} --version', capture=1)

Activity

  1. Arthur-Barreto commented on Oct 29, 2025

    @Arthur-Barreto

    We’re running into the same deprecation warnings on Python 3.12:

    DeprecationWarning: builtin type SwigPyPacked has no module attribute
    DeprecationWarning: builtin type SwigPyObject has no module attribute
    DeprecationWarning: builtin type swigvarlink has no module attribute

    They show up as soon as we import fitz, both in our unit tests and in a container image we ship. Right now we’re silencing them via filterwarnings, but just wanted to +1 that the problem affects us too. Happy to retest when a fix lands.

  2. added a commit that references this issue on Oct 30, 2025
    d3287f9
  3. julian-smith-artifex-com commented on Oct 30, 2025

    @julian-smith-artifex-com
    Collaborator

    We keep issues open until they are fixed in a release, so reopening.

  4. ngie-eign commented on Oct 31, 2025

    @ngie-eign
    ContributorAuthor

    We keep issues open until they are fixed in a release, so reopening.

    Sounds good - thanks!

  5. julian-smith-artifex-com commented on Nov 5, 2025

    @julian-smith-artifex-com
    Collaborator

    Fixed in pymupdf-1.26.6.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions