4

In the documentation of pybuilder it says that

The default location for main python sources is

src/main/python

This is a convention borrowed from Apache Maven. You can alter this location...

But it is not mentioned anywhere how to change the code location. Thanks

Community
  • 1
  • 1
saloua
  • 2,433
  • 4
  • 27
  • 37
  • did you try os.chdir() ? – DRPK Oct 29 '17 at 18:46
  • 2
    https://pybuilder.github.io/documentation/manual.html#ProjectAttributes https://pybuilder.github.io/documentation/plugins.html#Pythoncore – jordanm Oct 29 '17 at 18:49
  • @DRPK I don't want to change the current directory. But `pybuilder` expects the code to be inside` src/main/python`. – saloua Oct 29 '17 at 18:50
  • 1
    @jordanm Thanks for the link :) The solution is to set the property `dir_source_main_python` `project.set_property('dir_source_main_python', 'new_source_path')` – saloua Oct 29 '17 at 18:54

1 Answers1

2

Thanks to @jordanm 's comment.

The solution is to set the project property dir_source_main_python with the new source location.

@init
def initialize(project):
    project.set_property('dir_source_main_python', 'new_source_path')
saloua
  • 2,433
  • 4
  • 27
  • 37