From d48ce0930dbfcec1470f984df23f1bec1d42bfab Mon Sep 17 00:00:00 2001 From: Roman Donchenko Date: Tue, 7 Sep 2021 18:12:07 +0300 Subject: [PATCH] Remove most hacks that were added to work around issues in pycocotools pycocotools 2.0.4 includes changes to the build system that make it possible to downgrade NumPy after installing pycocotools, and therefore: * --no-binary=pycocotools is no longer necessary; * TensorFlow can be installed in the same `pip` invocation as Datumaro. The only hack that remains (that I know of) is the usage of `pycocotools-windows` on Windows, since the `pycocotools` PyPI project still doesn't provide Windows wheels (or any other wheels). --- .github/workflows/health_check.yml | 3 +-- .github/workflows/pr_checks.yml | 3 +-- CHANGELOG.md | 2 ++ requirements-core.txt | 2 +- requirements.txt | 2 +- site/content/en/docs/user-manual/installation.md | 14 -------------- 6 files changed, 6 insertions(+), 20 deletions(-) diff --git a/.github/workflows/health_check.yml b/.github/workflows/health_check.yml index dcc172b114..d40a6138d5 100644 --- a/.github/workflows/health_check.yml +++ b/.github/workflows/health_check.yml @@ -18,8 +18,7 @@ jobs: python-version: ${{ matrix.python-version }} - name: Installing dependencies run: | - pip install tensorflow pytest pytest-cov - pip install -e .[default,tfds] + pip install -e '.[default,tf,tfds]' pytest pytest-cov - name: Code instrumentation run: | pytest -v --cov --cov-report xml:coverage.xml diff --git a/.github/workflows/pr_checks.yml b/.github/workflows/pr_checks.yml index 98645c7085..affa016a39 100644 --- a/.github/workflows/pr_checks.yml +++ b/.github/workflows/pr_checks.yml @@ -29,8 +29,7 @@ jobs: python-version: ${{ matrix.python-version }} - name: Installing dependencies run: | - pip install tensorflow pytest - pip install -e .[default,tfds] + pip install -e '.[default,tf,tfds]' pytest - name: Unit testing run: | pytest -v diff --git a/CHANGELOG.md b/CHANGELOG.md index 67bfad3aac..ee5672477d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - `smooth_line` from `datumaro.util.annotation_util` - the function is renamed to `approximate_line` and has updated interface () +- The `pycocotools` dependency lower bound is raised to `2.0.4`. + () ### Deprecated - TBD diff --git a/requirements-core.txt b/requirements-core.txt index 6ebd01ee79..937c88db25 100644 --- a/requirements-core.txt +++ b/requirements-core.txt @@ -8,7 +8,7 @@ Pillow>=6.1.0 ruamel.yaml>=0.17.0 typing_extensions>=3.7.4.3 -pycocotools>=2.0.2; platform_system != "Windows" or python_version >= '3.9' +pycocotools>=2.0.4; platform_system != "Windows" or python_version >= '3.9' pycocotools-windows; platform_system == "Windows" and python_version < '3.9' PyYAML>=5.3.1 diff --git a/requirements.txt b/requirements.txt index 399f71d534..a128a65db0 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ --r requirements-core.txt --no-binary=pycocotools # https://github.com/openvinotoolkit/datumaro/issues/253 +-r requirements-core.txt -r requirements-default.txt opencv-python-headless>=4.1.0.25 diff --git a/site/content/en/docs/user-manual/installation.md b/site/content/en/docs/user-manual/installation.md index 707adac15c..644bb228fc 100644 --- a/site/content/en/docs/user-manual/installation.md +++ b/site/content/en/docs/user-manual/installation.md @@ -61,20 +61,6 @@ plugin dependencies in the [plugins](/docs/user-manual/extending) section. This option can't be covered by extras due to Python packaging system limitations. -- Although Datumaro excludes `pycocotools` of version 2.0.2 in - requirements, it works with this version perfectly fine. The - reason for such requirement is binary incompatibility of the `numpy` - dependency in the `TensorFlow` and `pycocotools` binary packages, - and the current workaround forces this package to be build from sources - on most platforms - (see [#253](https://github.com/openvinotoolkit/datumaro/issues/253)). - If you need to use 2.0.2, make sure it is linked with the same version - of `numpy` as `TensorFlow` by reinstalling the package: - ``` bash - pip uninstall pycocotools - pip install pycocotools --no-binary=pycocotools - ``` - - When installing directly from the repository, you can change the installation branch with `...@`. Also use `--force-reinstall` parameter in this case. It can be useful for testing of unreleased