-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: recommend installation via uv for most users
- Loading branch information
1 parent
b3f8d52
commit 86c2553
Showing
5 changed files
with
95 additions
and
71 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,50 +8,84 @@ Join the [Halmos Telegram Group][chat] for any inquiries or further discussions. | |
|
||
## Development Setup | ||
|
||
If you want to submit a pull request, fork the repository: | ||
Clone or fork the repository: | ||
|
||
```sh | ||
# if you want to submit a pull request, fork the repository: | ||
gh repo fork a16z/halmos | ||
``` | ||
|
||
Or, if you just want to develop locally, clone it: | ||
|
||
```sh | ||
# Or, if you just want to develop locally, clone it: | ||
git clone [email protected]:a16z/halmos.git | ||
|
||
# navigate to the project directory | ||
cd halmos | ||
``` | ||
|
||
Create and activate a virtual environment: | ||
**Recommended**: set up the development environment using [uv](https://docs.astral.sh/uv/): | ||
|
||
```sh | ||
python3.12 -m venv .venv && source .venv/bin/activate | ||
# install uv | ||
curl -LsSf https://astral.sh/uv/install.sh | sh | ||
|
||
# this does a lot of things: | ||
# - install a suitable python version if one is not found | ||
# - create a virtual environment in `.venv` | ||
# - install the main dependencies | ||
# - install the development dependencies | ||
# - generates a `uv.lock` file | ||
uv sync --extra dev | ||
|
||
# install and run the pre-commit hooks | ||
uv run pre-commit install | ||
uv run pre-commit run --all-files | ||
|
||
# make changes to halmos, then run it with: | ||
uv run halmos | ||
|
||
# run the tests with: | ||
uv run pytest | ||
|
||
# add a dependency to the project: | ||
uv add <dependency> | ||
|
||
# remove a dependency from the project: | ||
uv remove <dependency> | ||
|
||
# update a dependency to the latest version: | ||
uv lock --upgrade-package <dependency> | ||
|
||
# to manually update the environment and activate it: | ||
uv sync | ||
source .venv/bin/activate | ||
``` | ||
|
||
Install the dependencies: | ||
Alternatively, you can manage the python version and the virtual environment manually using `pip` (not recommended for most users): | ||
|
||
```sh | ||
# install halmos and its runtime dependencies | ||
# create and activate a virtual environment with a suitable python version | ||
python3.12 -m venv .venv && source .venv/bin/activate | ||
|
||
# install halmos and its runtime dependencies in editable mode | ||
python -m pip install -e . | ||
|
||
# install the dev dependencies | ||
python -m pip install -r requirements-dev.txt | ||
``` | ||
|
||
Install and run the git hook scripts (this is optional but will make sure that your PR will follow the style convention): | ||
|
||
```sh | ||
# install and run the pre-commit hooks | ||
pre-commit install | ||
pre-commit run --all-files | ||
``` | ||
|
||
|
||
## Coding Style | ||
|
||
We recommend enabling the [black] formatter in your editor, but you can run it manually if needed: | ||
We recommend enabling the [ruff] formatter in your editor, but you can run it manually if needed: | ||
|
||
```sh | ||
python -m black src/ | ||
python -m ruff check src/ | ||
``` | ||
|
||
[black]: <https://black.readthedocs.io/en/stable/> | ||
[ruff]: <https://docs.astral.sh/ruff/> | ||
|
||
## GitHub Codespace | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters