jakecyr / toml-to-requirements

Simple CLI to convert a pyproject.toml file to a requirements.txt file
5 stars 0 forks source link

Error in skybrush-server poetry file #1

Closed pinyinjj closed 3 months ago

pinyinjj commented 3 months ago

Error reports when translate file pyproject.toml PS E:\skybrush-server> toml-to-req --toml-file pyproject.toml project section is missing from the toml file. Exiting...

[tool.poetry]
name = "flockwave-server"
version = "2.18.1"
description = "Skybrush server component"
authors = [
    "Tamas Nepusz <tamas@collmot.com>",
    "Gabor Vasarhelyi <vasarhelyi@collmot.com>",
]
license = "GPL-3.0-or-later"
packages = [{ include = "flockwave", from = "src" }]

[[tool.poetry.source]]
name = "PyPI"
priority = "primary"

[[tool.poetry.source]]
name = "collmot"
url = "https://pypi.collmot.com/simple/"
priority = "explicit"

[[tool.poetry.source]]
name = "fury"
url = "https://pypi.fury.io/skybrush/"
priority = "supplemental"

[tool.poetry.dependencies]
python = "^3.9"
bidict = ">=0.22.1"
click = "^8.1.7"
blinker = "^1.7.0"
jsonschema = "^4.21.1"
python-baseconv = "^1.2.2"
pynmea2 = "^1.19.0"
trio = ">=0.24.0"
quart = ">=0.19.4"
quart-trio = ">=0.11.1"
trio-util = ">=0.7.0"
python-dotenv = "^1.0.0"
colour = ">=0.1.5"
pyjwt = "^2.8.0"
hypercorn = { extras = ["trio"], version = ">=0.16.0" }
passlib = { extras = ["bcrypt"], version = "^1.7.4" }
flockwave-app-framework = { version = "^3.0.0", extras = [
    "daemon",
], source = "fury" }
flockwave-async = { version = "^1.4.2", source = "fury" }
flockwave-conn = { extras = [
    "rpc",
    "serial",
], source = "fury", version = "^7.0.0" }
flockwave-ext = { version = "^1.25.0", source = "fury" }
flockwave-flockctrl = { version = "^2.17.0", source = "collmot", optional = true }
flockwave-gps = { version = "^3.2.0", source = "fury" }
flockwave-logger = { version = "^1.9.0", source = "fury" }
flockwave-mavlink = { version = ">=0.1.0", source = "fury" }
flockwave-net = { extras = ["async"], version = "^7.0.0", source = "fury" }
flockwave-parsers = { version = "^2.1.0", source = "fury" }
flockwave-spec = { version = "^1.81.1", source = "fury" }
skybrush-ext-dock = { version = "^1.0.0", source = "collmot", optional = true }
skybrush-ext-firmware-update = { version = "^0.3.0", source = "collmot", optional = true }
skybrush-ext-flight-report = { version = "^1.0.3", source = "collmot", optional = true }
skybrush-ext-flockctrl = { version = "^2.31.0", source = "collmot", optional = true }
skybrush-ext-map-cache = { version = "^1.1.0", source = "collmot", optional = true }
skybrush-ext-sidekick = { version = "^1.0.1", source = "collmot", optional = true }
skybrush-ext-timecode = { version = "^1.1.0", source = "collmot", optional = true }
skybrush-lib-mission-planning = { version = "^2.0.0", source = "collmot", optional = true }
pyledctrl = { version = "^4.1.0", source = "fury" }
aiocflib = "^4.0.1"
appdirs = "^1.4.4"
crcmod-plus = "^2.1.0"
msgpack = "^1.0.7"
aio-usb-hotplug = "^6.0.0"
pyserial = "^3.5"
compose = "^1.5.0"
adrenaline = "^3.0.0"
httpx = ">=0.26.0"
igrf-model = "^1.1.3"
deprecated = "^1.2.14"
unidecode = "^1.3.8"

[tool.poetry.group.dev.dependencies]
coverage = { extras = ["toml"], version = "^7.4.0" }
pytest = "^8.0.0"
pytest-cov = "^5.0.0"
pytest-trio = ">=0.8.0"
pdoc = "^14.3.0"

[tool.poetry.extras]
all = [
    "flockwave-flockctrl",
    "skybrush-ext-dock",
    "skybrush-ext-flight-report",
    "skybrush-ext-flockctrl",
    "skybrush-ext-map-cache",
    "skybrush-ext-sidekick",
    "skybrush-ext-timecode",
    "skybrush-lib-mission-planning",
]
collmot = [
    "flockwave-flockctrl",
    "skybrush-ext-dock",
    "skybrush-ext-firmware-update",
    "skybrush-ext-flight-report",
    "skybrush-ext-flockctrl",
    "skybrush-ext-map-cache",
    "skybrush-ext-timecode",
    "skybrush-lib-mission-planning",
]
pro = [
    "skybrush-ext-flight-report",
    "skybrush-ext-map-cache",
    "skybrush-ext-sidekick",
    "skybrush-ext-timecode",
    "skybrush-lib-mission-planning",
]

[tool.poetry.scripts]
skybrushd = "flockwave.server.launcher:start"
skybrush-gateway = "flockwave.gateway.launcher:start"
skybrush-proxy = "flockwave.proxy.launcher:start"

[tool.ruff]
ignore = ["B905", "C901", "E402", "E501"]
line-length = 80
select = ["B", "C", "E", "F", "W"]
extend-exclude = ["src/flockwave/server/ext/socketio/vendor"]

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
pinyinjj commented 3 months ago

Seems like project = data.get("project") doesn't match the [tool.poetry] part also as the following part [tool.poetry.extras]

jakecyr commented 3 months ago

Hey @pinyinjj! As noted in the README, this library does not currently support poetry projects however I can see if it would be a quick addition.

jakecyr commented 3 months ago

@pinyinjj I was able to update the CLI tool to support poetry however, I would recommend using the poetry export command to do this instead since it uses your poetry.lock file.

Example:

poetry export -f requirements.txt --output requirements.txt