Skip to content

Commit 5acf713

Browse files
cschulkuchenb
authored andcommitted
updated local installation doc to reflect whole installation process
1 parent d40de07 commit 5acf713

File tree

1 file changed

+92
-20
lines changed

1 file changed

+92
-20
lines changed

docs/install_local.md

+92-20
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,116 @@
11
# Local Installation
22

3-
- Change directory into your newly created project if not already there. Your
4-
current directory should be the same as this README.txt file and setup.py.
3+
Install dependencies, e.g. via [brew](https://brew.sh/).
54

6-
cd datameta
5+
```
6+
brew install postgresql memcached libmemcached npm
7+
```
78

8-
- Create a Python virtual environment, if not already created.
9+
Register postgresql as a service
910

10-
python3 -m venv env
11+
```
12+
brew services start postgresql
13+
```
1114

12-
- Upgrade packaging tools, if necessary.
1315

14-
env/bin/pip install --upgrade pip setuptools
16+
Clone this repository:
17+
```
18+
git clone https://github.com/ghga-de/datameta.git
19+
```
1520

16-
- Install NPM dependencies
21+
Change directory into your newly created project if not already there. Your
22+
current directory should be the same as this README.md file and setup.py.
1723

18-
npm install --prefix datameta/static/
24+
```
25+
cd datameta
26+
```
1927

20-
- Install the project in editable mode with its testing requirements.
28+
Create a Python virtual environment, if not already created.
2129

22-
env/bin/pip install -e ".[testing]"
30+
This can be done via `venv`:
2331

24-
- Initialize the database using Alembic.
32+
```
33+
python3 -m venv <environment_name>
34+
```
2535

26-
env/bin/alembic -c development.ini upgrade head
36+
or `conda`:
2737

28-
- Load default data into the database using a script. Change the initial user and group information to your requirements.
38+
```
39+
conda create -y -n <environment_name> 'python>3'
40+
```
2941

30-
env/bin/initialize_datameta_db \
31-
-c development.ini \
42+
Activate the environment
43+
44+
With `venv` ([docs](https://docs.python.org/3/tutorial/venv.html)):
45+
46+
```
47+
source <path/to/environment>/bin/activate
48+
```
49+
50+
With conda
51+
52+
```
53+
conda activate <environment_name>
54+
```
55+
56+
Upgrade packaging tools, if necessary.
57+
58+
```
59+
pip install --upgrade pip setuptools
60+
```
61+
62+
Install NPM dependencies
63+
64+
```
65+
npm install --prefix datameta/static/
66+
```
67+
68+
Install the project in editable mode with its testing requirements.
69+
70+
```
71+
pip install -e ".[testing]"
72+
```
73+
74+
Create a postgresql database, then add the path to the database to the `development.ini` found in `datameta/config`,
75+
e.g. `sqlalchemy.url = postgresql://localhost/<dbname>`. A copy of the `development.ini` can be placed at an arbitrary location
76+
named `/path/to/config/` in the following.
77+
78+
```
79+
createdb <dbname>
80+
```
81+
82+
Initialize the database using Alembic.
83+
84+
```
85+
<path/to/environment>/bin/alembic -c <path/to/config>/development.ini upgrade head
86+
```
87+
88+
Load default data into the database using a script. Change the initial user and group information to your requirements.
89+
90+
```
91+
<path/to/environment>/bin/initialize_datameta_db \
92+
-c <path/to/config>/development.ini \
3293
--initial-user-fullname "First User Fullname" \
3394
--initial-user-email "[email protected]" \
3495
--initial-user-pass "initialPassword" \
3596
--initial-group "My Organization"
97+
```
98+
99+
Run your project's tests.
100+
101+
```
102+
<path/to/environment>/bin/pytest
103+
```
36104

37-
- Run your project's tests.
105+
Start the `memcached` process.
38106

39-
env/bin/pytest
107+
```
108+
nohup memcached &
109+
```
40110

41-
- Run your project.
111+
Run your project.
42112

43-
env/bin/pserve development.ini
113+
```
114+
<path/to/environment>/bin/pserve /path/to/config/development.ini
115+
```
44116

0 commit comments

Comments
 (0)