Skip to content

Commit

Permalink
Merge pull request #515 from maps-as-data/fix_text_install
Browse files Browse the repository at this point in the history
Fix text install
  • Loading branch information
rwood-97 authored Oct 30, 2024
2 parents 74bf2f1 + c3d9f1f commit 84e0709
Show file tree
Hide file tree
Showing 9 changed files with 56 additions and 36 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/mr_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}

Expand Down
15 changes: 8 additions & 7 deletions .github/workflows/mr_ci_text_spotting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,24 +39,25 @@ 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 '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 + 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: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/mr_pip_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}

Expand All @@ -44,4 +44,4 @@ jobs:
- name: Test with pytest
run: |
python -m pytest ./tests
python -m pytest ./tests --ignore=tests/test_text_spotting/
4 changes: 2 additions & 2 deletions .github/workflows/publish-to-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/publish-to-test-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,35 @@ Step 2: Install MapReader
Method 1: Install from `PyPI <https://pypi.org/project/mapreader/>`_
--------------------------------------------------------------------

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):

.. code-block:: bash
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 <https://git-scm.com/>`__ 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 <https://git-scm.com/book/en/v2/Getting-Started-Installing-Git>`__.

Expand All @@ -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**)
Expand Down
6 changes: 0 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 4 additions & 0 deletions text-requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
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

0 comments on commit 84e0709

Please sign in to comment.