Skip to content

Commit

Permalink
Stop duplicating requirements (#691)
Browse files Browse the repository at this point in the history
  • Loading branch information
pquentin authored May 14, 2024
1 parent 5b728c2 commit 116416b
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 40 deletions.
2 changes: 1 addition & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ build:

python:
install:
- requirements: docs/requirements-docs.txt
- path: .
- requirements: docs/requirements-docs.txt
10 changes: 1 addition & 9 deletions docs/requirements-docs.txt
Original file line number Diff line number Diff line change
@@ -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
8 changes: 4 additions & 4 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
)


@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)
Expand All @@ -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)
Expand Down Expand Up @@ -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.
Expand Down
21 changes: 2 additions & 19 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -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
#
Expand Down
7 changes: 0 additions & 7 deletions requirements.txt

This file was deleted.

2 changes: 2 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@
"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",
],
Expand Down

0 comments on commit 116416b

Please sign in to comment.