The Poetry configuration is invalid: - Additional properties are not allowed ('group' was unexpected)

when I deployed Django project on render
I encountered failed: above subject

my current local poetry version is 1.2.2

I following docs: Getting Started with Django on Render


my <render.yaml> file:
databases:

  • name: mysite
    databaseName: mysite
    user: mysite
    region: singapore

services:

  • type: web
    name: mysite
    env: python
    region: singapore
    buildCommand: “./build.sh”
    startCommand: “gunicorn mysite.wsgi:application”
    envVars:
    • key: DATABASE_URL
      fromDatabase:
      name: mysite
      property: connectionString
    • key: SECRET_KEY
      generateValue: true
    • key: WEB_CONCURRENCY
      value: 4

my <build.sh> file:
#!/usr/bin/env bash

exit on error

set -o errexit

poetry install

python manage.py collectstatic --no-input
python manage.py migrate


my <pyproject.toml> file:
[tool.poetry]
name = “mysite”
version = “0.1.0”
description = “”
authors = “”
readme = “README.md”

[tool.poetry.dependencies]
python = “^3.9”
django = “4.0”
dj-database-url = “^1.0.0”
psycopg2-binary = “^2.9.5”
whitenoise = {extras = [“brotli”], version = “^6.2.0”}
gunicorn = “^20.1.0”

[tool.poetry.group.dev.dependencies]

black = {version = “^22.10.0”, allow-prereleases = true}

[build-system]

requires = [“poetry-core”]
build-backend = “poetry.core.masonry.api”


what should I do?

The Poetry version provided by Render is < 1.2 (1.1.4 as of today). Which is problematic for anyone who has some recent Poetry config (like me).

A suggestion is to move to a deploy using Docker (not so happy of having to change all this just because of an old version of Poetry).

Another way to resolve this issue is to use the older format for dev dependencies as described in the Poetry docs.

Specifically, change [tool.poetry.group.dev.dependencies] to [tool.poetry.dev-dependencies].

Note that the poetry.lock file won’t be compatible between poetry versions so you’d need to remove that from your VCS as well.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.