All jobs

Fix 'The option "--no-dev" does not exist' After pip install poetry Picks Up Poetry 2

Yes. An agent finds every poetry install --no-dev in Dockerfiles and workflows, moves to --only main, and runs the same commands to prove the image builds.

Run this on RushOpens the console with this prompt ready to send, in a Project that has your repository.

What the agent does

The agent reads every place the project invokes Poetry, because the flag is usually copied into more than one. In a project like Escape-Technologies/graphinder, the Dockerfile starts from python:3.10-alpine, runs pip install poetry with no version, then poetry install --no-dev --no-root for the dependency layer and poetry install --no-dev after copying the package. The release workflow .github/workflows/cd.yaml does the same in its pypi-push job: pip install poetry, poetry install --no-dev, poetry build. The CI workflow runs plain poetry install, which is why tests kept passing while the release path broke.

It reproduces the failure with the exact command the Dockerfile runs. With the Poetry that pip install poetry resolves today, 2.5.1, poetry install --no-dev --no-root prints The option "--no-dev" does not exist and exits. The Poetry 2.0.0 changelog entry is Remove deprecated CLI options and methods and revoke the deprecation of --dev. On Poetry 1.8.5 the same command prints The --no-dev option is deprecated, use the --only main notation instead. and goes on to install, so the project worked until the unpinned install crossed 2.0.

The replacement is --only main, which Poetry 1.8 itself recommended, and the agent proves it on the interpreter the image uses rather than the sandbox default. poetry env use on a Python 3.10, then poetry install --only main --no-root, installs the runtime dependencies from the lock file (aiohttp 3.8.3, beautifulsoup4 4.11.1, requests 2.28.1 among them); --without dev is accepted too. The lock file is lock-version = "2.0", which Poetry 2 reads without a regeneration.

Poetry 2 also prints that The "poetry.dev-dependencies" section is deprecated and that [tool.poetry.name] should move to [project.name]. Those are warnings, not failures, so the agent leaves pyproject.toml alone and lists them. It also runs the full poetry install the CI uses and pytest tests/unit: 46 pass and two in tests/unit/pool fail because they expect one hundred subdomains from a live lookup and get two, the same on either Poetry, and poetry run graphinder -h prints the tool's banner. The sandbox has no Docker; to build the image itself the agent installs docker.io, starts dockerd and runs docker build, and the first build on the fixed Dockerfile is the proof the pull request quotes.

Start it with one API call

POST https://api.phoenix.so/o/{org}/sessions with this body:

{
  "agent": "claude",
  "input": "Our Docker build and release workflow fail with 'The option \"--no-dev\" does not exist' after pip install poetry started installing Poetry 2. Find every poetry install invocation in the Dockerfile and under .github/workflows, show which Poetry version an unpinned pip install resolves and what the same command prints on Poetry 1.8, and replace --no-dev with --only main. Prove it on the Python version the image uses: run the dependency install from the lock file, the full install the CI uses, and the test suite. Build the image if you can. Open a pull request quoting the failing and the passing command, and list every deprecation warning Poetry 2 prints about pyproject.toml as separate work.",
  "resources": [
    {
      "url": "https://github.com/your-org/your-app"
    }
  ]
}
  1. Get an API key. In the console, open Settings, then API keys, and create a key for your org. Send it in the Authorization header as a Bearer token.
  2. Send the request. POST the body in request.json to https://api.phoenix.so/o/{org}/sessions, with your repository as the resources URL. The run starts in its own cloud sandbox.
  3. Read what came back. Follow the run on its live stream or wait for the run.completed webhook, then read the result and its trajectory.

What comes back

A pull request that changes three command lines, two in the Dockerfile and one in the release workflow, from --no-dev to --only main. The description quotes the Poetry 2 refusal, the Poetry 1.8 deprecation notice that explained the replacement, the successful install from the lock file on Python 3.10, and the test summary with its two pre-existing network-dependent failures named.

A reviewer checks that the CI workflow, which never used the flag, is untouched, and that no version pin was added silently. If they want Poetry pinned in the image, the description shows where the unpinned pip install poetry lines are so that is a one-line follow-up.

The pyproject.toml deprecations that Poetry 2 prints, dev-dependencies and the [tool.poetry] metadata fields, are listed with the message text so the team can decide whether to migrate to the [project] table in its own pull request.

Run it on every failed release workflow

A release job is where this breaks, so the trigger is the failure itself. A handler on your server receives GitHub's workflow-run webhook, and when the failed job's log contains the Poetry message it starts this run through POST /o/{org}/sessions with a UUID v5 of the workflow run id as request_id, so a retried delivery returns the run already started.

For images built elsewhere, a Grafana alert on the build system's error count can call a Rush webhook trigger directly, with Authorization: Bearer and the trigger's secret in its contact point, and the payload reaches the agent as data after the prompt.

The use case this job follows, with its automation and trigger: Fix a bug from an alert.

Why run it on Rush?

The failing command lives in a Dockerfile, so the honest reproduction is the command itself on the image's interpreter, not a note that a flag changed. In a Rush sandbox the agent installs the Poetry that pip resolves today and the 1.8 release that still accepted the flag, runs both, and keeps their output with the run, so the pull request shows the exact refusal and the exact replacement.

A dependency manager that moved a major also prints new warnings, and a reviewer wants the fix for the failure kept apart from a metadata migration. Running the full install and the test suite on both sides lets the agent show that only the command line changed and that every warning left is the same before and after.

Frequently asked questions

Why did this start failing without any change to the repository?

Because pip install poetry with no version takes whatever is newest. Poetry 2.0.0 removed the deprecated --no-dev option, so the first image build after that release hit the refusal while the CI job, which runs poetry install with no flag, kept passing.

Should I use --only main or --without dev?

Both are accepted by Poetry 2 and both skip the development group. Poetry 1.8's own deprecation message recommended --only main, which installs exactly the main group and nothing else, so that is what the pull request uses; --without dev is the right choice when you have other groups to keep.

Does the lock file need regenerating?

Not for this fix. The repository's poetry.lock is lock-version 2.0, which Poetry 2 reads as is, and the agent installs from it unchanged. A lock refresh would change dependency versions and belongs in its own pull request.

Will the agent pin Poetry in the Dockerfile?

Only if asked. The pull request names the two unpinned pip install poetry lines so a pin is a one-line follow-up, but adding one changes how the image tracks upstream and is the team's call.

Can the agent run the Docker build?

The sandbox has no Docker preinstalled. The agent installs docker.io, starts dockerd, and runs docker build on the fixed Dockerfile; docker compose v2 is not in that package, so a compose file would need the v1 docker-compose.

More Poetry jobs

More jobs like this: Fix a bug from an alert

Keep reading