-
Notifications
You must be signed in to change notification settings - Fork 8
Build from Source
raydar is written in Python and Javascript. While prebuilt wheels are provided for end users, it is also straightforward to build raydar from either the Python source distribution or the GitHub repository.
- Table of Contents
- Make commands
- Prerequisites
- Clone
- Install NodeJS
- Install Python dependencies
- Build
- Lint and Autoformat
- Testing
As a convenience, raydar uses a Makefile for commonly used commands. You can print the main available commands by running make with no arguments
> make
build build the library
clean clean the repository
fix run autofixers
install install library
lint run lints
test run the testsraydar has a few system-level dependencies which you can install from your machine package manager. Other package managers like conda, nix, etc, should also work fine.
Clone the repo with:
git clone https://github.com/Point72/raydar.git
cd raydarFollow the instructions for installing NodeJS for your system. Once installed, you can install yarn with:
npm instal --global yarnPython build and develop dependencies are specified in the pyproject.toml, but you can manually install them:
make requirements
# or
# python -m pip install toml
# python -m pip install `python -c 'import toml; c = toml.load("pyproject.toml"); print("\n".join(c["build-system"]["requires"]))'`
# python -m pip install `python -c 'import toml; c = toml.load("pyproject.toml"); print("\n".join(c["project"]["optional-dependencies"]["develop"]))'`Note that these dependencies would otherwise be installed normally as part of PEP517 / PEP518.
Build the python project in the usual manner:
make build
# on aarch64 linux, comment the above command and use this instead
# VCPKG_FORCE_SYSTEM_BINARIES=1 make build
# or
# python setup.py build build_ext --inplaceraydar has linting and auto formatting.
| Language | Linter | Autoformatter | Description |
|---|---|---|---|
| Python | ruff |
ruff |
Style |
| Python | isort |
isort |
Imports |
| JavaScript | prettier |
prettier |
Style |
| Markdown | prettier |
prettier |
Style |
Python Linting
make lintpy
# or
# python -m isort --check raydar/ setup.py
# python -m ruff check raydar/ setup.py
# python -m ruff format --check raydar/ setup.pyPython Autoformatting
make fixpy
# or
# python -m isort raydar/ setup.py
# python -m ruff format raydar/ setup.pyJavaScript Linting
make lintjs
# or
# cd js; yarn lintJavaScript Autoformatting
make fixjs
# or
# cd js; yarn fixDocumentation Linting
We use prettier for our Markdown linting, so follow the above docs.
raydar has both Python and JavaScript tests. The bulk of the functionality is tested in Python, which can be run via pytest. First, install the Python development dependencies with
make developPython
make testpy
# or
# python -m pytest -v raydar/tests --junitxml=junit.xml --cov=raydar --cov-report=xml:.coverage.xml --cov-branch --cov-fail-under=1 --cov-report term-missingJavaScript
make testjs
# or
# cd js; yarn testThis wiki is autogenerated. To made updates, open a PR against the original source file in docs/wiki.
Get Started
Developer Guide