Setup Developer’s environment#
First create your own fork of huracanpy from the github page. “Create new fork” from the dropdown. Then clone your repository e.g.
git clone /https://github.com/{your-username}/huracanpy.git
To install your copy locally run
pip install -e .[dev, docs]
The “[dev]” argument installs the following optional packages that are useful for contributing to development
pytest
We use pytest to run automated tests. If you add a new feature, it would be good to also add tests to check that feature is working and keeps working in the future. You can also run
pytestfrom the top level directory of the package to check that your changes haven’t broken anything.ruff
We use [ruff](<https://docs.astral.sh/ruff/) to automatically keep the style of the code consistent, so we don’t have to worry about it.
To check that your code passes you can run
ruff checkandruff format --check.To automatically fix differences run
ruff check --fixandruff format.pre-commit
You can use pre-commit to automate the formatting done by ruff.
After running
pre-commit installat the top level directory, any future git commits will automatically run the ruff formatting on any files you have changes.
The “[docs]” argument installs extra dependencies needed to build the documentation locally. If you are adding or modifying functions it will probably be useful to also update the documentation. For further instructions see this page.