Something does not work and you wish to fix it? Are you curious to see how it works? For development:
# First install Nek5000
git clone https://github.com/snek5000/Nek5000.git
export NEK_SOURCE_ROOT=$PWD/Nek5000
git clone https://github.com/snek5000/snek5000.git
# Activate paths: Start here. Always!
cd snek5000
source activate.sh
Now you should setup a Python environment. There are two ways to do this (and it has to be done only once):
-
Using
venv
python -m venv venv source venv/bin/activate
-
Using
conda
conda env create -n env-snek5000 conda activate env-snek5000
Finally, to install in development mode:
pip install pip-tools nox
nox -s pip-sync
-
Editor: Use an editor which supports EditorConfig
-
Style guide: For Python code,
black
,isort
andflake8
are used to check and lint. Installingpre-commit
would enforce the style automatically as a git hook.pre-commit install
-
Branching model: The development uses branches and pull-requests for experimental features. You may find the following git branches when you clone
snek5000
:master
: main branchfix/...
,enh/...
: feature branches
Executing the following command would configure git to work with submodules easily and ensures consistency:
-
Testing: Run
pytest
from the top-level directory. The test-cases can be found undertests/
directory. To run the slow tests too executepytest --runslow
. -
Debugging: Set the environment variable:
export SNEK_DEBUG=true
to activate debugging logs and longer tests.
Vim users could benefit by setting:
set secure exrc
This sources the .exrc
file which comes along with the repository and enables syntax
highlighting for file extensions used in Nek5000
.