eclipse-volttron / copier-poetry-volttron-agent

Other
0 stars 4 forks source link

When package name is of the format str.str.str then copier doesn't parse it correctly #54

Open schandrika opened 2 years ago

schandrika commented 2 years ago

Issue: when package name is given as volttron.historian.mysql then copier creates a package directory named "volttron.historian.mysql" and creates a method in agent.py "def volttron.historian.mysql()" Expected behavior:

  1. copier should create the directory tree. For example, in pycharm if you create a new python package "volttron.historian.mysql", it creates 3 directories - volttron, volttron/historian, and volttron/historian/mysql. pycharm creates init.py in all three folders but this is not required. single init.py in the last folder is sufficient
  2. agent.py can have a generic method name instead of "def volttron.historian.mysql()". For example, "def initialize_agent()"
bonicim commented 2 years ago

@schandrika I've modified the method name to a generic name in this working branch to address expected behavior 2.

On expected behavior number 1, @kefeimo how much effort will it take to support the expected behavior 1 as described above? Does it require any changes on the copier program itself?

kefeimo commented 2 years ago

@schandrika @bonicim , for behavior number 1, to clarify

P.S.: is behavior number 1 related to issue Poetry install fails #32?

Pre-mature answer:

schandrika commented 2 years ago
  1. Yes. create package volttron.historian.mysql should create a tree-like folder
  2. The method name change in agent.py - I think Mark took care of it
  3. Ideally init.py is needed only in the leaf level package for python3 but it might be required if using setup.py instead of poetry. Let me confirm this though.
craig8 commented 2 years ago

but since this is specifically a copier repository the init is not necessary