Skip to content

Publish a new release to support building socksio from source on Python 3.14 #65

Description

@SigureMo

Installing the wheel for socksio on Python 3.14 works fine, but installing from source fails due to a bug in flit_core v2. Reproduction steps:

$ python -m venv socksio-env
$ source socksio-env/bin/activate
$ pip install --no-binary socksio socksio
Collecting socksio
  Downloading socksio-1.0.0.tar.gz (19 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... error
  error: subprocess-exited-with-error
  
  × Preparing metadata (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [21 lines of output]
      Traceback (most recent call last):
        File "/Users/nyakku/Projects/yutto/socksio-env/lib/python3.14/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 389, in <module>
          main()
          ~~~~^^
        File "/Users/nyakku/Projects/yutto/socksio-env/lib/python3.14/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 373, in main
          json_out["return_val"] = hook(**hook_input["kwargs"])
                                   ~~~~^^^^^^^^^^^^^^^^^^^^^^^^
        File "/Users/nyakku/Projects/yutto/socksio-env/lib/python3.14/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 175, in prepare_metadata_for_build_wheel
          return hook(metadata_directory, config_settings)
        File "/private/var/folders/6g/d8nyqgsx009gszprx9qf0nl80000gn/T/pip-build-env-mw7dy2oe/overlay/lib/python3.14/site-packages/flit_core/buildapi.py", line 29, in prepare_metadata_for_build_wheel
          metadata = make_metadata(module, ini_info)
        File "/private/var/folders/6g/d8nyqgsx009gszprx9qf0nl80000gn/T/pip-build-env-mw7dy2oe/overlay/lib/python3.14/site-packages/flit_core/common.py", line 368, in make_metadata
          md_dict.update(get_info_from_module(module))
                         ~~~~~~~~~~~~~~~~~~~~^^^^^^^^
        File "/private/var/folders/6g/d8nyqgsx009gszprx9qf0nl80000gn/T/pip-build-env-mw7dy2oe/overlay/lib/python3.14/site-packages/flit_core/common.py", line 178, in get_info_from_module
          docstring, version = get_docstring_and_version_via_ast(target)
                               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^
        File "/private/var/folders/6g/d8nyqgsx009gszprx9qf0nl80000gn/T/pip-build-env-mw7dy2oe/overlay/lib/python3.14/site-packages/flit_core/common.py", line 134, in get_docstring_and_version_via_ast
          isinstance(child.value, ast.Str))
                                  ^^^^^^^
      AttributeError: module 'ast' has no attribute 'Str'
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

This may cause Homebrew formulas that depend on socksio to fail to build/install on Python 3.14, because they build from source.

Because ast.Str has been removed in Python 3.141, and when building socksio==1.0.0 (the latest release on PyPI) from source it depends on flit_core >=2,<3. flit_core v2 has a bug on Python 3.14 that prevents building from source. This issue is fixed in flit_core v3.10.0 (see pypa/flit#684). Therefore, removing the <3 upper bound on flit_core — i.e., requiring flit_core >=3 — will resolve the problem (due to this issue, it is recommended to update the flit_core version requirement to >=3).

I noticed #61 already removed the <3 constraint, so publishing a new release should resolve this issue.

Footnotes

  1. https://docs.python.org/3.14/whatsnew/3.14.html#id9

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions