Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test on Python 3.11 #77

Closed
mikegerber opened this issue Sep 15, 2022 · 5 comments · Fixed by #78
Closed

Test on Python 3.11 #77

mikegerber opened this issue Sep 15, 2022 · 5 comments · Fixed by #78

Comments

@mikegerber
Copy link
Collaborator

Python 3.11 is scheduled to be released in 2022-10, and Fedora Linux 37 is going to be released with it. So we should test on it.

@mikegerber mikegerber self-assigned this Sep 15, 2022
mikegerber added a commit to mikegerber/ocrd_calamari that referenced this issue Sep 15, 2022
mikegerber added a commit to mikegerber/ocrd_calamari that referenced this issue Sep 15, 2022
See also OCR-D#77. This is not 3.11 yet, but 3.11-rc!
@mikegerber
Copy link
Collaborator Author

mikegerber commented Sep 15, 2022

Blocked by

  • Python 3.11 release (→ Official release of 3.11 tag on Docker Hub)
  • TF PyPI release for 3.11

@mikegerber
Copy link
Collaborator Author

mikegerber commented Mar 13, 2023

Apparently there is still no (non-pre-)release of TF 2 for Python 3.11...

@mikegerber
Copy link
Collaborator Author

manual installation using pip install tensorflow works, going to put this into the CircleCI config.yml for now.

@mikegerber
Copy link
Collaborator Author

There's also:

  • a problem with protobuf (Downgrading helps)
  • another problem with re:
  File "/home/b-mg106/.pyenv/versions/3.11.2/envs/ocrd_calamari-py311/lib/python3.11/site-packages/ocrd_calamari/recognize.py", line 121, in process                                                            for line, line_coords, raw_results in zip(textlines, line_coordss, raw_results_all):                File "/home/b-mg106/.pyenv/versions/3.11.2/envs/ocrd_calamari-py311/lib/python3.11/site-packages/calamari_ocr/ocr/predictor.py", line 250, in predict_raw
    for result in zip(*prediction):                                                                     File "/home/b-mg106/.pyenv/versions/3.11.2/envs/ocrd_calamari-py311/lib/python3.11/site-packages/calamari_ocr/ocr/predictor.py", line 167, in predict_raw
    yield PredictionResult(p.decoded, codec=self.codec, text_postproc=self.text_postproc,
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/b-mg106/.pyenv/versions/3.11.2/envs/ocrd_calamari-py311/lib/python3.11/site-packages/calamari_ocr/ocr/predictor.py", line 37, in __init__                                                         self.sentence = self.text_postproc.apply("".join(self.chars))
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/b-mg106/.pyenv/versions/3.11.2/envs/ocrd_calamari-py311/lib/python3.11/site-packages/calamari_ocr/ocr/text_processing/text_processor.py", line 12, in apply
    return self._apply_single(txts)                                                                              ^^^^^^^^^^^^^^^^^^^^^^^^                                                                     File "/home/b-mg106/.pyenv/versions/3.11.2/envs/ocrd_calamari-py311/lib/python3.11/site-packages/calamari_ocr/ocr/text_processing/text_processor.py", line 44, in _apply_single                               txt = proc._apply_single(txt)
          ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/b-mg106/.pyenv/versions/3.11.2/envs/ocrd_calamari-py311/lib/python3.11/site-packages/calamari_ocr/ocr/text_processing/text_regularizer.py", line 173, in _apply_single                            txt = re.sub(replacement.old, replacement.new, txt)                                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                                                 File "/home/b-mg106/.pyenv/versions/3.11.2/lib/python3.11/re/__init__.py", line 185, in sub             return _compile(pattern, flags).sub(repl, string, count)                                                     ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/b-mg106/.pyenv/versions/3.11.2/lib/python3.11/re/__init__.py", line 294, in _compile        p = _compiler.compile(pattern, flags)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                                                               File "/home/b-mg106/.pyenv/versions/3.11.2/lib/python3.11/re/_compiler.py", line 743, in compile        p = _parser.parse(p, flags)
        ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/b-mg106/.pyenv/versions/3.11.2/lib/python3.11/re/_parser.py", line 980, in parse            p = _parse_sub(source, state, flags & SRE_FLAG_VERBOSE, 0)                                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                                          File "/home/b-mg106/.pyenv/versions/3.11.2/lib/python3.11/re/_parser.py", line 455, in _parse_sub       itemsappend(_parse(source, state, verbose, nested + 1,                                                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/b-mg106/.pyenv/versions/3.11.2/lib/python3.11/re/_parser.py", line 841, in _parse
    raise source.error('global flags not at the start '
re.error: global flags not at the start of the expression at position 3

Superficially, I'd say this needs to be fixes in Calamari and so we wait with Python 3.11 until we can update to Calamari 2.

@mikegerber
Copy link
Collaborator Author

Fixed for the current master (Calamari 1,x), needs revisit for Calamari 2.

@mikegerber mikegerber reopened this Apr 5, 2023
mikegerber added a commit to mikegerber/ocrd_calamari that referenced this issue Oct 16, 2023
mikegerber added a commit to mikegerber/ocrd_calamari that referenced this issue Oct 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant