-
Notifications
You must be signed in to change notification settings - Fork 49
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
Vendor the antlr4 runtime library #487
base: main
Are you sure you want to change the base?
Conversation
@@ -3,9 +3,6 @@ | |||
# This file is part of cf-units and is released under the BSD license. | |||
# See LICENSE in the root of the repository for full licensing details. | |||
# ruff: noqa: E402 | |||
import pytest | |||
|
|||
antlr4 = pytest.importorskip("antlr4") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If that was on the table I would not do #423. This is better. Thanks!
Sadly, the simplest vendoring approach of using absolute import names fails...
Looks like I will have to do a bit more work to do relative imports. |
c1d360b
to
350bca5
Compare
The codacy test is failing. I don't know how to configure the tool, and can't run it locally. I don't see any docs on this topic other than https://docs.codacy.com/repositories-configure/codacy-configuration-file/. I also don't have an option to configure the project in the codacy website (screenshot: Would you have any suggestions on how best to proceed @trexfeathers? |
95de3af
to
b0b38bc
Compare
In short: no. I'm afraid I don't know anything about Codacy, other than the fact that it occasionally produces confusing objections. I hope I'm not picking names out of a hat: @bjlittle / @lbdreyer can either of you speak to why cf-units uses Codacy where most of our other repos use Codecov? |
We dabbled with Codacy adoption, but for me it's out of favour now. Personally, I think we should drop it's usage as codecov and ruff easily replace it along with repo-review 👍 |
I'm afraid I don't know. I remember briefly talking about codacy a couple of years ago. We thought it may be nice as it had some extra functionality over other coding standards/coverage/checking tools. I believe I gave it access to the SciTools org, but I don't remember enabling it for cf-units. Perhaps that was someone else? |
OK sounds good. @pp-mo as of Monday you are the 'developer in charge' here; are you happy with us switching to Codecov? I'm fairly confident I can see how to make it happen. |
|
|
b0b38bc
to
f1de9d2
Compare
Also: big thanks for updating/removing the codacy configuration - it was a bit uncomfortable that I had no idea what was going on, how to configure it, nor how to run it locally. Much appreciated that it got straightened out! 👍 |
I don't think I'm qualified to review this, but I think it would be good to update the README so future devs know how to look after this. In particular, the section I added last year about updating antlr would no longer be correct I think. |
…ular dependencies
2148654
to
0a0fc02
Compare
Thanks for pointing it out. I've rebased and added the comment to the README. |
Despite the apparent silence, I'm keen to include this in a v3.3 release. We now think will be within 1-2 weeks to provide full working with numpy2 for Iris 3.11 I did have some suggested addition to the readme, but otherwise about ready to merge this. I'm assuming that the work in https://github.com/pelson/pyudunits2/ has not affected your enthusiasm for this approach @pelson ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm assuming that the work in https://github.com/pelson/pyudunits2/ has not affected your enthusiasm for this approach @pelson ?
No, I still think this is the right thing to do here (I lifted it verbatim in pyudunits2
).
I wrote a few comments for which I forgot to hit "submit review", so include them when commenting now (they may or may not be useful...)
@@ -14,10 +14,13 @@ | |||
You're welcome ;). | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes in this file are relevant to the review (pointing this out because the diff is large due to the changes to generated files).
|
||
# Straighten out some wonky imports. | ||
if antlr_file_path.name == "XPathLexer.py": | ||
contents = contents.replace( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm working on upstreaming these, but think they are fine here for now given we have no need to update the antlr version any time soon (antlr/antlr4#4705 etc.)
antlr4-python3-runtime
)latex
extra - it is no longer necessary/used to have the antlr4 runtime library installed (since we vendored it)