Skip to content

Commit

Permalink
Update transformers pin, fix CI (#420)
Browse files Browse the repository at this point in the history
* Update transformers pin and fix python version range

* Update tests

* Fix numpy build constraint

* Try to fix tests

* Try installing pytorch

* Comment tests
  • Loading branch information
honnibal authored Jan 15, 2025
1 parent 2422eae commit 6286d87
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 28 deletions.
35 changes: 11 additions & 24 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ jobs:
python_version: ["3.12"]
include:
- os: macos-13
python_version: "3.7"
python_version: "3.10"
- os: windows-latest
python_version: "3.8"
python_version: "3.11"
- os: ubuntu-latest
python_version: "3.9"
python_version: "3.12"
- os: macos-13
python_version: "3.10"
python_version: "3.12"
- os: windows-latest
python_version: "3.11"
python_version: "3.12"

runs-on: ${{ matrix.os }}

Expand All @@ -45,21 +45,10 @@ jobs:
with:
python-version: ${{ matrix.python_version }}

- name: Install oldest supported torch for python 3.6
if: matrix.python_version == '3.6'
run: |
python -m pip install "torch==1.8.1+cpu" -f https://download.pytorch.org/whl/torch_stable.html
# Remove when https://github.com/pytorch/pytorch/issues/124897 is fixed.
- name: Install torch 2.2.2
if: matrix.python_version != '3.6' && matrix.os == 'windows-latest'
run: |
python -m pip install "torch==2.2.2+cpu" -f https://download.pytorch.org/whl/torch_stable.html
- name: Install dependencies
run: |
python -m pip install -U build pip setuptools wheel
python -m pip install -r requirements.txt
python -m pip install -r requirements.txt --force-reinstall
- name: Build sdist
run: |
Expand All @@ -82,15 +71,10 @@ jobs:
python -m pip freeze --exclude pywin32 --exclude torch > installed.txt
python -m pip uninstall -y -r installed.txt
- name: Install oldest supported torch for python 3.6
if: matrix.python_version == '3.6'
run: |
python -m pip install "torch==1.8.1+cpu" -f https://download.pytorch.org/whl/torch_stable.html
- name: Install newest torch for python 3.7+
if: matrix.python_version != '3.6'
run: |
python -m pip install torch --index-url https://download.pytorch.org/whl/cpu
python -m pip install torch --index-url https://download.pytorch.org/whl/cpu --force-reinstall
- name: Install from sdist
shell: bash
Expand All @@ -101,7 +85,10 @@ jobs:
- name: Run tests
shell: bash
run: |
python -m pip install -r requirements.txt
python -m pip install -r requirements.txt --force-reinstall
# The version of pytorch being used here requires numpy v2, but because of the way we're doing the
# requirements installation here it's not being resolved that way. So just install numpy 1 here.
python -m pip install "numpy<2"
python -m pytest --pyargs $MODULE_NAME --cov=$MODULE_NAME
- name: Test backwards compatibility for v1.0 models
Expand Down
3 changes: 1 addition & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
requires = [
"setuptools",
"cython>=0.25",
"numpy>=1.15.0; python_version < '3.9'",
"numpy>=1.25.0; python_version >= '3.9'",
"numpy>=2.0.0,<3.0.0"
]
build-backend = "setuptools.build_meta"
4 changes: 2 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ classifiers =
[options]
zip_safe = false
include_package_data = true
python_requires = >=3.7
python_requires = >=3.9,<3.13
install_requires =
spacy>=3.5.0,<4.1.0
numpy>=1.15.0; python_version < "3.9"
numpy>=1.19.0; python_version >= "3.9"
transformers>=3.4.0,<4.42.0
transformers>=3.4.0,<4.50.0
torch>=1.8.0
srsly>=2.4.0,<3.0.0
dataclasses>=0.6,<1.0; python_version < "3.7"
Expand Down

0 comments on commit 6286d87

Please sign in to comment.