-
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
poetry install
installs the project as a dependency of itself?
#800
Comments
That is the expected behavior and I also have the same issue using Poetry as a virtualenv manager. sdispater plans to add a feature in ^1.0.0 to disable this (#730 (comment)) There is an open PR to pass an option to disable installing the project pending merge: #757 |
Thanks, Kyle. I read on your linked comment that installing itself too ensures that "new elements like entrypoints are properly installed". Does this mean that on my first PC, where I created the project from scratch, that these were already installed when I did |
I'm not sure, I imagine it may be used when developing Python modules where you may want the environment to have the package for running tests rather than using relative imports from the test directory I only linked the comment to reference that sdispater mentioned not installing the project within the project would be a supported feature. I'm pretty sure |
Update: this is what it's used for 😅 #34 (comment) The |
I would also like to vote for an option to not install the project. Furthermore, the documentation is currently inaccurate, as I, and I think most other people, understand this to mean that it does not install the project itself. My use case for this is that I mainly develop Django applications, and whenever I run |
Poetry is not ready for corporate environments of this time, because of this issue. This is really required, especially if there is no internet connection available but only a PyPI mirror. (At least it should also pass the PyPI mirror defined in the [[tool.poetry.source]]
name = "artifactory"
url = "https://some-artifactory/artifactory/api/pypi/pypi-all/simple/" poetry install -n
Creating virtualenv inspector-py3.7 in /root/.cache/pypoetry/virtualenvs
Installing dependencies from lock file
Package operations: 17 installs, 0 updates, 0 removals
- Installing certifi (2018.11.29)
- Installing chardet (3.0.4)
- Installing idna (2.8)
- Installing urllib3 (1.24.1)
- Installing appdirs (1.4.3)
- Installing attrs (18.2.0)
- Installing click (7.0)
- Installing markupsafe (1.1.0)
- Installing requests (2.21.0)
- Installing six (1.12.0)
- Installing toml (0.10.0)
- Installing black (18.9b0)
- Installing jinja2 (2.10)
- Installing python-dateutil (2.8.0)
- Installing python-gitlab (1.7.0)
- Installing pyyaml (3.13)
- Installing tenacity (5.0.3)
- Installing inspector (0.1.0)
/usr/local/lib/python3.7/site-packages/poetry/vcs/__init__.py:19: RuntimeWarning: git executable could not be found
"git executable could not be found", category=RuntimeWarning
[EnvCommandError]
Command ['/root/.cache/pypoetry/virtualenvs/inspector-py3.7/bin/pip', 'insta
ll', '-e', '/builds/code-ops/inner-source-inspector', '--no-deps'] errored w
ith the following output:
Obtaining file:///builds/code-ops/inner-source-inspector
Installing build dependencies: started
Installing build dependencies: still running...
Installing build dependencies: still running...
Installing build dependencies: still running...
Installing build dependencies: still running...
Installing build dependencies: still running...
Installing build dependencies: still running...
Installing build dependencies: finished with status 'error'
Complete output from command /root/.cache/pypoetry/virtualenvs/inspector-p
y3.7/bin/python -m pip install --ignore-installed --no-user --prefix /tmp/pi
p-build-env-tfd8pos2 --no-warn-script-location --no-binary :none: --only-bin
ary :none: -i https://pypi.org/simple -- poetry>=0.12:
Collecting poetry>=0.12
Retrying |
This is also causing an issue with forked repositories. I'm currently using django-tenant-schemas, and when the setup.py file is created it is adding:
This is defined in pyproject.toml as referencing a forked Github repo (which contains some bug fixes, it's not yet merged), however in setup.py it's falling back to the version that's on pypi. My current workaround is to have an additional RUN command in my Docker container calling Pip directly... EDIT: Another workaround is to have the dependency installed as a dev dependency, however then I can't take advantage of |
I will agree with this. I wanted to move our projects to Poetry but this issue is a blocker, as it creates problems with our caches (the package is already in there and the runners get confused). It's too bad, because I love Poetry otherwise, but we had to go with pip-compile in the end. Could this please be fixed? I'd very much like to use Poetry to deploy our apps. |
My corporate environment is also blocked by this issue. I patched a version based on #757. I left a comment with the necessary modifications. Wheel version here In my dockerfile I'm using: |
I solved the issue by changing the project-name in pyproject.toml to be something different than the directory name itself. Poetry: 0.12.11 |
What @jnoortheen suggested seems to work for me too, but it's not exactly clear to me why? Surely this behavior is a bug? |
The option has been already merged into But I think the name of the option should rename to something like |
@drunkwcodes Do you know if this has been released in any version? I can't find it in 0.12.12... |
@sdispater Do you know when this might be released? I am about to introduce poetry at our company and I think this behavior would hinder adoption, maybe I can wait a bit if the feature is coming soon. |
This seems to be in 1.0.0a3. However, I'm not sure when that will be released and there's no word from a maintainer. Hopefully release will happen soon, but the lack of an update here is frustrating. |
Hello everyone! Any news on this? |
The feature is present in the |
Many thanks, Sébastien. For posterity, this is currently documented in the development branch in docs > CLI >
|
Pytest has a bunch of dependencies, some of which have their own dependencies. |
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. |
Question
TL;DR: Is it expected behaviour when doing
poetry install
for the project to install itself as a dependency of itself?I have started a new project using
poetry init
and followed up bypoetry add
ing all my dependencies. I then pushed, and then cloned the git repo to another PC.After the clone, I opened the new folder and did
![screenshot](https://camo.githubusercontent.com/5e9a82d384cc85d45ca670c4926643f59244474e24e64fe2a3bbcacd37ece988/687474703a2f2f692e696d6775722e636f6d2f38324a3755574e2e6a7067)
poetry install
in that folder. That created the new virtual environment, as expected, but it also seems as if it installed the project as a dependency of itself. Please see the screenshot below. This is also evident in the new egg-info folder that was created. I expected the installations to stop at the last package (requests).I did not expect that behaviour and would like to confirm if that is the intention of
poetry install
.You can find my project files here:
The text was updated successfully, but these errors were encountered: