-
Notifications
You must be signed in to change notification settings - Fork 54
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
Extras present in exported constraints.txt file #210
Comments
if you hope for anyone ever to look at this, provide a way to reproduce it! |
Good point @dimbleby ! Here's a [tool.poetry]
name = "foo"
version = "0.1.0"
description = ""
authors = ["Your Name <you@example.com>"]
readme = "README.md"
[tool.poetry.dependencies]
python = "^3.10"
optimum = {extras = ["onnxruntime"], version = "^1.8.6"}
[tool.poetry.group.dev.dependencies]
transformers = {extras = ["sentencepiece"], git = "https://github.com/huggingface/transformers.git", branch = "main", rev = "0c65fb7cfa1258fb5946c5ae4d13f5a2a88a2f56"}
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api" With that on your root folder, you can then follow these steps to reproduce the issue:
|
fix looks like it should be something along these lines diff --git a/src/poetry_plugin_export/exporter.py b/src/poetry_plugin_export/exporter.py
index 4ec7cc4..bf307e7 100644
--- a/src/poetry_plugin_export/exporter.py
+++ b/src/poetry_plugin_export/exporter.py
@@ -101,11 +101,11 @@ class Exporter:
):
line = ""
- if not with_extras:
- dependency_package = dependency_package.without_features()
-
dependency = dependency_package.dependency
package = dependency_package.package
+ if not with_extras:
+ dependency = dependency.without_features()
+ package = package.without_features()
if package.develop:
if not allow_editable: but I expect you'll need to write a testcase to get that merged, and that's likely to be more work |
After generating the
constraints.txt
file, I noticed that it still exported a few packages with extra dependencies. This eventually makespip install ... --constraint constraints.txt
fail with:This seems to be handled by #128 so it's unclear why it would still happen (perhaps a regression?). Just in case it's useful, the only packages exported with extras were VCS ones (installed from Git). Happy to provide more details if needed.
Poetry version:
1.4.2
The text was updated successfully, but these errors were encountered: