/spin

Developer tool for scientific Python libraries

Primary LanguagePythonBSD 3-Clause "New" or "Revised" LicenseBSD-3-Clause

Developer tool for scientific Python libraries

Configuration

Settings are in your project's pyproject.toml. As an example, see the [tool.devpy] section of this project's pyproject.toml.

The [tool.devpy] section should contain:

package = 'pkg_importname'  # used by pytest
commands = ['devpy.build', 'devpy.test']

Running

python -m devpy

On Unix-like systems, you can also copy the dev.py script to the root of your project directory, and launch it as:

./dev.py

Built-in commands

  build    ๐Ÿ”ง Build package with Meson/ninja
  ipython  ๐Ÿ’ป Launch IPython shell with PYTHONPATH set
  python   ๐Ÿ Launch Python shell with PYTHONPATH set
  shell    ๐Ÿ’ป Launch shell with PYTHONPATH set
  test     ๐Ÿ”ง Run tests

๐Ÿงช Custom commands

devpy can invoke custom commands. These commands define their own arguments, and they also have access to the pyproject.toml file for further configuration.

See, e.g., the example custom command.

Add custom commands to the commands variable in the [tool.devpy] section of pyproject.toml as follows:

commands = [..., 'custom/__init__.py:example']

Here, the command is stored in custom/__init__.py, and the function is named example.