From 54d3ebadec747ac61c1046eb8d8312c9987f0ec1 Mon Sep 17 00:00:00 2001 From: Rosie Wood Date: Wed, 30 Oct 2024 08:54:30 +0000 Subject: [PATCH 1/8] set up separate text-requirements.txt --- setup.py | 6 ------ text_requirements.txt | 4 ++++ 2 files changed, 4 insertions(+), 6 deletions(-) create mode 100644 text_requirements.txt diff --git a/setup.py b/setup.py index 2314c1b2..2f6fadd6 100644 --- a/setup.py +++ b/setup.py @@ -70,12 +70,6 @@ "black>=23.7.0,<25.0.0", "flake8>=6.0.0,<8.0.0", ], - "text": [ - "detectron2 @ git+https://github.com/facebookresearch/detectron2.git", - "DPText-DETR @ git+https://github.com/maps-as-data/DPText-DETR.git", - "DeepSolo @ git+https://github.com/maps-as-data/DeepSolo.git", - "MapTextPipeline @ git+https://github.com/maps-as-data/MapTextPipeline.git", - ], }, classifiers=[ "Development Status :: 3 - Alpha", diff --git a/text_requirements.txt b/text_requirements.txt new file mode 100644 index 00000000..e54d2047 --- /dev/null +++ b/text_requirements.txt @@ -0,0 +1,4 @@ +DeepSolo @ git+https://github.com/maps-as-data/DeepSolo.git +detectron2 @ git+https://github.com/facebookresearch/detectron2.git +DPText-DETR @ git+https://github.com/maps-as-data/DPText-DETR.git +MapTextPipeline @ git+https://github.com/maps-as-data/MapTextPipeline.git From e016efe4dc2a6110a823b22da153b2adc4f18b03 Mon Sep 17 00:00:00 2001 From: Rosie Wood Date: Wed, 30 Oct 2024 08:54:54 +0000 Subject: [PATCH 2/8] update workflows --- .github/workflows/mr_ci.yml | 2 +- .github/workflows/mr_ci_text_spotting.yml | 11 ++++------- .github/workflows/mr_pip_ci.yml | 4 ++-- .github/workflows/publish-to-pypi.yml | 4 ++-- .github/workflows/publish-to-test-pypi.yml | 6 +++--- 5 files changed, 12 insertions(+), 15 deletions(-) diff --git a/.github/workflows/mr_ci.yml b/.github/workflows/mr_ci.yml index a82bedce..fef6e30b 100644 --- a/.github/workflows/mr_ci.yml +++ b/.github/workflows/mr_ci.yml @@ -19,7 +19,7 @@ jobs: fetch-depth: 2 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v1 + uses: actions/setup-python@v2 with: python-version: ${{ matrix.python-version }} diff --git a/.github/workflows/mr_ci_text_spotting.yml b/.github/workflows/mr_ci_text_spotting.yml index c7ec1cfe..6e6394c5 100644 --- a/.github/workflows/mr_ci_text_spotting.yml +++ b/.github/workflows/mr_ci_text_spotting.yml @@ -41,22 +41,19 @@ jobs: python -m pip install numpy==1.26.4 torch==2.2.2 torchvision==0.17.2 -f https://download.pytorch.org/whl/torch_stable.html python -m pip install ".[dev]" # not text ones as windows install fails python -m pip install pytest-cov - python -m pip install 'git+https://github.com/facebookresearch/detectron2.git' + python -m pip install -r text-requirements.txt - - name: Clone + install DPText-DETR + - name: Clone DPText-DETR run: | git clone https://github.com/maps-as-data/DPText-DETR.git - python -m pip install ./DPText-DETR - - name: Clone + install DeepSolo + - name: Clone DeepSolo run: | git clone https://github.com/maps-as-data/DeepSolo.git - python -m pip install ./DeepSolo - - name: Clone + install MapTextPipeline + - name: Clone MapTextPipeline run: | git clone https://github.com/maps-as-data/MapTextPipeline.git - python -m pip install ./MapTextPipeline - name: Hugging Face CLI run: | diff --git a/.github/workflows/mr_pip_ci.yml b/.github/workflows/mr_pip_ci.yml index 299c7677..0d613eb2 100644 --- a/.github/workflows/mr_pip_ci.yml +++ b/.github/workflows/mr_pip_ci.yml @@ -22,7 +22,7 @@ jobs: fetch-depth: 2 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v1 + uses: actions/setup-python@v2 with: python-version: ${{ matrix.python-version }} @@ -44,4 +44,4 @@ jobs: - name: Test with pytest run: | - python -m pytest ./tests + python -m pytest ./tests --ignore=tests/test_text_spotting/ diff --git a/.github/workflows/publish-to-pypi.yml b/.github/workflows/publish-to-pypi.yml index 93c8ff9b..502489b9 100644 --- a/.github/workflows/publish-to-pypi.yml +++ b/.github/workflows/publish-to-pypi.yml @@ -16,10 +16,10 @@ jobs: - uses: actions/checkout@v3 with: fetch-depth: 0 - - name: Set up Python 3.9 + - name: Set up Python 3.11 uses: actions/setup-python@v2 with: - python-version: '3.9' + python-version: '3.11' - name: Install dependencies run: | python -m pip install --upgrade pip diff --git a/.github/workflows/publish-to-test-pypi.yml b/.github/workflows/publish-to-test-pypi.yml index 9362e62f..98a5d813 100644 --- a/.github/workflows/publish-to-test-pypi.yml +++ b/.github/workflows/publish-to-test-pypi.yml @@ -16,10 +16,10 @@ jobs: - uses: actions/checkout@v3 with: fetch-depth: 0 - - name: Set up Python 3.9 + - name: Set up Python 3.11 uses: actions/setup-python@v4 with: - python-version: '3.9' + python-version: '3.11' - name: Install dependencies run: | python3 -m pip install --upgrade pip @@ -32,5 +32,5 @@ jobs: with: user: __token__ password: ${{ secrets.TEST_PYPI_API_TOKEN }} - repository_url: https://test.pypi.org/legacy/ + repository-url: https://test.pypi.org/legacy/ verbose: true From d193dbdaf4fa79c2c44d1d386d100baf246c76d1 Mon Sep 17 00:00:00 2001 From: Rosie Wood Date: Wed, 30 Oct 2024 09:33:39 +0000 Subject: [PATCH 3/8] update install docs --- .../2-install-mapreader.rst | 37 +++++++++++-------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/docs/source/getting-started/installation-instructions/2-install-mapreader.rst b/docs/source/getting-started/installation-instructions/2-install-mapreader.rst index 86b04715..a84c10d1 100644 --- a/docs/source/getting-started/installation-instructions/2-install-mapreader.rst +++ b/docs/source/getting-started/installation-instructions/2-install-mapreader.rst @@ -4,8 +4,13 @@ Step 2: Install MapReader Method 1: Install from `PyPI `_ -------------------------------------------------------------------- -If you want to use the latest stable release of MapReader and do not want/need access to the worked examples or MapReader code, we recommend installing from PyPI. -This is probably the easiest way to install MapReader. +Installing MapReader from PyPI is probably the easiest way to install MapReader. + +We recommend using this method if: + +- You want to use the latest stable release of MapReader. +- You **only want to use MapReader's classification pipeline** (i.e. you do not need the text spotting functionality). +- You do not need access to the worked examples or MapReader code. To install ``mapreader`` without the text spotting dependencies (i.e. just the classification pipeline): @@ -13,19 +18,21 @@ To install ``mapreader`` without the text spotting dependencies (i.e. just the c pip install mapreader -Or, to install ``mapreader`` with the text spotting dependencies: +.. note:: To install the dev dependencies too, use ``pip install "mapreader[dev]"``. -.. code-block:: bash +Method 2: Install from source +----------------------------- - pip install "mapreader[text]" +Installing from source is the best way to install MapReader if you want to use the text spotting functionality or access the worked examples. -.. note:: To install the dev dependencies too use ``pip install "mapreader[dev]"`` or ``pip install "mapreader[text, dev]"``. +We recommend using this method if: -Method 2: Install from source ------------------------------ +- You want to keep up with the latest changes to MapReader. +- You **want to use the text spotting functionality** in addition to the classification pipeline. +- You want access to the worked examples. +- You want access to the MapReader code (e.g. for development purposes). -If you want to keep up with the latest changes to MapReader, or want/need easy access to the worked examples or MapReader code, we recommend installing from source. -This method will create a ``MapReader`` directory on your machine which will contain all the MapReader code, docs and worked examples. +This method will clone the ``MapReader`` repository onto your machine. This folder will contain all the MapReader code, docs and worked examples. .. note:: You will need to have `git `__ installed to use this method. If you are using conda, this can be done by running ``conda install git``. Otherwise, you should install git by following the instructions on `their website `__. @@ -40,16 +47,16 @@ Then, to install ``mapreader`` without the text spotting dependencies: .. code-block:: bash cd MapReader - pip install -v -e . + pip install . -Or, to install ``mapreader`` with the text spotting dependencies: +.. note:: To install the dev dependencies too, use ``pip install ".[dev]"``. + +Finally, to install the text spotting dependencies, you should run: .. code-block:: bash cd MapReader - pip install -v -e ".[text]" - -.. note:: To install the dev dependencies too use ``pip install -v -e ".[dev]"`` or ``pip install -v -e ".[text, dev]"``. + pip install -r text-requirements.txt .. Method 3: Install via conda (**EXPERIMENTAL**) From 89845efe78c1d404a245167575a788b4f1d39a04 Mon Sep 17 00:00:00 2001 From: Rosie Wood Date: Wed, 30 Oct 2024 09:43:12 +0000 Subject: [PATCH 4/8] rename _ to - in --- text_requirements.txt => text-requirements.txt | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename text_requirements.txt => text-requirements.txt (100%) diff --git a/text_requirements.txt b/text-requirements.txt similarity index 100% rename from text_requirements.txt rename to text-requirements.txt From 5cf14a4494350059784c719dc216a28737908e9e Mon Sep 17 00:00:00 2001 From: Rosie Wood Date: Wed, 30 Oct 2024 09:50:26 +0000 Subject: [PATCH 5/8] Update changelog --- CHANGELOG.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 88d07e31..fe34af37 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,20 @@ The following table shows which versions of MapReader are compatible with which _Add new changes here_ +## [v1.5.1](https://github.com/Living-with-machines/MapReader/releases/tag/v1.5.1) (2024-10-30) + +## Added + +- Added `text-requirement.txt` file to install text spotting dependencies. Users can now install text spotting dependencies using `pip install -r text-requirements.txt` ([#515](https://github.com/maps-as-data/MapReader/pull/515)) + +## Removed + +- Removed `text` extras from `setup.py` ([#515](https://github.com/maps-as-data/MapReader/pull/515)) + +## Fixed + +- Fixes upload to PyPI by removing `text` extras ([#515](https://github.com/maps-as-data/MapReader/pull/515)) + ## [v1.5.0](https://github.com/Living-with-machines/MapReader/releases/tag/v1.5.0) (2024-10-29) ### Added From a48ee6b30d8eeb38362c60e3429f23b03abff730 Mon Sep 17 00:00:00 2001 From: Rosie Wood Date: Wed, 30 Oct 2024 13:22:13 +0000 Subject: [PATCH 6/8] reorder text-requirements.txt --- text-requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/text-requirements.txt b/text-requirements.txt index e54d2047..0d7e3dd9 100644 --- a/text-requirements.txt +++ b/text-requirements.txt @@ -1,4 +1,4 @@ -DeepSolo @ git+https://github.com/maps-as-data/DeepSolo.git detectron2 @ git+https://github.com/facebookresearch/detectron2.git +DeepSolo @ git+https://github.com/maps-as-data/DeepSolo.git DPText-DETR @ git+https://github.com/maps-as-data/DPText-DETR.git MapTextPipeline @ git+https://github.com/maps-as-data/MapTextPipeline.git From 5ee711dd94975bf1b069e8ed148727ebad91e91b Mon Sep 17 00:00:00 2001 From: Rosie Wood Date: Wed, 30 Oct 2024 13:44:41 +0000 Subject: [PATCH 7/8] install one by one --- .github/workflows/mr_ci_text_spotting.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/mr_ci_text_spotting.yml b/.github/workflows/mr_ci_text_spotting.yml index 6e6394c5..648cae95 100644 --- a/.github/workflows/mr_ci_text_spotting.yml +++ b/.github/workflows/mr_ci_text_spotting.yml @@ -39,9 +39,13 @@ jobs: run: | python -m pip install wheel python -m pip install numpy==1.26.4 torch==2.2.2 torchvision==0.17.2 -f https://download.pytorch.org/whl/torch_stable.html - python -m pip install ".[dev]" # not text ones as windows install fails + python -m pip install ".[dev]" python -m pip install pytest-cov - python -m pip install -r text-requirements.txt + python -m pip install detectron2 @ git+https://github.com/facebookresearch/detectron2.git + python -m pip install DeepSolo @ git+https://github.com/maps-as-data/DeepSolo.git + python -m pip install DPText-DETR @ git+https://github.com/maps-as-data/DPText-DETR.git + python -m pip install MapTextPipeline @ git+https://github.com/maps-as-data/MapTextPipeline.git + - name: Clone DPText-DETR run: | From c3d9f1fd6ad64eba21410ef0e6b13d7c4d77a1a1 Mon Sep 17 00:00:00 2001 From: Rosie Wood Date: Wed, 30 Oct 2024 14:15:36 +0000 Subject: [PATCH 8/8] fix install --- .github/workflows/mr_ci_text_spotting.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/mr_ci_text_spotting.yml b/.github/workflows/mr_ci_text_spotting.yml index 648cae95..b67a8d2f 100644 --- a/.github/workflows/mr_ci_text_spotting.yml +++ b/.github/workflows/mr_ci_text_spotting.yml @@ -41,10 +41,10 @@ jobs: python -m pip install numpy==1.26.4 torch==2.2.2 torchvision==0.17.2 -f https://download.pytorch.org/whl/torch_stable.html python -m pip install ".[dev]" python -m pip install pytest-cov - python -m pip install detectron2 @ git+https://github.com/facebookresearch/detectron2.git - python -m pip install DeepSolo @ git+https://github.com/maps-as-data/DeepSolo.git - python -m pip install DPText-DETR @ git+https://github.com/maps-as-data/DPText-DETR.git - python -m pip install MapTextPipeline @ git+https://github.com/maps-as-data/MapTextPipeline.git + python -m pip install 'git+https://github.com/facebookresearch/detectron2.git' + python -m pip install 'git+https://github.com/maps-as-data/DeepSolo.git' + python -m pip install 'git+https://github.com/maps-as-data/DPText-DETR.git' + python -m pip install 'git+https://github.com/maps-as-data/MapTextPipeline.git' - name: Clone DPText-DETR