-
Notifications
You must be signed in to change notification settings - Fork 40
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
Support for setuptools.dynamic when using pip_install_from_pyproject #2748
Comments
Could you just point |
Thanks for the suggestion, in similar spirit as a workaround I copied all the dependencies over to However, as a feature request, it would be great to be able to use |
I was looking at how modal parses the pyproject.toml file and I noticed modal is using the Using from setuptools.config.pyprojecttoml import read_configuration
from pathlib import Path
import json
# Parse config
config = read_configuration(filepath=Path("pyproject.toml"))
# Print parsed config
print(f"{json.dumps(config, indent=2)}")
# Print the correct dependencies from my `env/requirements.txt` defined in the pyproject.toml above
print(config["project"]["dependencies"])
# Prints the correct dependencies from the `env/dev_requirements.txt` defined in the pyproject.toml above
print(config["project"]["optional_dependencies"]["dev"]) However, that being said, you might be using a plain toml parser for a reason instead of setuptools? |
I tried a small draft PR here: #2753 (untested) Not sure what your contributor guidelines are, and how to test this properly. |
Thanks for the suggested PR. We'll need to think about it a little bit. In your case, is using When dynamic dependencies have come up in the past, it's often been the case that our lack of support for them is not actually the main blocker to things working the way users expect. Rather, when projects specify dynamic dependencies, it's often because they want the dependencies to vary depending on the state of the local system (machine arch, etc.). But with the Modal Image configuration, you would actually want the dynamic dependencies to reflect the state of the remote system. Making that work as expected would would require a much deeper change to the Image specification process. BTW in your specific case I'm still not understanding why it was necessary to duplicate your requirements in an |
I don't think it matters that much, however I did notice that |
Fair enough. Just treat the PR as a suggestion. I think I can work around it for now.
Yes, you currently don't support using |
Sorry to be clear, my question, my question was whether your suggestion will work for people who have |
In any case, the local / remote distinction is probably a more challenging problem for supporting dynamic dependencies. |
I have a local package configured by a
pyproject.toml
file that looks similar to:Note that I'm not using a
[project.dependencies]
section. However my dependencies are defined asdynamic
, and I'm using[tool.setuptools.dynamic]
to define where to get the dependencies dynamically (from a requirements.txt file)However, when creating an image and installing this package using
pip_install_from_pyproject
modal complains that there isNo [project.dependencies] section in pyproject.toml file
:I think this error originates here.
I'm using:
Btw, this local package builds just fine locally using either pip or uv.
The text was updated successfully, but these errors were encountered: