Skip to content

Conversation

@tomaarsen
Copy link
Member

Hello!

Pull Request overview

  • Fix bug for dev install that causes older versions of datasets, sentence-transformers and evaluate to be installed.

Bug details

In the setup.py, the following line creates a list of requirements for the compatibility CI tester, i.e. a tester that runs on the lowest working versions of datasets, sentence-transformers and evaluate.

COMPAT_TESTS_REQUIRE = [requirement.replace(">=", "==") for requirement in REQUIRED_PKGS] + TESTS_REQUIRE

It is not meant to be used by anyone in practice. It is added to this dictionary for easier installing on the CI runner's side:

setfit/setup.py

Lines 26 to 33 in 0cb8ffd

EXTRAS_REQUIRE = {
"optuna": INTEGRATIONS_REQUIRE,
"quality": QUALITY_REQUIRE,
"tests": TESTS_REQUIRE,
"onnx": ONNX_REQUIRE,
"openvino": ONNX_REQUIRE + OPENVINO_REQUIRE,
"compat_tests": COMPAT_TESTS_REQUIRE,
}

But, afterwards, the dev install is set, which includes all requirements from EXTRAS_REQUIRE, including the compatibility requirements:

EXTRAS_REQUIRE["dev"] = combine_requirements([k for k in EXTRAS_REQUIRE])

Before this PR

This bug causes the following dev requirements:

>>> EXTRAS_REQUIRE["dev"]
['evaluate==0.3.0', 'flake8', 'black', 'hummingbird-ml', 'pytest-cov', 'pytest', 'openvino>=2022.3', 'optuna', 'onnxruntime', 'skl2onnx', 'sentence-transformers==2.2.1', 'datasets==2.3.0', 'isort', 'onnx', 'tabulate']

As you'll note, this includes 'evaluate==0.3.0', 'sentence-transformers==2.2.1' and 'datasets==2.3.0'.

The fix

I've simply moved the compatibility test requirements down to below where the dev requirements are specified. I also reformatted the file slightly.

After this PR

>>> EXTRAS_REQUIRE["dev"]
['onnx', 'flake8', 'pytest', 'hummingbird-ml', 'onnxruntime', 'skl2onnx', 'black', 'tabulate', 'isort', 'pytest-cov', 'openvino>=2022.3', 'optuna']

As you can see, the compatibility test versions have been removed.

  • Tom Aarsen

@tomaarsen tomaarsen added bug Something isn't working admin Anything that needs the maintainers' eyes installation Issues regarding installing SetFit labels Jan 24, 2023
Copy link
Member

@lewtun lewtun left a comment

Choose a reason for hiding this comment

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

Thanks for the fix! LGTM :)

@lewtun lewtun merged commit 9876a79 into huggingface:main Feb 8, 2023
@tomaarsen tomaarsen deleted the bug/dev_install_versions branch February 8, 2023 13:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

admin Anything that needs the maintainers' eyes bug Something isn't working installation Issues regarding installing SetFit

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants