Code Monkey home page Code Monkey logo

Comments (8)

crater2150 avatar crater2150 commented on June 29, 2024 2

I had set Pycharm to check for 3.6 compatibility, but it didn't mark annotations as incompatible. I changed it to a string like @bertsky recommended (release ocr4all-pylib==0.2.5).

As the Pycharm inspection doesn't seem reliable, and I haven't started using python before 3.7 was released, I'll check the rest of the code for compatibility. But as far as I can tell from a quick glance, dataclasses should be the only other 3.7 feature used, and they are handled as a package dependency for 3.6, and the tests for ocr4all-pylib run with python3.6

from ocrd-pixelclassifier-segmentation.

bertsky avatar bertsky commented on June 29, 2024

Or better yet, and since OCR-D requires supportin 3.6 as well, rewrite ocrd4all.colors to not rely on type annotations. You can easily do that by replacing -> ColorMap with -> 'ColorMap' (and removing the future import).

from ocrd-pixelclassifier-segmentation.

kba avatar kba commented on June 29, 2024

Or better yet, and since OCR-D requires supportin 3.6 as well, rewrite ocrd4all.colors to not rely on type annotations. You can easily do that by replacing -> ColorMap with -> 'ColorMap' (and removing the future import).

I second that, I understand that type annotations are a desirable feature but we will have to support Python 3.6 for a while longer.

from ocrd-pixelclassifier-segmentation.

bertsky avatar bertsky commented on June 29, 2024

@crater2150 Many thanks for this quick fix!

It does work for me if I upgrade ocr4all-pylib to 0.2.6 manually. But if I just install ocrd_pc_segmentation, I get 0.2.3.

Digging into it, I found that make deps actually uses a dynamically created requirements.txt (which was still old in my case). Do you think you can change the makefile to force updating that file?

from ocrd-pixelclassifier-segmentation.

crater2150 avatar crater2150 commented on June 29, 2024

@bertsky For me, make deps always regenerates requirements.txt, as the target already has a dependency on the .PHONY target pip-tools, but I added an additional .PHONY for requirements.txt, so make should always start a build.
I suspect the actual problem was pip-compile's own cache, I added a flag to its call that should disable it. Can you try if this causes the dependency to update (if you have the old requirements file still around)?

from ocrd-pixelclassifier-segmentation.

bertsky avatar bertsky commented on June 29, 2024

@crater2150 thanks! I did not have an old requirements.txt around, but I faked one (with ocr4all-pylib==0.2.3 and an old date stamp). Unfortunately, after pulling 3556480 it still did not update my requirements.txt automatically (I would have to remove it to get ocr4all-pylib==0.2.6).

See log attached.
make-deps.zip

from ocrd-pixelclassifier-segmentation.

crater2150 avatar crater2150 commented on June 29, 2024

It seems that the help output of pip-compile is a bit misleading, I assumed "Clear any caches upfront, rebuild from scratch" would mean, that a preexisting requirements.txt wouldn't have impact on the result. The flag actually needed is --upgrade, which I now added to the Makefile and tested it with a faked requirements.txt like yours. make deps now seems to correctly upgrade to the latest compatible version.

from ocrd-pixelclassifier-segmentation.

bertsky avatar bertsky commented on June 29, 2024

That did the trick – thanks a lot, @crater2150 !

from ocrd-pixelclassifier-segmentation.

Related Issues (12)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.