Skip to content

python bindings breakage with pip 25.3 #7370

Open

Description

@landryb

just being a messenger here, but apparently mapscript's python bits use a deprecated construct that is removed in pip 25.3, cf openbsd/ports@d991d63fbcf5 for a local fix

i can do a PR adding --use-pep517 to the 3 pip install invocations in https://github.com/MapServer/MapServer/blob/main/src/mapscript/python/CMakeLists.txt but i'd like to make sure this is backwards compatible with the various pip versions that are used to build mapserver in the ecosystem...

Activity

  1. geographika commented on Oct 28, 2025

    @geographika
    Member

    I'm not sure that I understand the changes in that patch - the --use-pep517 is to force use of a pyproject.toml (which doesn't exist).
    The PR title is stop using the legacy setup.py bdist_wheel mechanism which was removed which isn't used (python -m build --wheel is used for the build).
    The Python bindings would benefit from moving to pyproject.toml but I don't see a breaking issue at the moment.

  2. sthen commented on Oct 28, 2025

    @sthen

    I didn't look into all the details, was just doing a quick build fix, but building with pip 25.2 gives this warning

    Processing /pobj/mapserver-8.4.1/build-i386/src/mapscript/python
      Preparing metadata (setup.py): started
      Preparing metadata (setup.py): finished with status 'done'
    Building wheels for collected packages: mapscript
      DEPRECATION: Building 'mapscript' using the legacy setup.py bdist_wheel mechanism, which will be removed in a future
     version. pip 25.3 will enforce this behaviour change. A possible replacement is to use the standardized build interfa
    ce by setting the `--use-pep517` option, (possibly combined with `--no-build-isolation`), or adding a `pyproject.toml`
     file to the source tree of 'mapscript'. Discussion can be found at https://github.com/pypa/pip/issues/6334
    

    ...building with 25.3 as-is fails; building with 25.3 with --use-pep517 --no-build-isolation succeeds.

  3. sthen commented on Oct 28, 2025

    @sthen

    ...if I try with 25.3 it goes off to the network (which is blocked in openbsd ports builds) to try and install setuptools:

    -- Install configuration: "Release"
    Processing /usr/obj/ports/mapserver-8.4.1/build-amd64/src/mapscript/python
      Installing build dependencies: started
      Installing build dependencies: finished with status 'error'
      error: subprocess-exited-with-error
      
      × installing build dependencies did not run successfully.
      │ exit code: 1
      ╰─> [7 lines of output]
          WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x9966f2cc7a0>: Failed to establish a new connection: [Errno 13] Permission denied')': /simple/setuptools/
          WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x996d04111c0>: Failed to establish a new connection: [Errno 13] Permission denied')': /simple/setuptools/
          WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x996d0411580>: Failed to establish a new connection: [Errno 13] Permission denied')': /simple/setuptools/
          WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x996d0411490>: Failed to establish a new connection: [Errno 13] Permission denied')': /simple/setuptools/
          WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x996d0411970>: Failed to establish a new connection: [Errno 13] Permission denied')': /simple/setuptools/
          ERROR: Could not find a version that satisfies the requirement setuptools>=40.8.0 (from versions: none)
          ERROR: No matching distribution found for setuptools>=40.8.0
          [end of output]
      
      note: This error originates from a subprocess, and is likely not a problem with pip.
    ERROR: Failed to build 'file:///usr/obj/ports/mapserver-8.4.1/build-amd64/src/mapscript/python' when installing build dependencies
    

    (there might be better ways to fix this, but adding --use-pep517 --no-build-isolation to the pip install lines worked for me)

  4. landryb commented on Oct 28, 2025

    @landryb
    ContributorAuthor

    The PR title is stop using the legacy setup.py bdist_wheel mechanism which was removed which isn't used (python -m build --wheel is used for the build).

    @sthen 's patch fixes the pip install invocations, not the one actually building the wheel ?

  5. landryb commented on Oct 31, 2025

    @landryb
    ContributorAuthor

    i can reproduce the issue building from the source tree, using a _pbuild user that doesn't have access to the network (and pip 25.3), and it gives this during install to prefix:

    Processing /home/landry/src/MapServer/obj/src/mapscript/python                                            
      Installing build dependencies: started           
      Installing build dependencies: finished with status 'error'                                                                                                                                                        
      error: subprocess-exited-with-error                                                                     
                                                                                                              
      × installing build dependencies did not run successfully.                                               
      │ exit code: 1                                                                                          
      ╰─> [8 lines of output]                                                                                 
          WARNING: The directory '/nonexistent/.cache/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. I
    f executing pip with sudo, you should use sudo's -H flag.                   
          WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0xeae6b26f3b0
    >: Failed to establish a new connection: [Errno -5] no address associated with name')': /simple/setuptools/
          WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0xeae6b26fa10
    >: Failed to establish a new connection: [Errno -5] no address associated with name')': /simple/setuptools/
          WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0xeae6b26fda0
    >: Failed to establish a new connection: [Errno -5] no address associated with name')': /simple/setuptools/
          WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0xeae6b26ffb0
    >: Failed to establish a new connection: [Errno -5] no address associated with name')': /simple/setuptools/
          WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0xeae6b26fef0
    >: Failed to establish a new connection: [Errno -5] no address associated with name')': /simple/setuptools/
          ERROR: Could not find a version that satisfies the requirement setuptools>=40.8.0 (from versions: none)
          ERROR: No matching distribution found for setuptools>=40.8.0                                        
          [end of output]                                                                                     
                                                                                                              
      note: This error originates from a subprocess, and is likely not a problem with pip.
    ERROR: Failed to build 'file:///home/landry/src/MapServer/obj/src/mapscript/python' when installing build dependencies
    

    steps:

    $ cmake -DCMAKE_INSTALL_PREFIX=/tmp/ms -DWITH_PYTHON=1 .. 
    $ cmake --build .
    $ cmake --install .
    

    adding --use-pep517 --no-build-isolation to the 3 pip install invocations gives this (eg works):

      Preparing metadata (pyproject.toml): started                                                            
      Preparing metadata (pyproject.toml): finished with status 'done'               
    Building wheels for collected packages: mapscript                                                         
      Building wheel for mapscript (pyproject.toml): started                                                  
      Building wheel for mapscript (pyproject.toml): finished with status 'done'                              
      Created wheel for mapscript: filename=mapscript-8.5.0-cp312-cp312-openbsd_7_8_amd64.whl size=424930 sha256=1c9b717ade71efa815f7162ae44f7418bf96c8a680431c035026f51000599de5
      Stored in directory: /tmp/pip-ephem-wheel-cache-m2r9gzq5/wheels/fd/13/a2/a9422b2757b42aa4aab573d9a4dce5bc34e4c5ec837caf1624
    Successfully built mapscript                                                                              
    Installing collected packages: mapscript                                                                  
    Successfully installed mapscript-8.5.0   
    

    i guess :

    ---no-build-isolation works around the pip trying to reach the internet for dependencies and might not be acceptable upstream, since it means dependencies (only setuptools ?) need to be installed before building, per https://pip.pypa.io/en/stable/cli/pip_install/#cmdoption-no-build-isolation)

    • --use-pep517 works around the new deprecation in pip 25.3.

    A bunch more details at https://fromkk.com/posts/modern-pip-build-process-use-pep517/ , but i have to admit i personally dont know that much those python build systems..

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