Skip to content

Commit 0643871

Browse files
committed
Only error for setuptools install command
1 parent 47b52be commit 0643871

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

setup.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
from datetime import datetime, MAXYEAR
33
from dateutil.relativedelta import relativedelta
44
from setuptools import setup
5+
from setuptools.command.install import install
56

67

78
with open("README.md") as f:
@@ -69,19 +70,19 @@ def maybe_raise_error(checked_datetime):
6970
raise SystemExit(error_message)
7071

7172

72-
def main():
73-
now = datetime.now()
74-
now = datetime(2022, 11, 1)
75-
maybe_raise_error(now)
73+
class AbortInstall(install):
74+
def run(self):
75+
now = datetime.now()
76+
now = datetime(2022, 11, 1)
77+
maybe_raise_error(now)
7678

79+
80+
if __name__ == "__main__":
7781
setup(
82+
cmdclass={"install": AbortInstall},
7883
description="deprecated sklearn package, use scikit-learn instead",
7984
long_description=LONG_DESCRIPTION,
8085
long_description_content_type="text/markdown",
8186
name="sklearn",
82-
version="0.1.0a1",
87+
version="0.1.0a2",
8388
)
84-
85-
86-
if __name__ == "__main__":
87-
main()

0 commit comments

Comments
 (0)