Stop duplicating requirements (#691)

This commit is contained in:
Quentin Pradet 2024-05-14 15:59:39 +04:00 committed by GitHub
parent 5b728c29c1
commit 116416b3e8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 10 additions and 40 deletions

View File

@ -7,5 +7,5 @@ build:
python:
install:
- requirements: docs/requirements-docs.txt
- path: .
- requirements: docs/requirements-docs.txt

View File

@ -1,13 +1,5 @@
elasticsearch>=7.7
pandas>=1.5
matplotlib>=3.6
matplotlib
nbval
scikit-learn>=0.22.1
xgboost>=1
lightgbm
sphinx==5.3.0
nbsphinx
furo
# traitlets has been having all sorts of release problems lately.
traitlets<5.1

View File

@ -56,7 +56,7 @@ TYPED_FILES = (
)
@nox.session(reuse_venv=True)
@nox.session(reuse_venv=True, python="3.11")
def format(session):
session.install("black", "isort", "flynt")
session.run("python", "utils/license-headers.py", "fix", *SOURCE_FILES)
@ -66,12 +66,12 @@ def format(session):
lint(session)
@nox.session(reuse_venv=True)
@nox.session(reuse_venv=True, python="3.11")
def lint(session):
# Install numpy to use its mypy plugin
# https://numpy.org/devdocs/reference/typing.html#mypy-plugin
session.install("black", "flake8", "mypy", "isort", "numpy")
session.install("--pre", "elasticsearch>=8.3,<9")
session.install(".")
session.run("python", "utils/license-headers.py", "check", *SOURCE_FILES)
session.run("black", "--check", "--target-version=py38", *SOURCE_FILES)
session.run("isort", "--check", "--profile=black", *SOURCE_FILES)
@ -150,8 +150,8 @@ def docs(session):
# Run this so users get an error if they don't have Pandoc installed.
session.run("pandoc", "--version", external=True)
session.install("-r", "docs/requirements-docs.txt")
session.install(".")
session.install("-r", "docs/requirements-docs.txt")
# See if we have an Elasticsearch cluster active
# to rebuild the Jupyter notebooks with.

View File

@ -1,25 +1,8 @@
#
# Basic requirements
# Basic requirements with extras
#
elasticsearch>=8.3,<9
pandas>=1.5,<2
matplotlib>=3.6
numpy>=1.2.0,<2
tqdm<5
.[all]
#
# Extras
#
scikit-learn>=1.3,<1.4
xgboost>=0.90,<2
lightgbm>=2,<4
# Elasticsearch uses PyTorch 2.1.2
# Python 3.12 is not supported by PyTorch 2.1.2
torch==2.1.2; python_version<'3.12'
# Versions known to be compatible with PyTorch 2.1.2
sentence-transformers>=2.1.0,<=2.3.1
transformers[torch]>=4.31.0,<4.36.0
#
# Testing
#

View File

@ -1,7 +0,0 @@
#
# Basic requirements
#
elasticsearch>=8.3,<9
pandas>=1.5,<2
matplotlib>=3.6
numpy>=1.2.0,<2

View File

@ -59,7 +59,9 @@ extras = {
"scikit-learn": ["scikit-learn>=1.3,<1.4"],
"lightgbm": ["lightgbm>=2,<4"],
"pytorch": [
"requests<3",
"torch==2.1.2",
"tqdm",
"sentence-transformers>=2.1.0,<=2.3.1",
"transformers[torch]>=4.31.0,<4.36.0",
],