Skip to content

Commit

Permalink
Reduce duplication of dependency information (cvat-ai#308)
Browse files Browse the repository at this point in the history
* Move requirements from setup.py to requirements-base.txt
  • Loading branch information
Roman Donchenko authored Jun 24, 2021
1 parent 7e35c81 commit f53d423
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 33 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed
- Tensorflow AVX check is made optional in API and is disabled by default (<https://github.com/openvinotoolkit/datumaro/pull/305>)
- Extensions for images in ImageNet_txt are now mandatory (<https://github.com/openvinotoolkit/datumaro/pull/302>)
- Several dependencies now have lower bounds (<https://github.com/openvinotoolkit/datumaro/pull/308>)

### Deprecated
-
Expand Down
21 changes: 21 additions & 0 deletions requirements-core.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
attrs>=19.3.0
defusedxml>=0.6.0
GitPython>=3.0.8
lxml>=4.4.1
matplotlib>=3.3.1
numpy>=1.17.3
Pillow>=6.1.0

# Avoid 2.0.2 Linux binary distribution because of
# a conflict in numpy versions with TensorFlow:
# - TF is compiled with numpy 1.19 ABI
# - pycocotools is compiled with numpy 1.20 ABI
# Using a previous version allows to force package rebuilding.
#
# https://github.com/openvinotoolkit/datumaro/issues/253
pycocotools>=2.0.0,!=2.0.2; platform_system != "Windows"

pycocotools-windows; platform_system == "Windows"
PyYAML>=5.3.1
scikit-image>=0.15.0
tensorboardX>=1.8
11 changes: 1 addition & 10 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
attrs>=19.3.0
Cython>=0.27.3 # include before pycocotools
defusedxml>=0.6.0
GitPython>=3.0.8
lxml>=4.4.1
matplotlib>=3.3.1
-r requirements-core.txt --no-binary=pycocotools # https://github.com/openvinotoolkit/datumaro/issues/253
opencv-python-headless>=4.1.0.25
Pillow>=6.1.0
pycocotools>=2.0.0 --no-binary=pycocotools # https://github.com/openvinotoolkit/datumaro/issues/253
PyYAML>=5.3.1
scikit-image>=0.15.0
tensorboardX>=1.8
pandas>=1.1.5
pytest>=5.3.5
26 changes: 3 additions & 23 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

# Copyright (C) 2019-2020 Intel Corporation
# Copyright (C) 2019-2021 Intel Corporation
#
# SPDX-License-Identifier: MIT

Expand Down Expand Up @@ -34,29 +34,9 @@ def find_version(project_dir=None):
return version

def get_requirements():
requirements = [
'attrs>=19.3.0',
'defusedxml',
'GitPython',
'lxml',
'matplotlib',
'numpy>=1.17.3',
'Pillow',
with open('requirements-core.txt') as fh:
requirements = [fh.read()]

# Avoid 2.0.2 Linux binary distribution because of
# a conflict in numpy versions with TensorFlow:
# - TF is compiled with numpy 1.19 ABI
# - pycocotools is compiled with numpy 1.20 ABI
# Using a previous version allows to force package rebuilding.
#
# https://github.com/openvinotoolkit/datumaro/issues/253
'pycocotools!=2.0.2; platform_system != "Windows"',
'pycocotools-windows; platform_system == "Windows"',

'PyYAML',
'scikit-image',
'tensorboardX',
]
if strtobool(os.getenv('DATUMARO_HEADLESS', '0').lower()):
requirements.append('opencv-python-headless')
else:
Expand Down

0 comments on commit f53d423

Please sign in to comment.