-
Notifications
You must be signed in to change notification settings - Fork 80
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
mypy-protobuf cannot be used under setup_requires #137
Comments
See #102 for a bunch of background context In our setup.py, we provide
The entry_points describe the script you're looking for (I believe) If you simply install mypy-protobuf (eg I'm not sure what keeping something under I'm open to a strategy that works for you here. Do you have a recommendation? Potentially helpful documentation |
first of all, thank you for the quick reply! To be clear, what I'm trying to figure out, is how to allow mypy-protobuf to be used at build time without having previously installed it manually. As installing a package installs its dependencies without someone having to do that manually, I am attempting to make building my package work without having to manually install its build dependencies (as that is a constraint that I have to work with currently). Though the changes in the PR you pointed out are great, they have definitively removed the possibility for folks to use mypy-protobuf in this fashion. However adding back another small script (not unlike) |
As a side note, I realize setup_requires is a deprecated feature, but it is still to my knowledge the only possible way to get this done. Another alternative I had looked at is using https://www.python.org/dev/peps/pep-0518/ However, setuptools does not use this new "standard", and one cannot only build the package using pip, so this appears to be another a dead-end. |
Actually, it looks like I could make it work by simply using the mypy_protobut.py file directly inside the protoc command line:
However, it requires the file to be executable, but it is not when setuptools extracts it... just a file mode away from a working solution! |
I'll accept a PR that makes mypy_protobuf.py executable if that'll help you out! Something about the installation process is supposed to create |
Apologies for not getting back here earlier. Though I feel that I am very close to a solution/conclusion, I have run out of time to investigate this further at the moment. will get back to it in due time... feel free to close this issue for now if you want to keep things clean, I will simply reopen one referencing it if/when needed... Thanks for your help with this! |
hiya - going through these older tasks. I spent a few minutes trying to repro, but was not able to figure out how to successfully use setup_requires. Does seem like setup.py and the python packaging ecosystem is evolving quickly (incl pyproject.toml). Could not quite figure out how to make a custom packaging build script of the variety you describe. Do you have a link to the small project you were talking about w/ an example of what the setup.py looks like? Will close for now. Feel free to reopen with more info. |
I have a small project whose setup.py extends the build command to also generate the python classes from the protobuf definitions. I am generating the stubs with mypy-protobuf at the same time, and now trying to make this happen in the standard fashion, by calling only "python setup.py clean build" and having it handle the build dependency.
while listing mypy-protobuf under the setup_requires downloads mypy-protobuf under an .eggs directory and adds it on the python path, the installed egg is missing the script I could use to call protoc with. It only has the windows .bat file.
Could you please also surface the correct plugin to be used in the protoc command line?
Much appreciated!
The text was updated successfully, but these errors were encountered: