fonttools / skia-pathops

Python bindings for the Skia library's Path Ops
https://skia.org/docs/dev/present/pathops/
BSD 3-Clause "New" or "Revised" License
47 stars 14 forks source link

Install/build fails with Python 3.13 on macOS #76

Open justvanrossum opened 20 hours ago

justvanrossum commented 20 hours ago

This is on macOS 14.2.1, Python 3.13.0rc3

Full log:

$ pip install skia-pathops
Collecting skia-pathops
  Using cached skia-pathops-0.8.0.post1.zip (67.0 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: skia-pathops
  Building wheel for skia-pathops (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for skia-pathops (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [240 lines of output]
      <string>:29: SyntaxWarning: invalid escape sequence '\s'
      <string>:7: DeprecationWarning: dep_util is Deprecated. Use functions from setuptools instead.
      <string>:11: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
      WARNING setuptools_scm.pyproject_reading toml section missing 'pyproject.toml does not contain a tool.setuptools_scm section'
      Traceback (most recent call last):
        File "/private/var/folders/r6/16l72gg51gqcwbgpk9gtv0mc0000gn/T/pip-build-env-gdjy5_7f/overlay/lib/python3.13/site-packages/setuptools_scm/_integration/pyproject_reading.py", line 36, in read_pyproject
          section = defn.get("tool", {})[tool_name]
                    ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
      KeyError: 'setuptools_scm'
      running bdist_wheel
      running build
      running build_py
      creating build/lib.macosx-10.13-universal2-cpython-313/pathops
      copying src/python/pathops/_version.py -> build/lib.macosx-10.13-universal2-cpython-313/pathops
      copying src/python/pathops/__init__.py -> build/lib.macosx-10.13-universal2-cpython-313/pathops
      copying src/python/pathops/operations.py -> build/lib.macosx-10.13-universal2-cpython-313/pathops
      running build_ext
      building 'pathops._pathops' extension
      creating build/temp.macosx-10.13-universal2-cpython-313/src/python/pathops
      clang++ -fno-strict-overflow -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -O3 -Wall -arch arm64 -arch x86_64 -Isrc/cpp/skia-builder/skia -Isrc/cpp/skia-builder/skia/src -I/Users/just/code/git/BlackFoundry/fontra/venv313/include -I/Library/Frameworks/Python.framework/Versions/3.13/include/python3.13 -c src/python/pathops/_pathops.cpp -o build/temp.macosx-10.13-universal2-cpython-313/src/python/pathops/_pathops.o -std=c++17 -stdlib=libc++ -mmacosx-version-min=10.9
      src/python/pathops/_pathops.cpp:55985:13: warning: code will never be executed [-Wunreachable-code]
                  goto bad;
                  ^~~~~~~~
      src/python/pathops/_pathops.cpp:56276:21: warning: fallthrough annotation in unreachable code [-Wunreachable-code-fallthrough]
                          CYTHON_FALLTHROUGH;
                          ^
      src/python/pathops/_pathops.cpp:576:36: note: expanded from macro 'CYTHON_FALLTHROUGH'
              #define CYTHON_FALLTHROUGH [[fallthrough]]
                                         ^
      src/python/pathops/_pathops.cpp:56287:21: warning: fallthrough annotation in unreachable code [-Wunreachable-code-fallthrough]
                          CYTHON_FALLTHROUGH;
                          ^
      src/python/pathops/_pathops.cpp:576:36: note: expanded from macro 'CYTHON_FALLTHROUGH'
              #define CYTHON_FALLTHROUGH [[fallthrough]]
                                         ^
      src/python/pathops/_pathops.cpp:56556:21: warning: fallthrough annotation in unreachable code [-Wunreachable-code-fallthrough]
                          CYTHON_FALLTHROUGH;
                          ^
      src/python/pathops/_pathops.cpp:576:36: note: expanded from macro 'CYTHON_FALLTHROUGH'
              #define CYTHON_FALLTHROUGH [[fallthrough]]
                                         ^
      src/python/pathops/_pathops.cpp:56567:21: warning: fallthrough annotation in unreachable code [-Wunreachable-code-fallthrough]
                          CYTHON_FALLTHROUGH;
                          ^
      src/python/pathops/_pathops.cpp:576:36: note: expanded from macro 'CYTHON_FALLTHROUGH'
              #define CYTHON_FALLTHROUGH [[fallthrough]]
                                         ^
      5 warnings generated.
      src/python/pathops/_pathops.cpp:55985:13: warning: code will never be executed [-Wunreachable-code]
                  goto bad;
                  ^~~~~~~~
      src/python/pathops/_pathops.cpp:56276:21: warning: fallthrough annotation in unreachable code [-Wunreachable-code-fallthrough]
                          CYTHON_FALLTHROUGH;
                          ^
      src/python/pathops/_pathops.cpp:576:36: note: expanded from macro 'CYTHON_FALLTHROUGH'
              #define CYTHON_FALLTHROUGH [[fallthrough]]
                                         ^
      src/python/pathops/_pathops.cpp:56287:21: warning: fallthrough annotation in unreachable code [-Wunreachable-code-fallthrough]
                          CYTHON_FALLTHROUGH;
                          ^
      src/python/pathops/_pathops.cpp:576:36: note: expanded from macro 'CYTHON_FALLTHROUGH'
              #define CYTHON_FALLTHROUGH [[fallthrough]]
                                         ^
      src/python/pathops/_pathops.cpp:56556:21: warning: fallthrough annotation in unreachable code [-Wunreachable-code-fallthrough]
                          CYTHON_FALLTHROUGH;
                          ^
      src/python/pathops/_pathops.cpp:576:36: note: expanded from macro 'CYTHON_FALLTHROUGH'
              #define CYTHON_FALLTHROUGH [[fallthrough]]
                                         ^
      src/python/pathops/_pathops.cpp:56567:21: warning: fallthrough annotation in unreachable code [-Wunreachable-code-fallthrough]
                          CYTHON_FALLTHROUGH;
                          ^
      src/python/pathops/_pathops.cpp:576:36: note: expanded from macro 'CYTHON_FALLTHROUGH'
              #define CYTHON_FALLTHROUGH [[fallthrough]]
                                         ^
      5 warnings generated.
      building 'skia' library
      Traceback (most recent call last):
        File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/urllib/request.py", line 1319, in do_open
          h.request(req.get_method(), req.selector, req.data, headers,
          ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                    encode_chunked=req.has_header('Transfer-encoding'))
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/http/client.py", line 1336, in request
          self._send_request(method, url, body, headers, encode_chunked)
          ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/http/client.py", line 1382, in _send_request
          self.endheaders(body, encode_chunked=encode_chunked)
          ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/http/client.py", line 1331, in endheaders
          self._send_output(message_body, encode_chunked=encode_chunked)
          ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/http/client.py", line 1091, in _send_output
          self.send(msg)
          ~~~~~~~~~^^^^^
        File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/http/client.py", line 1035, in send
          self.connect()
          ~~~~~~~~~~~~^^
        File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/http/client.py", line 1477, in connect
          self.sock = self._context.wrap_socket(self.sock,
                      ~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
                                                server_hostname=server_hostname)
                                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/ssl.py", line 455, in wrap_socket
          return self.sslsocket_class._create(
                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
              sock=sock,
              ^^^^^^^^^^
          ...<5 lines>...
              session=session
              ^^^^^^^^^^^^^^^
          )
          ^
        File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/ssl.py", line 1076, in _create
          self.do_handshake()
          ~~~~~~~~~~~~~~~~~^^
        File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/ssl.py", line 1372, in do_handshake
          self._sslobj.do_handshake()
          ~~~~~~~~~~~~~~~~~~~~~~~~~^^
      ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1020)

      During handling of the above exception, another exception occurred:

      Traceback (most recent call last):
        File "/private/var/folders/r6/16l72gg51gqcwbgpk9gtv0mc0000gn/T/pip-install-6wyoc98d/skia-pathops_5f83e4b9619b43e8bcee47eff8e71cf9/src/cpp/skia-builder/build_skia.py", line 205, in <module>
          env = make_virtualenv(venv_dir)
        File "/private/var/folders/r6/16l72gg51gqcwbgpk9gtv0mc0000gn/T/pip-install-6wyoc98d/skia-pathops_5f83e4b9619b43e8bcee47eff8e71cf9/src/cpp/skia-builder/build_skia.py", line 78, in make_virtualenv
          with closing(urlopen(GET_VIRTUALENV_URL)) as response:
                       ~~~~~~~^^^^^^^^^^^^^^^^^^^^
        File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/urllib/request.py", line 189, in urlopen
          return opener.open(url, data, timeout)
                 ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^
        File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/urllib/request.py", line 489, in open
          response = self._open(req, data)
        File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/urllib/request.py", line 506, in _open
          result = self._call_chain(self.handle_open, protocol, protocol +
                                    '_open', req)
        File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/urllib/request.py", line 466, in _call_chain
          result = func(*args)
        File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/urllib/request.py", line 1367, in https_open
          return self.do_open(http.client.HTTPSConnection, req,
                 ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                              context=self._context)
                              ^^^^^^^^^^^^^^^^^^^^^^
        File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/urllib/request.py", line 1322, in do_open
          raise URLError(err)
      urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1020)>
      Traceback (most recent call last):
        File "/Users/just/code/git/BlackFoundry/fontra/venv313/lib/python3.13/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
          ~~~~^^
        File "/Users/just/code/git/BlackFoundry/fontra/venv313/lib/python3.13/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
                                   ~~~~^^^^^^^^^^^^^^^^^^^^^^^^
        File "/Users/just/code/git/BlackFoundry/fontra/venv313/lib/python3.13/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 251, in build_wheel
          return _build_backend().build_wheel(wheel_directory, config_settings,
                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                                              metadata_directory)
                                              ^^^^^^^^^^^^^^^^^^^
        File "/private/var/folders/r6/16l72gg51gqcwbgpk9gtv0mc0000gn/T/pip-build-env-gdjy5_7f/overlay/lib/python3.13/site-packages/setuptools/build_meta.py", line 421, in build_wheel
          return self._build_with_temp_dir(
                 ~~~~~~~~~~~~~~~~~~~~~~~~~^
              ['bdist_wheel'],
              ^^^^^^^^^^^^^^^^
          ...<3 lines>...
              self._arbitrary_args(config_settings),
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
          )
          ^
        File "/private/var/folders/r6/16l72gg51gqcwbgpk9gtv0mc0000gn/T/pip-build-env-gdjy5_7f/overlay/lib/python3.13/site-packages/setuptools/build_meta.py", line 403, in _build_with_temp_dir
          self.run_setup()
          ~~~~~~~~~~~~~~^^
        File "/private/var/folders/r6/16l72gg51gqcwbgpk9gtv0mc0000gn/T/pip-build-env-gdjy5_7f/overlay/lib/python3.13/site-packages/setuptools/build_meta.py", line 503, in run_setup
          super().run_setup(setup_script=setup_script)
          ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/private/var/folders/r6/16l72gg51gqcwbgpk9gtv0mc0000gn/T/pip-build-env-gdjy5_7f/overlay/lib/python3.13/site-packages/setuptools/build_meta.py", line 318, in run_setup
          exec(code, locals())
          ~~~~^^^^^^^^^^^^^^^^
        File "<string>", line 410, in <module>
        File "/private/var/folders/r6/16l72gg51gqcwbgpk9gtv0mc0000gn/T/pip-build-env-gdjy5_7f/overlay/lib/python3.13/site-packages/setuptools/__init__.py", line 117, in setup
          return distutils.core.setup(**attrs)
                 ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
        File "/private/var/folders/r6/16l72gg51gqcwbgpk9gtv0mc0000gn/T/pip-build-env-gdjy5_7f/overlay/lib/python3.13/site-packages/setuptools/_distutils/core.py", line 183, in setup
          return run_commands(dist)
        File "/private/var/folders/r6/16l72gg51gqcwbgpk9gtv0mc0000gn/T/pip-build-env-gdjy5_7f/overlay/lib/python3.13/site-packages/setuptools/_distutils/core.py", line 199, in run_commands
          dist.run_commands()
          ~~~~~~~~~~~~~~~~~^^
        File "/private/var/folders/r6/16l72gg51gqcwbgpk9gtv0mc0000gn/T/pip-build-env-gdjy5_7f/overlay/lib/python3.13/site-packages/setuptools/_distutils/dist.py", line 954, in run_commands
          self.run_command(cmd)
          ~~~~~~~~~~~~~~~~^^^^^
        File "/private/var/folders/r6/16l72gg51gqcwbgpk9gtv0mc0000gn/T/pip-build-env-gdjy5_7f/overlay/lib/python3.13/site-packages/setuptools/dist.py", line 950, in run_command
          super().run_command(command)
          ~~~~~~~~~~~~~~~~~~~^^^^^^^^^
        File "/private/var/folders/r6/16l72gg51gqcwbgpk9gtv0mc0000gn/T/pip-build-env-gdjy5_7f/overlay/lib/python3.13/site-packages/setuptools/_distutils/dist.py", line 973, in run_command
          cmd_obj.run()
          ~~~~~~~~~~~^^
        File "/private/var/folders/r6/16l72gg51gqcwbgpk9gtv0mc0000gn/T/pip-build-env-gdjy5_7f/overlay/lib/python3.13/site-packages/setuptools/command/bdist_wheel.py", line 398, in run
          self.run_command("build")
          ~~~~~~~~~~~~~~~~^^^^^^^^^
        File "/private/var/folders/r6/16l72gg51gqcwbgpk9gtv0mc0000gn/T/pip-build-env-gdjy5_7f/overlay/lib/python3.13/site-packages/setuptools/_distutils/cmd.py", line 316, in run_command
          self.distribution.run_command(command)
          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
        File "/private/var/folders/r6/16l72gg51gqcwbgpk9gtv0mc0000gn/T/pip-build-env-gdjy5_7f/overlay/lib/python3.13/site-packages/setuptools/dist.py", line 950, in run_command
          super().run_command(command)
          ~~~~~~~~~~~~~~~~~~~^^^^^^^^^
        File "/private/var/folders/r6/16l72gg51gqcwbgpk9gtv0mc0000gn/T/pip-build-env-gdjy5_7f/overlay/lib/python3.13/site-packages/setuptools/_distutils/dist.py", line 973, in run_command
          cmd_obj.run()
          ~~~~~~~~~~~^^
        File "/private/var/folders/r6/16l72gg51gqcwbgpk9gtv0mc0000gn/T/pip-build-env-gdjy5_7f/overlay/lib/python3.13/site-packages/setuptools/_distutils/command/build.py", line 135, in run
          self.run_command(cmd_name)
          ~~~~~~~~~~~~~~~~^^^^^^^^^^
        File "/private/var/folders/r6/16l72gg51gqcwbgpk9gtv0mc0000gn/T/pip-build-env-gdjy5_7f/overlay/lib/python3.13/site-packages/setuptools/_distutils/cmd.py", line 316, in run_command
          self.distribution.run_command(command)
          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
        File "/private/var/folders/r6/16l72gg51gqcwbgpk9gtv0mc0000gn/T/pip-build-env-gdjy5_7f/overlay/lib/python3.13/site-packages/setuptools/dist.py", line 950, in run_command
          super().run_command(command)
          ~~~~~~~~~~~~~~~~~~~^^^^^^^^^
        File "/private/var/folders/r6/16l72gg51gqcwbgpk9gtv0mc0000gn/T/pip-build-env-gdjy5_7f/overlay/lib/python3.13/site-packages/setuptools/_distutils/dist.py", line 973, in run_command
          cmd_obj.run()
          ~~~~~~~~~~~^^
        File "<string>", line 216, in run
        File "/private/var/folders/r6/16l72gg51gqcwbgpk9gtv0mc0000gn/T/pip-build-env-gdjy5_7f/overlay/lib/python3.13/site-packages/setuptools/command/build_ext.py", line 98, in run
          _build_ext.run(self)
          ~~~~~~~~~~~~~~^^^^^^
        File "/private/var/folders/r6/16l72gg51gqcwbgpk9gtv0mc0000gn/T/pip-build-env-gdjy5_7f/overlay/lib/python3.13/site-packages/setuptools/_distutils/command/build_ext.py", line 359, in run
          self.build_extensions()
          ~~~~~~~~~~~~~~~~~~~~~^^
        File "/private/var/folders/r6/16l72gg51gqcwbgpk9gtv0mc0000gn/T/pip-build-env-gdjy5_7f/overlay/lib/python3.13/site-packages/setuptools/_distutils/command/build_ext.py", line 476, in build_extensions
          self._build_extensions_serial()
          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
        File "/private/var/folders/r6/16l72gg51gqcwbgpk9gtv0mc0000gn/T/pip-build-env-gdjy5_7f/overlay/lib/python3.13/site-packages/setuptools/_distutils/command/build_ext.py", line 502, in _build_extensions_serial
          self.build_extension(ext)
          ~~~~~~~~~~~~~~~~~~~~^^^^^
        File "<string>", line 193, in build_extension
        File "<string>", line 210, in get_libraries
        File "<string>", line 279, in build_skia
        File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/subprocess.py", line 577, in run
          raise CalledProcessError(retcode, process.args,
                                   output=stdout, stderr=stderr)
      subprocess.CalledProcessError: Command '['/Users/just/code/git/BlackFoundry/fontra/venv313/bin/python3.13', 'src/cpp/skia-builder/build_skia.py', 'build/temp.macosx-10.13-universal2-cpython-313/src/cpp/skia-builder/skia', '--no-sync-deps', '--target-cpu', 'universal2']' returned non-zero exit status 1.
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for skia-pathops
Failed to build skia-pathops
ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (skia-pathops)
anthrotype commented 20 hours ago
urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1020)>

is this from Python.org? did you run the post-install script that installs the ssl certificate (certifi module)?

anthrotype commented 20 hours ago

when building skia-pathops from source, normally it attempts to download a pre-compiled skia (built from https://github.com/fonttools/skia-builder, hosted in GH releases), unless you tell it to build from source with BUILD_SKIA_FROM_SOURCE=1 (which takes long and prone to build errors unless the environment is set up correctly)

anthrotype commented 20 hours ago

(yes, we need to build and publish wheels for 3.13)

justvanrossum commented 20 hours ago

did you run the post-install script that installs the ssl certificate (certifi module)?

I thought I did, but let me try again.

justvanrossum commented 20 hours ago

did you run the post-install script that installs the ssl certificate (certifi module)?

I'm 100% sure that I did, but now that I did it again, the error is gone, so, hmmmm.

Sorry for the noise.

anthrotype commented 20 hours ago

I'll keep this open until we add support for precompiled 3.13 wheels, thanks for the reminder.