Skip to content

Dev tips

QLutz edited this page Mar 15, 2022 · 10 revisions

Here we give tips and nearly step-by-step instructions for contributing to scikit-network using PyCharm.

Installation

To install the current sknetwork package (i.e. the one being developed on your machine and not yet released), move to your local folder for scikit-network and run pip install .. Note that this installs scikit-network as you would from PyPI and thus replaces any previous install. You can always remove that version using pip uninstall scikit-network.

If you have any "Permission denied errors" on Windows at some point. Have a look at this.

Setting up your environment

To have a clean setup, you might want to setup a virtual environment for the package. In PyCharm, go to the Preferences/Parameters > Project Interpreter > click on the wheel > Add > create an env (Python 3.7 and up). Remember to install the requirements afterwards (pip install -r requirements_dev.txt).

Test configuration

A clean way to launch your tests is through a PyCharm configuration: in the 'Run' menu, go to 'Edit configurations' and add a Pytest task (click the '+' icon in the top-left corner > Python tests > pytest).

Remember to add '--doctest-modules' in the additional arguments for the doctests to run.

If you want to make a configuration for a specific submodule, select 'Module Name' in target and enter the submodule name underneath (e.g. sknetwork.data)

You can then run the configuration by selecting it in the field next to the green play button and pressing that same button.

Doc configuration

A clean way to build the doc is through a PyCharm configuration: in the 'Run' menu, go to 'Edit configurations' and add a Pytest task (click the '+' icon in the top-left corner > Python doc > sphinx task). Enter the following arguments:

  • Command: html

  • Input: path/to/scikit-network/docs

  • Output: path/to/scikit-network/build/

You can then run the configuration by selecting it in the field next to the green play button and pressing that same button.