Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: Python version constraints in releases causes issues for less strict downstream versions #19513

Closed
cpcloud opened this issue Nov 13, 2023 · 7 comments
Labels
defect A clear bug or issue that prevents SciPy from being installed or used as expected
Milestone

Comments

@cpcloud
Copy link
Contributor

cpcloud commented Nov 13, 2023

Describe your issue.

It looks like starting the 1.10.x series, the Python version upper bound is now set (<3.12 in 1.10.x, <3.13 in 1.11.x).

This causes problems when depending (including transitively) on scipy in a Poetry project whose python constraint is less strict.

I understand the desire to do this.

A negative consequence of this choice along with some other transitive dependencies' constraints (statsmodels not allowing scipy 1.9.2) results in poetry choosing scipy 1.6.1 for python >=3.10, and since there are no wheels a full build of scipy is attempted.

I can't install a newer version, because my project's (https://github.com/ibis-project/ibis) version constraints are wider than allowed by scipy.

Reproducing Code Example

Create a minimal poetry project with python = "^3.9" and then run

$ poetry add scipy@1.10

Error message

❯ poetry add scipy@1.10

Updating dependencies
Resolving dependencies... (0.0s)

The current project's Python requirement (>=3.9,<4.0) 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,<4.0

Because ibis-framework depends on scipy (1.10.0) which requires Python <3.12,>=3.8, 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.12"

    https://python-poetry.org/docs/dependency-specification/#python-restricted-dependencies,
    https://python-poetry.org/docs/dependency-specification/#using-environment-markers

SciPy/NumPy/Python version and system information

❯ python -c 'import sys, scipy, numpy; print(scipy.__version__, numpy.__version__, sys.version_info); scipy.show_config()'
1.9.3 1.25.2 sys.version_info(major=3, minor=10, micro=13, releaselevel='final', serial=0)
blas_mkl_info:
  NOT AVAILABLE
blis_info:
  NOT AVAILABLE
openblas_info:
    libraries = ['openblas', 'openblas']
    library_dirs = ['/usr/local/lib']
    language = c
    define_macros = [('HAVE_CBLAS', None)]
    runtime_library_dirs = ['/usr/local/lib']
blas_opt_info:
    libraries = ['openblas', 'openblas']
    library_dirs = ['/usr/local/lib']
    language = c
    define_macros = [('HAVE_CBLAS', None)]
    runtime_library_dirs = ['/usr/local/lib']
lapack_mkl_info:
  NOT AVAILABLE
openblas_lapack_info:
    libraries = ['openblas', 'openblas']
    library_dirs = ['/usr/local/lib']
    language = c
    define_macros = [('HAVE_CBLAS', None)]
    runtime_library_dirs = ['/usr/local/lib']
lapack_opt_info:
    libraries = ['openblas', 'openblas']
    library_dirs = ['/usr/local/lib']
    language = c
    define_macros = [('HAVE_CBLAS', None)]
    runtime_library_dirs = ['/usr/local/lib']
Supported SIMD extensions in this NumPy install:
    baseline = SSE,SSE2,SSE3
    found = SSSE3,SSE41,POPCNT,SSE42,AVX,F16C,FMA3,AVX2
    not found = AVX512F,AVX512CD,AVX512_KNL,AVX512_KNM,AVX512_SKX,AVX512_CLX,AVX512_CNL,AVX512_ICL
@cpcloud cpcloud added the defect A clear bug or issue that prevents SciPy from being installed or used as expected label Nov 13, 2023
@tylerjereddy tylerjereddy modified the milestones: 1.11.4, 1.12.0 Nov 13, 2023
@tylerjereddy
Copy link
Contributor

We had another issue with poetry reported recently as well, though it was a different one: #19437

@cpcloud
Copy link
Contributor Author

cpcloud commented Nov 13, 2023

Yep! I saw that one while hunting to see if anyone reported something similar :)

I think these two issues are not related except for that they are both encountered with Poetry.

@andyfaff
Copy link
Contributor

andyfaff commented Nov 13, 2023

Exhaustively discussed in numpy/numpy#24810 and #17957 (I think)

@andyfaff
Copy link
Contributor

The solution in numpy/numpy#24962 was to remove the upper pin on the release branch.

tylerjereddy added a commit to tylerjereddy/scipy that referenced this issue Nov 13, 2023
* this patch against our latest maintenance branch is
related to scipygh-19513, and NumPy made a similar decision
upstream in numpy/numpy#24962

* the discussions surrounding this are pretty confusing,
but it seems like we may need to do it for resolvers
like those used by `poetry`...

* I suppose this increases the likelihood I have to do
`1.11.4`, but it was looking somewhat likely anyway...

[skip cirrus] [skip circle]
@tylerjereddy
Copy link
Contributor

Alright, I'll probably unpin in 1.11.4 then (cross-listed PR). Not a huge fan of it, but if NumPy is doing it to avoid the complexity of the situation in 1.26.2 I suppose we may as well do that too.

rgommers pushed a commit that referenced this issue Nov 15, 2023
* this patch against our latest maintenance branch is
related to gh-19513, and NumPy made a similar decision
upstream in numpy/numpy#24962

* the discussions surrounding this are pretty confusing,
but it seems like we may need to do it for resolvers
like those used by `poetry`...

* I suppose this increases the likelihood I have to do
`1.11.4`, but it was looking somewhat likely anyway...

[skip cirrus] [skip circle]
@tylerjereddy tylerjereddy modified the milestones: 1.12.0, 1.11.4 Nov 17, 2023
@tylerjereddy
Copy link
Contributor

This should be handled when I get 1.11.4 out, the change is already in the maintenance branch.

@cpcloud
Copy link
Contributor Author

cpcloud commented Nov 17, 2023

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
defect A clear bug or issue that prevents SciPy from being installed or used as expected
Projects
None yet
Development

No branches or pull requests

3 participants