fix: allow CI to run on 3.14 by migrating from docformatter to ruff · Issue #203 · diffpy/diffpy.stretched-nmf · GitHub
Skip to content

fix: allow CI to run on 3.14 by migrating from docformatter to ruff #203

Description

@john-halloran

Problem

build attempt 1...
    => error
    [INFO] Installing environment for https://github.com/s-weigand/docformatter.
    [INFO] Once installed this environment will be reused.
    [INFO] This may take a few minutes...
    An unexpected error has occurred: CalledProcessError: command: ('/pc/clone/6FQjXq0eQ1WgmhUhQMr2sg/py_env-python3/bin/python', '-mpip', 'install', '.', 'tomli')
    return code: 1
    stdout:
        Processing /pc/clone/6FQjXq0eQ1WgmhUhQMr2sg
          Installing build dependencies: started
          Installing build dependencies: finished with status 'done'
          Getting requirements to build wheel: started
          Getting requirements to build wheel: finished with status 'done'
          Preparing metadata (pyproject.toml): started
          Preparing metadata (pyproject.toml): finished with status 'done'
        Collecting tomli
          Downloading tomli-2.4.1-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.metadata (10 kB)
        Collecting charset_normalizer<4.0.0,>=3.0.0 (from docformatter==1.7.5)
          Downloading charset_normalizer-3.4.7-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.metadata (40 kB)
        Collecting untokenize<0.2.0,>=0.1.1 (from docformatter==1.7.5)
          Downloading untokenize-0.1.1.tar.gz (3.1 kB)
          Installing build dependencies: started
          Installing build dependencies: finished with status 'done'
          Getting requirements to build wheel: started
          Getting requirements to build wheel: finished with status 'error'
    stderr:
          error: subprocess-exited-with-error
      
          × Getting requirements to build wheel did not run successfully.
          │ exit code: 1
          ╰─> [24 lines of output]
              Traceback (most recent call last):
                File "/pc/clone/6FQjXq0eQ1WgmhUhQMr2sg/py_env-python3/lib/python3.14/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 389, in <module>
                  main()
                  ~~~~^^
                File "/pc/clone/6FQjXq0eQ1WgmhUhQMr2sg/py_env-python3/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 "/pc/clone/6FQjXq0eQ1WgmhUhQMr2sg/py_env-python3/lib/python3.14/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 143, in get_requires_for_build_wheel
                  return hook(config_settings)
                File "/tmp/pip-build-env-9mlg1xli/overlay/lib/python3.14/site-packages/setuptools/build_meta.py", line 333, in get_requires_for_build_wheel
                  return self._get_build_requires(config_settings, requirements=[])
                         ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                File "/tmp/pip-build-env-9mlg1xli/overlay/lib/python3.14/site-packages/setuptools/build_meta.py", line 301, in _get_build_requires
                  self.run_setup()
                  ~~~~~~~~~~~~~~^^
                File "/tmp/pip-build-env-9mlg1xli/overlay/lib/python3.14/site-packages/setuptools/build_meta.py", line 520, in run_setup
                  super().run_setup(setup_script=setup_script)
                  ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^
                File "/tmp/pip-build-env-9mlg1xli/overlay/lib/python3.14/site-packages/setuptools/build_meta.py", line 317, in run_setup
                  exec(code, locals())
                  ~~~~^^^^^^^^^^^^^^^^
                File "<string>", line 19, in <module>
                File "<string>", line 14, in version
              AttributeError: 'Constant' object has no attribute 's'
              [end of output]
      
          note: This error originates from a subprocess, and is likely not a problem with pip.
        ERROR: Failed to build 'untokenize' when getting requirements to build wheel
    Check the log at /pc/pre-commit.log
build attempt 2...
    => error
    [INFO] Installing environment for https://github.com/s-weigand/docformatter.
    [INFO] Once installed this environment will be reused.
    [INFO] This may take a few minutes...
    An unexpected error has occurred: CalledProcessError: command: ('/pc/clone/6FQjXq0eQ1WgmhUhQMr2sg/py_env-python3/bin/python', '-mpip', 'install', '.', 'tomli')
    return code: 1
    stdout:
        Processing /pc/clone/6FQjXq0eQ1WgmhUhQMr2sg
          Installing build dependencies: started
          Installing build dependencies: finished with status 'done'
          Getting requirements to build wheel: started
          Getting requirements to build wheel: finished with status 'done'
          Preparing metadata (pyproject.toml): started
          Preparing metadata (pyproject.toml): finished with status 'done'
        Collecting tomli
          Downloading tomli-2.4.1-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.metadata (10 kB)
        Collecting charset_normalizer<4.0.0,>=3.0.0 (from docformatter==1.7.5)
          Downloading charset_normalizer-3.4.7-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.metadata (40 kB)
        Collecting untokenize<0.2.0,>=0.1.1 (from docformatter==1.7.5)
          Downloading untokenize-0.1.1.tar.gz (3.1 kB)
          Installing build dependencies: started
          Installing build dependencies: finished with status 'done'
          Getting requirements to build wheel: started
          Getting requirements to build wheel: finished with status 'error'
    stderr:
          error: subprocess-exited-with-error
      
          × Getting requirements to build wheel did not run successfully.
          │ exit code: 1
          ╰─> [24 lines of output]
              Traceback (most recent call last):
                File "/pc/clone/6FQjXq0eQ1WgmhUhQMr2sg/py_env-python3/lib/python3.14/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 389, in <module>
                  main()
                  ~~~~^^
                File "/pc/clone/6FQjXq0eQ1WgmhUhQMr2sg/py_env-python3/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 "/pc/clone/6FQjXq0eQ1WgmhUhQMr2sg/py_env-python3/lib/python3.14/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 143, in get_requires_for_build_wheel
                  return hook(config_settings)
                File "/tmp/pip-build-env-ueambjdl/overlay/lib/python3.14/site-packages/setuptools/build_meta.py", line 333, in get_requires_for_build_wheel
                  return self._get_build_requires(config_settings, requirements=[])
                         ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                File "/tmp/pip-build-env-ueambjdl/overlay/lib/python3.14/site-packages/setuptools/build_meta.py", line 301, in _get_build_requires
                  self.run_setup()
                  ~~~~~~~~~~~~~~^^
                File "/tmp/pip-build-env-ueambjdl/overlay/lib/python3.14/site-packages/setuptools/build_meta.py", line 520, in run_setup
                  super().run_setup(setup_script=setup_script)
                  ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^
                File "/tmp/pip-build-env-ueambjdl/overlay/lib/python3.14/site-packages/setuptools/build_meta.py", line 317, in run_setup
                  exec(code, locals())
                  ~~~~^^^^^^^^^^^^^^^^
                File "<string>", line 19, in <module>
                File "<string>", line 14, in version
              AttributeError: 'Constant' object has no attribute 's'
              [end of output]
      
          note: This error originates from a subprocess, and is likely not a problem with pip.
        ERROR: Failed to build 'untokenize' when getting requirements to build wheel
    Check the log at /pc/pre-commit.log

Proposed solution

The short term solution will be to have pre-commit only fall back to python version 3.13, as proposed in #201. That will allow CI to complete, but this issue will remain open. The proper fix will be to change from docformatter to ruff, referencing scikit-package as needed. Once the .pre-commit-config.yaml and pyproject.toml files have been updated, pre-commit should work with 3.14.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions