Skip to content

Commit 9960640

Browse files
authored
Update stand-alone dev setup docs. (#4326)
Fixes #4242
1 parent a972eea commit 9960640

File tree

5 files changed

+143
-92
lines changed

5 files changed

+143
-92
lines changed

docs/getting-started/contributing/contribute-to-documentation.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Contribute to Documentation
1+
# Contribute to documentation
22

33
Most of the work on the Hypha User Guide takes place on the [project’s GitHub repository](https://github.com/HyphaApp/hypha/). To get started, check out the list of [open issues](https://github.com/HyphaApp/hypha/issues) and pull requests. By contributing to the Hypha User Guide, you’re expected to follow the [Code of Conduct](./code-of-conduct.md).
44

@@ -19,7 +19,7 @@ This project consists of several distinct documentation types with specific purp
1919
Provides step-by-step instructions on how to set up a local instance of Hypha.
2020
> Write technical documentation with a new developer in mind. Create a quickstart doc wherever possible. What is the bare minimum information that a user needs to get started with the feature that you are documenting? Start there.
2121
22-
### User Guides
22+
### User guides
2323

2424
Guides are focused on accomplishing a specific task and can assume some level of prerequisite knowledge. There may be multiple approaches to accomplishing a task, and we welcome your input.
2525

docs/getting-started/contributing/developer-tips.md

+69-11
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Hypha developer tips
1+
# Developer tips
22

33
## Git configuration and commands
44

@@ -24,11 +24,71 @@ To update the feature branch on GitHub you then need to do a forced push. Instea
2424
git push --force-with-lease
2525
```
2626

27+
## Coding style and linting in pre-commit hook
28+
29+
Hypha's coding style is enforced by ruff, stylelint and biome.
30+
31+
Install pre-commit to auto-format the code before each commit:
32+
33+
```shell
34+
pre-commit install
35+
```
36+
37+
If you want to check all files without committing you can run:
38+
39+
```shell
40+
pre-commit run --all-files
41+
```
42+
43+
The pre-commit hook also updates the requirements files for you, see next section about uv.
44+
45+
46+
## Make best use of uv
47+
48+
For development [uv](https://docs.astral.sh/uv/) is a Hypha requirement. It is fast and easy to use.
49+
50+
uv is used to:
51+
52+
* Setup the virtual environment
53+
* Install python dependencies.
54+
* Add and remove python packages.
55+
* Update python packages.
56+
* Generate the requirements files.
57+
58+
See also [Stand alone development setup](/setup/deployment/development/stand-alone/)
59+
60+
### Add and remove packages with uv
61+
62+
All python requirements are listed in `pyproject.toml`.
63+
64+
To add a package:
65+
66+
```shell
67+
uv add django-htmx
68+
```
69+
70+
To remove a package:
71+
72+
```shell
73+
uv remove django-select2
74+
```
75+
76+
After adding or removing a packages run this to update `uv.lock`.
77+
78+
```shell
79+
uv sync
80+
```
81+
82+
When you attempt to commit the pre-commit hook will update the requirements files for you.
83+
84+
The requirements files exist so you do not need uv for deployment.
85+
86+
2787
## Postgres snapshots/restore
2888

2989
Hypha dev requirements contain the [dslr](https://github.com/mixxorz/DSLR) tool. Use this for fast snapshots and restores of the postgres database.
3090

31-
Perfekt when testing migrations and other times when you need to reset the database or switch between databases.
91+
Perfect when testing migrations and other times when you need to reset the database or switch between databases.
3292

3393
Take a snapshot, you can have as many as you like.
3494

@@ -56,23 +116,21 @@ dslr list
56116

57117
## Commands in Makefile
58118

59-
This is the one stop place to find commands for runiing test, build resources and docs, linting and code style checks/fixes.
60-
61-
## Coding style and linting in pre-commit hook
62-
63-
Hypha's coding style is enforced by ruff and prettier and comes pre-configured with prettier.
119+
This is the one stop place to find commands for running test, build resources and docs, linting and code style checks/fixes.
64120

65-
Install pre-commit to auto-format the code before each commit:
121+
The one command you will be running the most is:
66122

67123
```shell
68-
pre-commit install
124+
make serve
69125
```
70126

127+
This command runs `npm watch` to keep the front end updates and runs development servers for both Hypha app and the Hypha docs.
128+
71129
## Editor extensions
72130

73-
If you editor does not a Language Server Protocol (LSP) preinstalled make sure to add the plugin for it. Then add "LSP-ruff" for a fast Python linter and code transformation tool.
131+
If you editor does not have a Language Server Protocol (LSP) preinstalled make sure to add the plugin for it. Then add "LSP-ruff" for a fast Python linter and code transformation tool.
74132

75-
Your editor most likely have plugins for the other languages Hypha uses as well, css/scss, yaml and html. We recoment to install them as well.
133+
Your editor most likely have plugins for the other languages Hypha uses as well, css/scss, yaml and html. We recommend to install them as well.
76134

77135
## Shell configuration
78136

docs/setup/administrators/cron-jobs.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
# Possible Cron Commands
1+
# Possible cron commands
22

33
Hypha comes stock with management commands that can be utilized in tandem with a job scheduler to automate specific tasks
44

5-
## Account Cleanup
5+
## Account cleanup
66

77
Accounts that haven't been logged into in 5 months can be marked as inactive with the following command:
88

99
```shell
1010
python3 manage.py accounts_cleanup
1111
```
1212

13-
## Drafts Cleanup
13+
## Drafts cleanup
1414

1515
Drafts that haven't been modified in a specified time (in days) can be deleted with the following command:
1616

@@ -26,4 +26,4 @@ Example: to delete all drafts that haven't been modified in a year without a con
2626

2727
```shell
2828
python3 manage.py drafts_cleanup 365 --noinput
29-
```
29+
```

0 commit comments

Comments
 (0)