-
Notifications
You must be signed in to change notification settings - Fork 119
Deprecation Warning: add_source_parser #51
Comments
When attempting to fix this, could adding of Currently M2R fails if
|
Still seeing this warning with Sphinx 2.4.1:
|
As a workaround, add this to your def monkeypatch(cls):
""" decorator to monkey-patch methods """
def decorator(f):
method = f.__name__
old_method = getattr(cls, method)
setattr(cls, method, lambda self, *args, **kwargs: f(old_method, self, *args, **kwargs))
return decorator
# workaround until https://github.com/miyakogi/m2r/pull/55 is merged
@monkeypatch(sphinx.registry.SphinxComponentRegistry)
def add_source_parser(_old_add_source_parser, self, *args, **kwargs):
# signature is (parser: Type[Parser], **kwargs), but m2r expects
# the removed (str, parser: Type[Parser], **kwargs).
if isinstance(args[0], str):
args = args[1:]
return _old_add_source_parser(self, *args, **kwargs) |
Using this approach: miyakogi/m2r#51 (comment)
@miyakogi any chance to get a new release? This component is the only reason we are still using sphinx 2. |
Ignoring sphinx@2 security issue for now, see: miyakogi/m2r#51
Ignoring sphinx@2 security issue for now, see: miyakogi/m2r#51
* Fix typo at logging.py file * Ignore sphinx@2 security issue for now Ignoring sphinx@2 security issue for now, see: miyakogi/m2r#51
Since I'm still seeing lots of clones on my fork (which I created to solve this issue) here goes a quick update: I've released it as |
@CrossNox Thanks for the release! I wonder if you could combine forces with @qhua948 (released as m2rr) to make a successor to m2r. It would be good to avoid too much proliferation (ideal would be if @miyakogi would add some additional maintainers). If combining doesn't work out, you should rename your fork to 'm2r2'. It might be good to enable issues there too if it's going to diverge from this repo significantly. It's a little confusing to keep using this repo to discuss issues that might be fixed in one of the forks. |
@sbliven I sure hope we could work together on this. I didn't learn of that release until I commented somewhere about the update, my bad. I wouldn't count on @miyakogi adding collabs, they don't seem to have been active for a long time. 100% agree on that last bit! I am pretty sure github redirects clones if I change the repo's name, but i wanna test it just in case. I wouldn't wanna break the pipelines for people using it, but I guess it's still gonna happen. Edit: I've enabled issues (no clue why they weren't already enabled) and renamed the repo to avoid any confusion. |
|
@dazza-codes See the fork that was updated to fix this: https://github.com/CrossNox/m2r2 Thankfully they made it a different pip package officially, so it's a extremely nice fix. |
During the build process, the following warning is emitted:
Looks like some functionality will be removed in the next version of sphinx. I found this on version
2.2.1
The text was updated successfully, but these errors were encountered: