Skip to content
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

Install error when installing a non-package in package-mode gives invalid instructions #9072

Closed
andyclegg opened this issue Feb 29, 2024 · 1 comment · Fixed by #9073
Closed
Labels
kind/bug Something isn't working as expected

Comments

@andyclegg
Copy link
Contributor

andyclegg commented Feb 29, 2024

Description

Create an empty project with poetry init, then attempt to install it. Without the README.md file being created, the installation will fail. When installation fails without configuring package-mode, Poetry 1.8.1 emits the following error message:

Warning: The current project could not be installed: [Errno 2] No such file or directory: '/README.md'
If you do not want to install the current project use --no-root.
If you want to use Poetry only for dependency management but not for packaging, you can set the operating mode to "non-package" in your pyproject.toml file.
In a future version of Poetry this warning will become an error!

The message instructs to 'set the operating mode to "non-package" in your pyproject.toml file', implying using 'non-package = true' or similar, whereas the correct key is 'package-mode = false'.

Workarounds

The correct key can be inferred from a search.

Poetry Installation Method

pipx

Operating System

Linux Mint 21.3

Poetry Version

1.8.1

Poetry Configuration

cache-dir = "/home/andy/.cache/pypoetry"
experimental.system-git-client = false
installer.max-workers = null
installer.modern-installation = true
installer.no-binary = null
installer.parallel = true
keyring.enabled = true
solver.lazy-wheel = true
virtualenvs.create = true
virtualenvs.in-project = null
virtualenvs.options.always-copy = false
virtualenvs.options.no-pip = false
virtualenvs.options.no-setuptools = false
virtualenvs.options.system-site-packages = false
virtualenvs.path = "{cache-dir}/virtualenvs"  # /home/andy/.cache/pypoetry/virtualenvs
virtualenvs.prefer-active-python = false
virtualenvs.prompt = "{project_name}-py{python_version}"
warnings.export = true

Python Sysconfig

No response

Example pyproject.toml

[tool.poetry]
name = "foo"
version = "0.1.0"
description = ""
authors = ["Andy"]
readme = "README.md"

[tool.poetry.dependencies]
python = "^3.9"


[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

Poetry Runtime Logs

$ poetry -vvv install
Loading configuration file /home/andy/.config/pypoetry/config.toml
Using virtualenv: /home/andy/.cache/pypoetry/virtualenvs/foo-IVQOPcWJ-py3.9
Installing dependencies from lock file

Finding the necessary packages for the current system

Installing the current project: foo (0.1.0)

Warning: The current project could not be installed: [Errno 2] No such file or directory: '/home/andy/foo/README.md'
If you do not want to install the current project use --no-root.
If you want to use Poetry only for dependency management but not for packaging, you can set the operating mode to "non-package" in your pyproject.toml file.
In a future version of Poetry this warning will become an error!
@andyclegg andyclegg added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Feb 29, 2024
@abn abn removed the status/triage This issue needs to be triaged label Feb 29, 2024
@abn abn closed this as completed in #9073 Feb 29, 2024
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 31, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Something isn't working as expected
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants