How to configure pybuilder?

How can I change the configuration in pybuilder and how does the configuration work in pybuilder ?.

How to find out possible configuration values ​​and their default values, how to override or change them for each project / for each module / in commmmandline / in settings files? What settings files?

+4
source share
1 answer

1) Find a way to initialize

It is very easy to reconfigure an existing project. Visit the file build.pyin the root directory of your project and make sure that it has this code:

from pybuilder.core import init

as well as this (without dots):

@init
def initialize(project):
  ... 

2) Property example

properties. : http://pybuilder.imtqy.com/documentation/plugins.html -, .

python, :

http://pybuilder.imtqy.com/documentation/plugins.html#Pythondeployment

, :

project.set_property('unittest_module_glob', '*_unittest')

unittest_module_glob unittest '* _unittest'.

3)

attributes . , , initialize:

project.version = "0.1.14"

4)

.\build.py :

from pybuilder.core import use_plugin
from pybuilder.core import init

use_plugin("python.core")
use_plugin("python.unittest")

name = "myfirstproject"
default_task = "publish"

@init
def initialize(project):
  project.version = "0.1.14"
  project.set_property('unittest_module_glob', '*_unittest')

5)

:

$ pyb -P unittest_module_glob="*_unittest"

6)

:

http://pybuilder.imtqy.com/documentation/manual.html#Project-specificconfiguration

+5

Source: https://habr.com/ru/post/1533061/


All Articles