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

build: unpin numpy + use Python 3.9 in CI #8492

Merged
merged 4 commits into from
Oct 28, 2024
Merged

build: unpin numpy + use Python 3.9 in CI #8492

merged 4 commits into from
Oct 28, 2024

Conversation

anakin87
Copy link
Member

@anakin87 anakin87 commented Oct 24, 2024

Related Issues

Proposed Changes:

  • unpin numpy: its usage in Haystack is compatible with both 1.x and 2.x
  • test haystack with numpy>=2 in CI
  • use Python 3.9 in the CI: Python 3.8 already reached End Of Life and we need 3.9 to use numpy>=2

How did you test it?

CI

Core integrations

In general, I think that if some of the core integrations break we will find out because on the nightly tests of core integrations we also test with Haystack main branch. In that case, we can pin numpy specifically where required.

To be on the safe side, I ran the following script locally (with Python 3.10, Ubuntu 22.04) from core integrations root directory and got no failures.

#!/bin/bash

set -e

for dir in ./integrations/*/; do
  if [ -d "$dir" ]; then
    echo "Processing $(basename "$dir")"
    
    cd "$dir" || exit
    
    hatch env prune
    hatch run pip install git+https://github.com/deepset-ai/haystack.git@unpin-numpy
    hatch run cov-retry -m "not integration"
    
    cd - > /dev/null
  fi
done

Checklist

@coveralls
Copy link
Collaborator

coveralls commented Oct 24, 2024

Pull Request Test Coverage Report for Build 11502851488

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 2 unchanged lines in 2 files lost coverage.
  • Overall coverage increased (+0.02%) to 90.548%

Files with Coverage Reduction New Missed Lines %
core/component/component.py 1 97.58%
core/type_utils.py 1 95.12%
Totals Coverage Status
Change from base Build 11501290533: 0.02%
Covered Lines: 7558
Relevant Lines: 8347

💛 - Coveralls

@anakin87 anakin87 changed the title try unpinning numpy build: unpin numpy + use Python 3.9 in CI Oct 24, 2024
Comment on lines +94 to +96
"spacy>=3.8,<3.9",
"spacy-curated-transformers>=0.2,<=0.3",
"en-core-web-trf @ https://github.com/explosion/spacy-models/releases/download/en_core_web_trf-3.7.3/en_core_web_trf-3.7.3-py3-none-any.whl",
"en-core-web-trf @ https://github.com/explosion/spacy-models/releases/download/en_core_web_trf-3.8.0/en_core_web_trf-3.8.0-py3-none-any.whl",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The previous spacy dependencies required numpy<2, while these require numpy>=2

@@ -81,6 +81,8 @@ format-check = "ruff format --check {args}"

[tool.hatch.envs.test]
extra-dependencies = [
"numpy>=2", # Haystack is compatible both with numpy 1.x and 2.x, but we test with 2.x
Copy link
Member Author

@anakin87 anakin87 Oct 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this pin is not strictly required (see the comment on spacy), but I have included it for clarity

@anakin87 anakin87 marked this pull request as ready for review October 24, 2024 15:48
@anakin87 anakin87 requested review from a team as code owners October 24, 2024 15:48
@anakin87 anakin87 requested review from dfokina and silvanocerza and removed request for a team October 24, 2024 15:48
Copy link
Contributor

@silvanocerza silvanocerza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice 👍

@anakin87 anakin87 merged commit c7b8989 into main Oct 28, 2024
33 checks passed
@anakin87 anakin87 deleted the unpin-numpy branch October 28, 2024 11:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

numpy 2 compatible
3 participants