-
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
Support pip install .
to include tool.poetry.dev-dependencies
#3514
Comments
Hello, please use poetry export to create a fin swimmer |
@finswimmer Using Since PEP517, PEP518 are here already, |
Hello @ace-han, the dev-dependencies are not part of the package itself, it's a feature provided by poetry to manages those dependencies as well. PEP 517/518 are describing an interface to build a package from source. Because dev-dependencies are not part of the package itself, there's nothing useful we can do here. Why not installing poetry in your CI? It's getting installed anyway if you are doing a fin swimmer |
@finswimmer I've done some test, please refer to https://github.com/ace-han/composetest/blob/master/Dockerfile In order to install It's way too complicated than just # using pip
RUN pip install -r requirements.txt VS # using poetry
# (this way is hard, modifying `/etc/hosts`, installing curl/poetry are very tricky in docker image)
# (refer to https://github.com/snok/install-poetry/blob/main/action.yml)
RUN apk --no-cache add curl
# refer to https://github.com/hawtim/blog/issues/10 for `githubusercontent.com` issue
RUN echo '199.232.96.133 raw.githubusercontent.com' >> /etc/hosts \
&& curl -O -sSL https://raw.githubusercontent.com/sdispater/poetry/master/get-poetry.py \
&& python get-poetry.py --yes \
&& rm get-poetry.py \
&& source $HOME/.poetry/env \
&& poetry config virtualenvs.create false \
&& poetry install --no-root As I mentioned earlier, |
Some of us, in the larger Python packaging ecosystem make our dev dependencies optional with the extra feature. So that we can do |
@sinoroc Interesting. Could you be more specific? Maybe some demo code?
Thx in advance. |
@ace-han Nothing particularly complicated about it. Instead of placing your development dependencies under poetry's I wish maybe poetry would settle for a convention where if the project has extras named |
@sinoroc Great! Then this will be another choice to make However, I think Thx |
Hello @ace-han,
as you don't need to take full advantage of working together with pyenv, you can use pipx to install poetry.
Yes this is practical and it works. But my understanding of "extras" is, that those package add additional features to the package itself. So using this for dev dependencies is a kind of misuse (due to the lack of better solutions until now).
Sounds like a nice idea for a plugin (as soon as the plugin system is available)
There is no clean technical way for it. While PEP 517 allows a way to pass arguments to the build backend, this would mean that one could build the same package with different dependencies (without dev-dependencies by default, with them with any kind of flag). Dynamic dependencies must be avoided in any case. fin swimmer |
Absolutely. It can be considered a misuse. I should have mentioned that. But a harmless one as far as I can tell. Never seen any issue of any kind with that pattern. |
When developing a This is one of the cases to do |
I don't think you should use poetry on the app server. I don't think poetry should be used for deployment. You probably should build your application as a wheel, and then copy all the wheels (app + all dependencies) to the app server, where you use pip to install (while skipping the index and any other network connection). That is what I would recommend. |
I've just come across this as well when doing some maintenance on our CI pipelines. And I'm in the same boat as @sinoroc and @ace-han . I have been using the When working on the CI pipelines I am also faced with some cumbersome scripts to detect whether a project uses poetry or not as we have only migrated two projects for now to evaluate poetry (and to install poetry if needed) With PEP 517 and PEP518 I was hoping I could finally just run a I could re-create the "extra" again in In general - while this is a bit off-topic - this issue is yet another nail in the coffin for our team. And primarily due to the difficulties when running CI pipelines. I really enjoy the poetry CLI UX, but I don't think that alone should be a selling point. |
this is workaround of python-poetry/poetry#3514 issue
If I have |
Just leaving a comment here to echo what others have said. Specifically:
The lack of this feature is preventing my teams adoption of this tool 😞 |
After testing poetry for over a year, this issue along with the issue of having "editable" installs (as in |
I found solution for me. It looks bad, but maybe it can be helpful for someone: The idea is use some custom Then i can install dev deps from pip install --config-settings dev=true . |
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
It would be great if
pip install .
could pick up those dependencies undertool.poetry.dev-dependencies
section.The use case is to deploy a poetry managed app to a docker/CI environment without installing
poetry
, just plainpip install .
in order to run uni-test.The text was updated successfully, but these errors were encountered: