Skip to content

Commit ee9da8b

Browse files
committed
Shapely install
1 parent ee8fff2 commit ee9da8b

File tree

7 files changed

+20
-13
lines changed

7 files changed

+20
-13
lines changed

.readthedocs.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,5 @@ formats:
2121
python:
2222
version: 3.7
2323
install:
24-
- requirements: requirements.txt
24+
- requirements: requirements.txt
25+
- requirements: requirements_extra_linux.txt

MANIFEST.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
include README.md
22
include requirements.txt
3+
include requirements_extra_linux.txt
34
include LICENSE

docs/source/tutorial.sdk.rst

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,14 @@ SDK is available on PyPI:
2020
The package officially supports Python 3.6+ and was tested under Linux and
2121
Windows (`Anaconda <https://www.anaconda.com/products/individual#windows>`_) platforms.
2222

23-
For Windows based Anaconda distribution
24-
you might also need to install beforehand :py:obj:`shapely` package:
23+
For Windows and Mac OS based installations to use :py:obj:`benchmark` and :py:obj:`consensus`
24+
functions you might also need to install beforehand :py:obj:`shapely` package,
25+
which we found to work properly only under Anaconda distribution, with:
2526

2627
.. code-block:: bash
2728
2829
conda install shapely
2930
30-
and `C++ build tools from Microsoft
31-
<https://go.microsoft.com/fwlink/?LinkId=691126>`_.
3231
3332
----------
3433

install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ rm -rf venv_sa_conv
1111
python${PYTHON_VER} -m venv venv_sa_conv
1212
source venv_sa_conv/bin/activate
1313

14-
pip install shapely
14+
# pip install shapely
1515
pip install -e .
1616
# pip install --pre superannotate
1717
# pip install superannotate

requirements_extra_linux.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Shapely>=1.7.1

setup.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
1+
import sys
2+
13
from setuptools import find_packages, setup
24

35
with open('requirements.txt') as f:
46
requirements = f.read()
5-
67
requirements = requirements.splitlines()
78

9+
if sys.platform == 'linux':
10+
with open('requirements_extra_linux.txt') as f:
11+
requirements_extra_linux = f.read()
12+
13+
requirements_extra_linux = requirements_extra_linux.splitlines()
14+
requirements += requirements_extra_linux
15+
816
with open('README.md') as f:
917
readme = f.read()
1018
readme = "\n".join(readme.split('\n')[2:])

superannotate/__init__.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,13 @@
2222
from .consensus_benchmark.benchmark import benchmark
2323
from .consensus_benchmark.consensus import consensus
2424
except:
25+
_WARNING_SHAPELY = "To use superannotate.benchmark or superannotate.consensus functions please install shapely package in Anaconda enviornment with # conda install shapely"
2526

2627
def benchmark(*args, **kwargs):
27-
raise RuntimeError(
28-
"To use superannotate.benchmark or superannotate.consensus functions please install shapely package with # conda install shapely or # pip install shapely"
29-
)
28+
raise RuntimeError(_WARNING_SHAPELY)
3029

3130
def consensus(*args, **kwargs):
32-
raise RuntimeError(
33-
"To use superannotate.benchmark or superannotate.consensus functions please install shapely package with # conda install shapely or # pip install shapely"
34-
)
31+
raise RuntimeError(_WARNING_SHAPELY)
3532

3633

3734
from .dataframe_filtering import (

0 commit comments

Comments
 (0)