antlr / antlr4-tools

Tools to run antlr4 w/o needing to install java or antlr4!
MIT License
82 stars 21 forks source link

Timeout due to https://search.maven.org/ being unreachable #18

Open Ria700 opened 1 month ago

Ria700 commented 1 month ago

https://github.com/antlr/antlr4-tools/blob/10a090aab6ec70217d1d8aa0c2f16c9f1e425861/antlr4_tool_runner.py#L26-L27

Facing timeout at L26 antlr4_tool_runner.py since https://search.maven.org/ users are now redirected to https://central.sonatype.com/ Reference: https://central.sonatype.org/faq/what-happened-to-search-maven-org/#what-about-the-searchmavenorg-api

The link used in antlr4_tool_runner.py: https://search.maven.org/solrsearch/select?q=a:antlr4-master+g:org.antlr is unreachable.

parrt commented 1 month ago

Thanks. Could you send a pull request?

izhirov commented 1 month ago

@parrt Hello, I did the PR for this issue: https://github.com/antlr/antlr4-tools/pull/19. Can you look at it? Thanks

moogman commented 1 month ago

antlr4 python is unusable again because there's an outage with https://status.maven.org/ (and would still be the case if central.sonatype.com/ went down).

This should be a soft failure with antlr4, warning instead of erroring out. --help and --version should work even if maven is down, and we also should have a --skip-version-check cmdline option.

moogman commented 1 month ago

I started to fix this, then realised TimeoutError is already added and committed[1] but not released. So currently, users via pip will see:

...
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/python@3.12/3.12.5/Frameworks/Python.framework/Versions/3.12/lib/python3.12/ssl.py", line 1104, in read
    return self._sslobj.read(len, buffer)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TimeoutError: The read operation timed out

instead of

Could not get latest version number, attempting to fall back to latest downloaded version...
Found version '4.13.2', this version may be out of date

Could we get an updated release on pip please? This would fix this issue and https://github.com/antlr/antlr4/issues/4703

[1] https://github.com/antlr/antlr4-tools/commit/ee5c134b07c3e9a107131535155b2afedce492e2#diff-21162dbe8ccb0f459c574307a41c0452f7b910d7540de6642549b0c810690989L31