-
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
Make antlr optional #423
Make antlr optional #423
Conversation
I wanted to add a test without I can attest that this works. All the functionalities but latex parsing are available and the import error is informative enough, if/when someone tries to use latex. |
Status update 2024/9/13 : |
That would help a lot while we wait for something better.
I confess that the CI setup here grow both in complexity and size that makes me not want to mess with them. Even more so in a case for an optional dependency, which can increase the number of files here. Is that something that is on your radar or as you expecting me, as the PR author, to do it? If the latter, I'd love some guidance before I tackle this. |
Hi @ocefpaf, we definitely agree that things have become complex! Your PR does not need to do anything with lock files
Complexity for developersThe intention is that the complexity is handled by the We adopted Tox specifically thinking of developers like you, who we don't talk to every day - we want to use familiar tools so we don't need to explain our repo structure to collaborators. What do you think we could we do to make things clearer? |
Yes, we have (I think) no experience in structuring tests to confirm correct handling of optional dependencies. For instance I can't find any test coverage for this line in Iris. It doesn't look like PyTest has any built-in conveniences for 'hiding' a dependency for the duration of test(s), but it might be possible using mocking? We're certainly not interested in creating more lock files than we have already. Would love to know your thoughts. |
I will do my best to get this over the line either way, even if that means raising an issue to add tests in future. |
|
The follow-on test infrastructure has quite a cost, when compared to my proposal in #313 (comment):
The code is BSD and is pure Python, but it appears to not use relative imports (making it a bit harder to vendor as you have to do a search and replace). The outcome would be no dependency at all, and the tests would validate that the behaviour is as expected. |
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.
OK I think this is good to merge as-is.
Since we are still installing antlr + running tests, we know this does not break status quo. That's good enough for a start IMHO.
The follow-on #485 is a nice-to have, but not an essential prerequisite.
For sanity we can do a one-off test to check that, right now, cf_units does function without antlr.
Since Iris does not currently use the cf_units "tex" function, there should be no need to include this in the Iris dependencies either for testing or runtime (i.e. in the recipe on the iris conda-forge feedstock). |
* main: [DOCS] Update docstring for date2num (module function) (SciTools#483) Modernise setup scripts (SciTools#484) Make antlr optional (SciTools#423) Ruff: smaller steps (SciTools#364) Updated docstring for num2date. (SciTools#467) updated conda lock files (SciTools#479) Revert to 00:03 Mondays for lockfile updates. (SciTools#480) New trigger time for GMT. (SciTools#478) Check lockfile updates @ 3pm daily (temporary for testing). (SciTools#477) Fixlocks (SciTools#470) # Conflicts: # pyproject.toml # requirements/cf-units.yml # requirements/locks/py310-lock-linux-64.txt # requirements/locks/py310-lock-osx-64.txt # requirements/locks/py310-lock-win-64.txt # requirements/locks/py311-lock-linux-64.txt # requirements/locks/py311-lock-osx-64.txt # requirements/locks/py311-lock-win-64.txt # requirements/locks/py312-lock-linux-64.txt # requirements/locks/py312-lock-osx-64.txt # requirements/locks/py312-lock-win-64.txt
Can we hope a new release with antlr optional soon on pypi ? |
I think we're now leaning towards #487 instead. But anyway a release before long, though we're not committing to a date yet. |
Yes, it would suit me, as long as there is no longer a dependency on such an old release (4.7.2) of |
Closes #313