Skip to content

Commit

Permalink
Force an error on "sklearn" installation attempts
Browse files Browse the repository at this point in the history
According to "sklearn"'s [description][0], installing the package
doesn't always raise an error, but only according to a specific
schedule. Obviously this doesn't work for tests. Fortunately setting the
`SKLEARN_ALLOW_DEPRECATED_SKLEARN_PACKAGE_INSTALL` environment variable
to `False` always forces the error.

[0]: https://pypi.org/project/sklearn/#description
  • Loading branch information
gnn committed Feb 3, 2023
1 parent eadbc96 commit dc8a7ed
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +65,6 @@ def build(session):
def install(session):
"""Install the package."""
setdefaults(session)
session.env["SKLEARN_ALLOW_DEPRECATED_SKLEARN_PACKAGE_INSTALL"] = "False"
session.run("python", "-mpip", "install", "--upgrade", "pip")
session.run("python", "-mpip", "install", *Path("dist").glob("*.whl"))

0 comments on commit dc8a7ed

Please sign in to comment.