Skip to content

Commit

Permalink
Revert "fix: rescue docarray in setup" (#4219)
Browse files Browse the repository at this point in the history
This reverts commit 20d28a8.
  • Loading branch information
jacobowitz committed Jan 25, 2022
1 parent 3cf7017 commit 5cef964
Showing 1 changed file with 0 additions and 22 deletions.
22 changes: 0 additions & 22 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,32 +74,11 @@ def add_ac(k, v):
pass


def rescue_docarray():
"""Upgrading from 2.x to 3.x is broken (https://github.com/jina-ai/jina/issues/4194)
This function checks if docarray is broken and if so attempts to rescue it
"""
try:
import docarray as docarray

__docarray_version__ = docarray.__version__

except AttributeError:
# Being here means docarray is not installed correctly, attempt to reinstall it
# as recommended by pip https://pip.pypa.io/en/latest/user_guide/#using-pip-from-your-program
import subprocess

subprocess.check_call(
[sys.executable, '-m', 'pip', 'uninstall', '--yes', 'docarray']
)
subprocess.check_call([sys.executable, '-m', 'pip', 'install', 'docarray'])


class PostDevelopCommand(develop):
"""Post-installation for development mode."""

def run(self):
develop.run(self)
rescue_docarray()
register_ac()


Expand All @@ -108,7 +87,6 @@ class PostInstallCommand(install):

def run(self):
install.run(self)
rescue_docarray()
register_ac()


Expand Down

0 comments on commit 5cef964

Please sign in to comment.