jython/python for McV in git
Posted: Wed Feb 07, 2018 4:46 pm
I have quite a bit of McV jython code, some of which doubles as independent python code. I need some advice on rethinking the git repository.
The code was developed as part of a project, initially is was in a project repository sub-directory, to which, I would soft link from my McIDAS-V/python directory to the project repo subdirectory. This caused problems when the link target would disappear. I decided it would be best to sparse-checkout the jython code into the McIDAS-V/python directory. At that point, I found that using sub-directories did not work. Unfortunately, I did not find a way to sparse-checkout a git repo sub-directory without inheriting the directory tree. Therefore, I put all the jython code in the top level of git project repository, which I dislike immensely.
I will need some of the code that I use regularly in my jython library in another project which would probably just use python 2.7 or higher. In that case, I usually add a "if __name__ == '__main__’:”
In that location, I usually initialize a logger and argparse. In this case, McV will periodically start a new logger and this is not a great thing.
Therefore, I am thinking that I probably need to write independent python code initializes the logger and argparse and calls the needed routines, which could then be used in either McV or python. I am thinking I should probably separate my McIDAS-V jython code into a different repository and then fork(???) the necessary pieces into the python project repository?
What would you do in this situation?
Thanks,
Joleen
The code was developed as part of a project, initially is was in a project repository sub-directory, to which, I would soft link from my McIDAS-V/python directory to the project repo subdirectory. This caused problems when the link target would disappear. I decided it would be best to sparse-checkout the jython code into the McIDAS-V/python directory. At that point, I found that using sub-directories did not work. Unfortunately, I did not find a way to sparse-checkout a git repo sub-directory without inheriting the directory tree. Therefore, I put all the jython code in the top level of git project repository, which I dislike immensely.
I will need some of the code that I use regularly in my jython library in another project which would probably just use python 2.7 or higher. In that case, I usually add a "if __name__ == '__main__’:”
In that location, I usually initialize a logger and argparse. In this case, McV will periodically start a new logger and this is not a great thing.
Therefore, I am thinking that I probably need to write independent python code initializes the logger and argparse and calls the needed routines, which could then be used in either McV or python. I am thinking I should probably separate my McIDAS-V jython code into a different repository and then fork(???) the necessary pieces into the python project repository?
What would you do in this situation?
Thanks,
Joleen