python-dependency-injector
python-dependency-injector copied to clipboard
The yaml config inject does not work in egg (scrapyd)
we are using the Dependency injector in Scrapy and deploy the egg to scrapyd (by scrapy-client)
the egg already include the yaml config, but base on our test, the yaml config did not load, the env config load successfully.
we are referenced by the multiple container example: https://python-dependency-injector.ets-labs.org/examples/application-multiple-containers.html
class Application(containers.DeclarativeContainer):
config = providers.Configuration(yaml_files=["config.yml"])
we want to try the other way base on the document:
https://python-dependency-injector.ets-labs.org/providers/configuration.html#loading-from-a-yaml-file
application = Application()
application.config.from_yaml("./config.yml")
AttributeError: 'DynamicContainer' object has no attribute 'config'
could you help whether the yaml file config injection support egg?
Base on the Scrapy-client doc about static file include: https://github.com/scrapy/scrapyd-client#including-static-files
is it possible the Dependency-inject yaml file path is not compatible with the egg?
I check the egg files by unzip. the yaml file is located same path with source code