How to locally develop a python package?

后端 未结 5 479
鱼传尺愫
鱼传尺愫 2021-01-30 18:15

I\'m trying to make changes to an existing python module, and then test it locally. What\'s the best way to do this?

I cloned the github module and made changes, but I\'

5条回答
  •  说谎
    说谎 (楼主)
    2021-01-30 18:42

    The easiest way to do such testing would be to create a virtual environment, and then installing the package in development mode.

    Assuming you are on Linux it would look something like this.

    $ virtualenv dev_env
    $ source dev_env/bin/activate
    $ cd ~/project_folder
    $ pip install -e .
    

    This workflow would not overwrite the already installed package on your system. Another maybe simpler alternatives would to just use an IDE that handles most of this for you, e.g. PyCharm.

提交回复
热议问题