CrossNox / m2r2

Markdown to reStructuredText converter
https://crossnox.github.io/m2r2
MIT License
107 stars 26 forks source link

Error when trying to run pip install -r requirements-dev.txt #67

Open Omcsesz opened 5 months ago

Omcsesz commented 5 months ago

Hello, Team!

I got an error when I try to run pip install -r requirements-dev.txt: ReqDevInstallDoesNotWork

Can you please support?

steve-s commented 4 months ago

Just passing by facing the same/similar problem. The issue is that one of the dependencies: typed-ast, which is not maintained anymore [0] (the authors suggest moving to the builtin module ast), has this code in it:

#include "code.h"

According to what's new in Python 3.11 [1]:

The non-limited API files cellobject.h, classobject.h, code.h, context.h, funcobject.h, genobject.h and longintrepr.h have been moved to the Include/cpython directory. Moreover, the eval.h header file was removed. These files must not be included directly, as they are already included in Python.h: Include Files. If they have been included directly, consider including Python.h instead. (Contributed by Victor Stinner in bpo-35134.)

Porting m2r2 from typed-ast to builtin ast module is probably the best long term fix. In the meanwhile, just replacing the

#include "code.h"

with

#include <Python.h>

should do, but requires patching the source of the dependency...

[0] https://github.com/python/typed_ast/issues/179 [1] https://docs.python.org/3.11/whatsnew/3.11.html

Edit: it seems that typed-ast is a transitive dependency, so whoever depends on it needs to migrate to ast...

Edit2/TL;DR: it's mypy that needs to be updated