How to properly package + make it simple / in line with good practices for my colleagues

  Kiến thức lập trình

I have 3 python projects, each is made of 3 files:

  • main.py (execution)
  • functions.py (functions)
  • config.py (path variables)

These scripts can run as standalones but I now have a project where I’d need to run the 3 of these altogether (process and refresh data from 3 specific sources).

First question: any resource to share / guidance on how to build a meta script / package this?

  • do I just duplicate the scripts (main.py, functions.py, config.py) in the project repository and call them from here?
  • do I just create a project repository, create a main.py and call the scripts from the main.py?
  • any other approach I should consider?

My colleague needs to run these scripts when I’m away. As of now, he would have to adjust each config.py for it successfully run.

Second question: any resource to share / guidance on how to approach this issue?

  • should I have a “meta” config file with all of the details from each config file (so he can adjust a single config file instead of 3)?
  • is it OK / common to have the 3 config files and have my colleague adjust each of these?
  • any other approach I should consider?

I am looking to understand how experienced developers deal with these kind of situations, what’s best for collaborative work, etc..

PS: is that OK to call a script config.py or should I consider another name (typically thats where I have my path variables)

Thanks for the help,

I am trying to research a bit on the topic, but ChatGPT feedback were disappointing and I am not sure I use the right keywords to explain my problem / get hints regarding the appropriate approach.

LEAVE A COMMENT