Skip to content

Deprecation issues in tests with too-new setuptools versions #24350

Closed

Description

@charris

There are two deprecation issues when running python -mspin test with Python 3.11:

  • sre_constants and sre_parse are deprecated. This breaks test collection but can by fixed
    by using recent setuptools.
  • pkg_resources is deprecated in recent setuptools, this causes numpy/distutils/tests/test_system_info.py
    to fail

Note that we have several other uses of pkg_resources

  • In tools/npy_tempita/__init__.py
  • In numpy/_utils/_pep440.py (copied from SciPy)
  • In versioneer.py (going away)

We should fix the usage in the first file.

The easiest quick solution is to upgrade the setuptools version requirement and ignore the test_system_info error.

Activity

  1. charris commented on Aug 6, 2023

    @charris
    MemberAuthor

    We don't use the troublesome parts of tempita, and in fact they don't run :) The version in Cython is no better in that regard. Maybe be can just get rid of much of it.

    EDIT: The pkg_resources bit can be removed, our version is not distributed as a package. Or we could just hardwire it to '3.5.2'

  2. charris commented on Aug 7, 2023

    @charris
    MemberAuthor

    We should probably just skip testing numpy/distutils since we need to use a recent version of setuptools to avoid other deprecations. We could, I suppose, make the tests version dependent.

  3. rgommers commented on Aug 7, 2023

    @rgommers
    Member

    Skipping the problematic tests in numpy.distutils when the setuptools version is >= 60.0 on Python 3.11 sounds right to me. That's what we already required.

  4. changed the title [-]Deprecation issues with meson builds[/-] [+]Deprecation issues in tests with too-new setuptools versions[/+] on Aug 7, 2023
  5. rgommers commented on Aug 7, 2023

    @rgommers
    Member

    tools/npy_tempita/__init__.py is only used in the numpy.distutils build, so it's going away - no need to worry about that one. I'll open a PR to make the numpy.distutils tests pass.

  6. added a commit that references this issue on Aug 7, 2023
    aca2429
  7. added a commit that references this issue on Aug 7, 2023
    89b62c5
  8. charris commented on Aug 7, 2023

    @charris
    MemberAuthor

    @rgommers

    We have setuptools pinned in various ways in several locations

    • pyproject.toml.setuppy
    • test_requirements.txt
    • environment.yml
    • azure-pipelines.yml
    • benchmarks/asv.conf.json
    • benchmarks/asv_compare.conf.json.tpl
    • tools/travis-test.sh

    I'm wondering if we should change those pins? That essentially locks us into meson builds, but I think that is already the case.

  9. rgommers commented on Aug 7, 2023

    @rgommers
    Member

    I'd much prefer not to touch them right now. Most of that is still needed. We should be able to get rid of all them in a few months.

  10. added a commit that references this issue on Nov 11, 2023
    ce036a9
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