3
3
4
4
### Installation ###
5
5
6
- ``` bash
6
+ ``` commandline
7
7
git clone https://github.com/TantorLabs/pg_anon.git
8
8
cd pg_anon
9
9
@@ -12,7 +12,7 @@ pip3 install -r requirements.txt
12
12
```
13
13
14
14
You must have a local database installed to test the functionality of ` pg_anon ` . Example of installing PostgreSQL on ubuntu:
15
- ``` bash
15
+ ``` commandline
16
16
echo "deb [arch=amd64] http://apt.postgresql.org/pub/repos/apt focal-pgdg main" >> /etc/apt/sources.list.d/pgdg.list
17
17
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
18
18
apt update && apt --yes remove postgresql\*
@@ -47,7 +47,7 @@ python3 test/full_test.py -v PGAnonValidateUnitTest
47
47
```
48
48
49
49
You can override test database connection settings as follows:
50
- ``` bash
50
+ ``` commandline
51
51
set TEST_DB_USER=anon_test_user
52
52
set TEST_DB_USER_PASSWORD=mYy5RexGsZ
53
53
set TEST_DB_HOST=127.0.0.1
@@ -61,13 +61,13 @@ set TEST_TARGET_DB=test_target_db
61
61
62
62
If tests raised error like:
63
63
64
- ``` bash
64
+ ``` commandline
65
65
asyncpg.exceptions.ExternalRoutineError: program "gzip > ... *.dat.gz" failed
66
66
```
67
67
68
68
in this case needs to configure permissions:
69
69
70
- ``` bash
70
+ ``` commandline
71
71
usermod -a -G current_user_name postgres
72
72
chmod -R g+rw /home/current_user_name/Desktop/pg_anon
73
73
chmod g+x /home/current_user_name/Desktop/pg_anon/output/test
@@ -99,7 +99,7 @@ Input: source database, empty target database, dictionary
99
99
100
100
Task: copy full structure of DB and all data using dictionary
101
101
102
- ``` bash
102
+ ``` commandline
103
103
# Common options in any mode:
104
104
# --debug (default false)
105
105
# --verbose = [info, debug, error] (default info)
@@ -266,26 +266,32 @@ dependency management tool for managing dependencies and creating packages.
266
266
For [ adding new dependencies] ( https://python-poetry.org/docs/managing-dependencies/ )
267
267
install Poetry and run command:
268
268
269
- ``` bash
269
+ ``` commandline
270
270
poetry add <package_name>
271
271
```
272
272
For locking the dependencies use command:
273
273
274
- ``` bash
274
+ ``` commandline
275
275
poetry lock --no-update
276
276
```
277
277
278
278
Additionally, [ export] ( https://python-poetry.org/docs/cli/#export )
279
279
the latest packages to * requirements.txt* using poetry export plugin:
280
280
281
- ``` bash
281
+ ``` commandline
282
282
poetry export -f requirements.txt --output requirements.txt
283
283
```
284
284
285
285
### Build package
286
286
287
287
For [ building] ( https://python-poetry.org/docs/libraries/#packaging ) the package use command:
288
288
289
- ``` bash
289
+ ``` commandline
290
290
poetry build
291
291
```
292
+
293
+ Additionally package could be build package using setuptools:
294
+
295
+ ``` commandline
296
+ python3 setup.py sdist
297
+ ```
0 commit comments