GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — BUG: upper cap < 3.12 · Issue #17957 · scipy/scipy

BUG: upper cap < 3.12 #17957

New issue
Copy link
New issue
Copy link
Closed as not planned
Closed as not planned
BUG: upper cap < 3.12#17957
Copy link
Labels
Official binariesItems related to the official SciPy binaries, including wheels and vendored libsdefectA clear bug or issue that prevents SciPy from being installed or used as expected

Description

@anna-charlotte
anna-charlotte
opened on Feb 10, 2023
Issue body actions

Describe your issue.

We use poetry for dependency management and encounter the following problem when trying to add scipy:
Due to the upper cap on python 3.12 we can not add scipy via poetry, since we do no have such an upper cap.

Would it be possible to remove this upper cap or change it to 3.13?

Reproducing Code Example

-

Error message

(venv_new) >>>>charlotte@MacBook ~/Desktop/project % poetry add scipy     

Using version ^1.10.0 for scipy

Updating dependencies
Resolving dependencies... (0.2s)

The current project's Python requirement (>=3.8) is not compatible with some of the required packages Python requirement:
  - scipy requires Python <3.12,>=3.8, so it will not be satisfied for Python >=3.12

SciPy/NumPy/Python version information

1.10.0

Activity

  1. anna-charlotte
    added
    defectA clear bug or issue that prevents SciPy from being installed or used as expected
    on Feb 10, 2023
  2. tupui commented on Feb 10, 2023

    @tupui
    tupui
    on Feb 10, 2023
    Member
    More actions

    Hi @anna-charlotte, thank you for reporting.

    This is intentional as said in our release notes: SciPy 1.10 does not support Python 3.12.

    We are very careful about our pins and since we have a complex build toolchain, new versions of Python usually mean something will break (don't want to say 100%, but...). And Python 3.12 is still in alpha.

    We only start to support new Python versions when they enter the RC phase because during the beta phase we have time to fix things.

  3. tupui
    closed this as not plannedon Feb 10, 2023
  4. tupui
    added
    Official binariesItems related to the official SciPy binaries, including wheels and vendored libs
    on Feb 10, 2023
  5. tupui commented on Feb 10, 2023

    @tupui
    tupui
    on Feb 10, 2023
    Member
    More actions

    Just to backup a bit my claim, I am adding a 3.12 job to our CI and NumPy is failing to build https://github.com/scipy/scipy/actions/runs/4144130190/jobs/7166811829
    i.e. things are not ready.

  6. sisp commented on Jul 18, 2023

    @sisp
    sisp
    on Jul 18, 2023
    More actions

    I think capping the Python version is really a bad idea and considered bad practice:

    • fix: Remove '<4' from python_requires in packaging guide pypa/packaging.python.org#850
    • https://iscinumpy.dev/post/bound-version-constraints/#pinning-the-python-version-is-special
    • https://discuss.python.org/t/requires-python-upper-limits/12663
    Reacted by espdev and Hannes Krumbiegel
  7. tupui commented on Jul 18, 2023

    @tupui
    tupui
    on Jul 18, 2023
    Member
    More actions

    Hi @sisp, we are aware of these links and have been participation in such discussions.

    Pinning is a bad practice if done arbitrarily. There is no discussion here and we almost all agree on that.

    In our case, it's a very sensible decision. New versions of Python always break SciPy in one way or another. We do not want to start saying that "some" things might work and some not. Remember that we have arguably one of the largest public API and with a very complicated infrastructure (Python, Cython, Pythran, C, C++, Fortran and our deps, all of that has to work together...) The same goes with pinning versions of NumPy. We have maintainers of NumPy in our team and we know for a fact which version of NumPy is going to break which version of SciPy. And over the years, we did not make that many mistakes 😉

    Support for 3.12 will be there once we have a CI working on 3.12. Right now, SciPy does not work on 3.12, we cannot even install. So yes the pin is pretty correct here. Still, we already planned to make a release as soon as Python 3.12 is released and we know SciPy does work.

  8. sisp commented on Jul 20, 2023

    @sisp
    sisp
    on Jul 20, 2023
    More actions

    I'm not convinced by these arguments, @tupui.

    The same goes with pinning versions of NumPy. We have maintainers of NumPy in our team and we know for a fact which version of NumPy is going to break which version of SciPy. And over the years, we did not make that many mistakes wink

    A change in NumPy may break SciPy, but likely not all of it but only a small fraction of the API. To restore functionality, SciPy would need a patch release. But many downstream projects that use SciPy would likely be unaffected anyway because they might not use the problematic SciPy API. By capping the NumPy version, you prevent a downstream project from using a more recent version of NumPy which may break the downstream project when it is affected by an unfixed bug in NumPy. Using an uncapped version of NumPy may break a downstream project that uses SciPy, but it can be fixed downstream, whereas a capped version of NumPy in SciPy that breaks a downstream project cannot be fixed downstream. See https://iscinumpy.dev/post/bound-version-constraints/#version-limits-break-code-too for a more comprehensive discussion of this problem.

    New versions of Python always break SciPy in one way or another. We do not want to start saying that "some" things might work and some not. Remember that we have arguably one of the largest public API and with a very complicated infrastructure (Python, Cython, Pythran, C, C++, Fortran and our deps, all of that has to work together...)

    Although I appreciate SciPy's complexity and API surface, I still think the above arguments also apply to the Python version constraint. In addition, when a downstream project uses, e.g., Poetry for dependency management, the (really strict) Python version capping gets propagated, i.e. any Poetry-managed downstream project that uses SciPy must cap the Python version as well.

    $ poetry init --python='>=3.9' --dependency='scipy>=1.11.1'
    $ poetry install
    Creating virtualenv poetry-scipy in /tmp/poetry-scipy/.venv
    Updating dependencies
    Resolving dependencies... (0.2s)
    
    The current project's Python requirement (>=3.9) is not compatible with some of the required packages Python requirement:
      - scipy requires Python <3.13,>=3.9, so it will not be satisfied for Python >=3.13
    
    Because no versions of scipy match >1.11.1
     and scipy (1.11.1) requires Python <3.13,>=3.9, scipy is forbidden.
    So, because poetry-scipy depends on scipy (>=1.11.1), version solving failed.
    
      • Check your dependencies Python requirement: The Python requirement can be specified via the `python` or `markers` properties
        
        For scipy, a possible solution would be to set the `python` property to ">=3.9,<3.13"
    
        https://python-poetry.org/docs/dependency-specification/#python-restricted-dependencies,
        https://python-poetry.org/docs/dependency-specification/#using-environment-markers

    Support for 3.12 will be there once we have a CI working on 3.12. Right now, SciPy does not work on 3.12, we cannot even install. So yes the pin is pretty correct here. Still, we already planned to make a release as soon as Python 3.12 is released and we know SciPy does work.

    It looks like SciPy v1.11.1 caps the Python version to <3.13 (i.e. Python 3.12 is included), but wheel files are only available for Python <3.12 and I can't find CI checks for Python 3.12. 🤔

  9. ilayn commented on Jul 20, 2023

    @ilayn
    ilayn
    on Jul 20, 2023
    Member
    More actions

    If you want to go down the rabbit hole where we discussed this many many times already, and we know what you mean. Here is the canonical place that includes many SciPy maintainers discussing this with Python core members.

    https://discuss.python.org/t/requires-python-upper-limits/12663

    What is typically missed out in these discussions is that we have a multiple version span of NumPy and Python versions (and many other details like compiler/dependence problems Cython/pybind11 etc).

    Upper capping is done for planned obsolescence and expectation management instead of letting the code fail in numerous cryptic ways.

    People tend to downplay the breakage happening between different Python versions probably they are used to work with Python only packages but we have exceeding amount of ABI issues and that forces us to be strict. Hence you might not be convinced but read through all the discussions and linked issues and it will give you at least the reasoning we have. You can disagree but we are doing it this way to save a ton of maintainer work and we are not given any other solution so far.

    Reacted by Sigurd Spieckermann
  10. tupui commented on Jul 20, 2023

    @tupui
    tupui
    on Jul 20, 2023
    Member
    More actions

    It looks like SciPy v1.11.1 caps the Python version to <3.13 (i.e. Python 3.12 is included), but wheel files are only available for Python <3.12 and I can't find CI checks for Python 3.12. 🤔

    Yes, as I said above the current versions of SciPy don't install on Python 3.12, hence no wheel. The cap on <3.13 is because we will make a patch release as soon as 3.12 is out.

    We are confident we will have this figured out by then. We have an opened PR to test on 3.12 and someone is looking at fixing the issues we have here. See #18689

    In any case, we won't release a wheel until Python 3.12 is officially released.

    Poetry for dependency management, the (really strict) Python version capping gets propagated

    Yes, this is an issue with how Poetry think Python should deal with dependencies, not taking into account the fact that sometimes maintainers do know what they are doing 😉

    A change in NumPy may break SciPy, but likely not all of it but only a small fraction of the API.

    We are very strict here. SciPy is only released if the test suite is passing. We literally have millions of users and you would be surprised to see how SciPy is used. People rely on this stability and we are not going to change our position here.

    Some projects are using our nightlies to test their library. SciPy is breaking things like scikit-image, scikit-learn and networkX all the time. And it's not always a very used function which breaks.

    To restore functionality, SciPy would need a patch release.

    Making a patch release is not trivial at all. To the end user, they just see a wheel, but getting there requires many manual steps on our side. Due to the complexity of the project and the time needed to make a release, we only do patch releases in between major versions. Meaning as soon as 1.12 would be out, we would stop making patch releases for 1.11.

  11. andyfaff commented on Jul 21, 2023

    @andyfaff
    andyfaff
    on Jul 21, 2023
    Contributor
    More actions

    I can't find CI checks for Python 3.12

    That's now being done.

  12. andyfaff commented on Jul 22, 2023

    @andyfaff
    andyfaff
    on Jul 22, 2023
    Contributor
    More actions

    Nightly wheels for cp312 are now available. Please see https://pypi.anaconda.org/scientific-python-nightly-wheels/simple/scipy. An official wheel won't be released until after Python 3.12 has an official release.

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

    Official binariesItems related to the official SciPy binaries, including wheels and vendored libsdefectA clear bug or issue that prevents SciPy from being installed or used as expected

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402792 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.