-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Should by default add build-system.requires
entries as dev-dependencies
#3428
Comments
To build a library it's not necessary to actually have any of the development dependencies installed. For example, the default that requires Poetry as the build system (what's generated by |
I'm aware of that. What I wrote is exactly the other way round. /edit: To elaborate a bit, I have an additional build (not runtime) dependency to poetry-core that I list in the |
@filmor I guess I see what you mean, and there is a good point in there. This could probably be an opt-in setting (deactivated by default).
This does not seem normal at all. Or maybe I am misunderstanding something. Would you mind expanding on this? |
In this particular case it is about https://github.com/pythonnet/pythonnet which requires |
I am confused...
The example you linked, shows the exact opposite,
Yes, and poetry (via PEP517/PEP518) allows to do that perfectly well. Right? |
I'm working on improving the build of pythonnet, and indeed, up until now To get back to topic: A rough [build-system]
requires = ["poetry_core>=1.0.0", "pycparser"]
build-backend = "poetry.core.masonry.api"
# ...
[tool.poetry.build]
generate-setup-file = false
script = "tools/build.py"
[tool.poetry.dependencies]
python = ">=3.6 <3.10"
[tool.poetry.dev-dependencies]
pytest = "~6"
psutil = "~5"
pycparser = "~2" The current state is at https://github.com/filmor/pythonnet/blob/master/pyproject.toml. I don't like that I have to list |
Ah, OK, thanks for clarification.
Yes, I agree that duplications should be avoided as much as possible.
Well, I'd argue that seeing as you seem to be the first one to ask for such a feature (to my knowledge), it might be an indication that having the build dependencies installed in the development environment is not a particularly needed feature... Thinking about it, I'd venture that it is most likely a consequence of the fact that poetry does not (officially) support custom build steps. If there are no custom build steps then having anything else than |
|
What? No. Neither poetry nor poetry-core are installed in the development virtual environment. And they shouldn't. Why would someone want to have poetry or poetry-core in their development environment? I am very confused... Are you maybe talking about the build environment?
I am really not following in which direction you are going. OK, let's wait for your PR... |
Hmm, maybe I'm indeed confusing build and dev here, I wasn't aware of a distinction. Is my concrete problem clear? I essentially want to have everything that is needed to run my build-script (I extended the post above with the respective section) available after I run My idea to resolve this was to just always amend the former to the latter. |
OK, that might explain our disagreements. In short: since PEP517 and PEP 518, build front-ends (such as poetry, pip, etc.) tend to use a technique called build isolation in order to build (i.e. transform a sdist into a wheel for example) Python projects (i.e. pip-installable libraries found on PyPI for example). Basically an ephemeral virtual environment is created, then the build dependencies listed under So dev-dependencies are a completely different list of dependencies, and those lists do not necessarily intersect. If poetry were to support custom build dependencies, then there might be a good reason to install the build dependencies in the development virtual environment as well. A bit far fetched, I am still not sure it would be necessary, but maybe it could be helpful. But poetry does not (officially) support custom build dependencies anyway, so there is not much need to begin with.
Somewhat clear, yes. But I feel like maybe your intentions here are based on misconceptions of the current situation. Are you really sure you need your build dependencies in the development environment? What would you use them for? Isn't it enough to call
Sure, duplications should be avoided. But I am still not sold on the premise. We'll see what the maintainers say... |
I've tried that and they don't. Only |
What have you tried?
What has failed? What were the error messages? |
It doesn't find What I did was simply checking out the repo and doing |
That would be great! |
I can not see anything meaningful at that link: {"count":11,"value":"Uri expired"} |
This one should make the problem clear: https://github.com/filmor/issue3428 For me, |
404 for me. Maybe the repo is not public. |
I can recreate the issue. I am really surprised |
That's probably fine. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Feature Request
Everything that is listed in
build-system.requires
is probably a dev-dependency and it would be good, if it was added automatically s.t. one does not have to keep both lists in sync. I can currently not thing of any situation where this would not be beneficial :)The text was updated successfully, but these errors were encountered: