yhttp-dbmanager 2.7.0__tar.gz → 2.8.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (21) hide show
  1. {yhttp_dbmanager-2.7.0/yhttp_dbmanager.egg-info → yhttp_dbmanager-2.8.0}/PKG-INFO +66 -6
  2. yhttp_dbmanager-2.8.0/README.md +101 -0
  3. yhttp_dbmanager-2.8.0/tests/test_dburi.py +50 -0
  4. {yhttp_dbmanager-2.7.0 → yhttp_dbmanager-2.8.0}/yhttp/ext/dbmanager/__init__.py +1 -1
  5. {yhttp_dbmanager-2.7.0 → yhttp_dbmanager-2.8.0/yhttp_dbmanager.egg-info}/PKG-INFO +66 -6
  6. yhttp_dbmanager-2.7.0/README.md +0 -41
  7. yhttp_dbmanager-2.7.0/tests/test_dburi.py +0 -20
  8. {yhttp_dbmanager-2.7.0 → yhttp_dbmanager-2.8.0}/LICENSE +0 -0
  9. {yhttp_dbmanager-2.7.0 → yhttp_dbmanager-2.8.0}/setup.cfg +0 -0
  10. {yhttp_dbmanager-2.7.0 → yhttp_dbmanager-2.8.0}/setup.py +0 -0
  11. {yhttp_dbmanager-2.7.0 → yhttp_dbmanager-2.8.0}/tests/test_cli.py +0 -0
  12. {yhttp_dbmanager-2.7.0 → yhttp_dbmanager-2.8.0}/tests/test_dbmanager.py +0 -0
  13. {yhttp_dbmanager-2.7.0 → yhttp_dbmanager-2.8.0}/tests/test_install.py +0 -0
  14. {yhttp_dbmanager-2.7.0 → yhttp_dbmanager-2.8.0}/yhttp/ext/dbmanager/cli.py +0 -0
  15. {yhttp_dbmanager-2.7.0 → yhttp_dbmanager-2.8.0}/yhttp/ext/dbmanager/dbmanager.py +0 -0
  16. {yhttp_dbmanager-2.7.0 → yhttp_dbmanager-2.8.0}/yhttp/ext/dbmanager/install.py +0 -0
  17. {yhttp_dbmanager-2.7.0 → yhttp_dbmanager-2.8.0}/yhttp/ext/dbmanager/uri.py +0 -0
  18. {yhttp_dbmanager-2.7.0 → yhttp_dbmanager-2.8.0}/yhttp_dbmanager.egg-info/SOURCES.txt +0 -0
  19. {yhttp_dbmanager-2.7.0 → yhttp_dbmanager-2.8.0}/yhttp_dbmanager.egg-info/dependency_links.txt +0 -0
  20. {yhttp_dbmanager-2.7.0 → yhttp_dbmanager-2.8.0}/yhttp_dbmanager.egg-info/requires.txt +0 -0
  21. {yhttp_dbmanager-2.7.0 → yhttp_dbmanager-2.8.0}/yhttp_dbmanager.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: yhttp-dbmanager
3
- Version: 2.7.0
3
+ Version: 2.8.0
4
4
  Summary: Database manager command line interface and API for yhttp.
5
5
  Home-page: http://github.com/yhttp/yhttp-dbmanager
6
6
  Author: Vahid Mardani
@@ -26,44 +26,104 @@ Requires-Dist: yhttp<5,>=3.5.2
26
26
  Requires-Dist: dbmanager
27
27
  Requires-Dist: psycopg2
28
28
 
29
- # Dependencies
30
- install `postgreslq` brefore use of this project.
29
+ # yhttp-dbmanager
31
30
 
31
+ A `yhttp` extension to create and remove database(s) using command line and
32
+ API.
32
33
 
33
34
  ## Contribution
34
35
 
36
+ ### Dependencies
37
+ Install `postgreslq` brefore use of this project.
38
+ ```bash
39
+ apt install postgresql
40
+ ```
41
+
35
42
  ### Prepare
36
43
 
37
- Create and grant `postgres` role with `createdb` permission:
44
+ Create and grant the `postgresql` role with `createdb` permission to
45
+ authenticate the current `unix` user within `postgresql` using the peer
46
+ authentication.
38
47
  ```bash
39
48
  echo "CREATE USER ${USER} WITH CREATEDB" | sudo -u postgres psql
40
49
  # Or
41
50
  echo "ALTER USER ${USER} CREATEDB" | sudo -u postgres psql
42
51
  ```
43
52
 
53
+ ### Virtualenv
54
+
44
55
  Create virtual environment:
45
56
  ```bash
46
57
  make venv
47
58
  ```
48
59
 
60
+ Delete virtual environment:
61
+ ```bash
62
+ make venv-delete
63
+ ```
64
+
65
+ Activate the virtual environment:
66
+ ```bash
67
+ source ./activate.sh
68
+ ```
69
+
70
+
71
+ ### Install (editable mode)
49
72
  Install this project as editable mode and all other development dependencies:
50
73
  ```bash
51
74
  make env
52
75
  ```
53
76
 
77
+
54
78
  ### Tests
55
79
  Execute all tests:
56
80
  ```bash
57
81
  make test
58
82
  ```
59
83
 
84
+ Execute specific test(s) using wildcard:
85
+ ```bash
86
+ make test U=db*
87
+ ```
88
+
60
89
  Execute all tests and report coverage result:
61
90
  ```bash
62
91
  make cover
63
92
  make cover-html
64
93
  ```
65
94
 
66
- ### Virtualenv
95
+
96
+ ### Distribution
97
+ Execute these commands to create `Python`'s standard distribution packages
98
+ at `dist` directory:
67
99
  ```bash
68
- source ./activate.sh
100
+ make sdist
101
+ make wheel
102
+ ```
103
+
104
+ Or
105
+ ```bash
106
+ make dist
107
+ ```
108
+ to create both `sdidst` and `wheel` packages.
109
+
110
+
111
+ ### Clean build directory
112
+ Execute:
113
+ ```bash
114
+ make clean
115
+ ```
116
+ to clean-up previous dist/* and build/* directories.
117
+
118
+
119
+ ### PyPI
120
+
121
+ > **_WARNING:_** Do not do this if you'r not responsible as author and
122
+ > or maintainer of this project.
123
+
124
+ Execute
125
+ ```bash
126
+ make clean
127
+ make pypi
69
128
  ```
129
+ to upload `sdists` and `wheel` packages on [PyPI](https://pypi.org).
@@ -0,0 +1,101 @@
1
+ # yhttp-dbmanager
2
+
3
+ A `yhttp` extension to create and remove database(s) using command line and
4
+ API.
5
+
6
+ ## Contribution
7
+
8
+ ### Dependencies
9
+ Install `postgreslq` brefore use of this project.
10
+ ```bash
11
+ apt install postgresql
12
+ ```
13
+
14
+ ### Prepare
15
+
16
+ Create and grant the `postgresql` role with `createdb` permission to
17
+ authenticate the current `unix` user within `postgresql` using the peer
18
+ authentication.
19
+ ```bash
20
+ echo "CREATE USER ${USER} WITH CREATEDB" | sudo -u postgres psql
21
+ # Or
22
+ echo "ALTER USER ${USER} CREATEDB" | sudo -u postgres psql
23
+ ```
24
+
25
+ ### Virtualenv
26
+
27
+ Create virtual environment:
28
+ ```bash
29
+ make venv
30
+ ```
31
+
32
+ Delete virtual environment:
33
+ ```bash
34
+ make venv-delete
35
+ ```
36
+
37
+ Activate the virtual environment:
38
+ ```bash
39
+ source ./activate.sh
40
+ ```
41
+
42
+
43
+ ### Install (editable mode)
44
+ Install this project as editable mode and all other development dependencies:
45
+ ```bash
46
+ make env
47
+ ```
48
+
49
+
50
+ ### Tests
51
+ Execute all tests:
52
+ ```bash
53
+ make test
54
+ ```
55
+
56
+ Execute specific test(s) using wildcard:
57
+ ```bash
58
+ make test U=db*
59
+ ```
60
+
61
+ Execute all tests and report coverage result:
62
+ ```bash
63
+ make cover
64
+ make cover-html
65
+ ```
66
+
67
+
68
+ ### Distribution
69
+ Execute these commands to create `Python`'s standard distribution packages
70
+ at `dist` directory:
71
+ ```bash
72
+ make sdist
73
+ make wheel
74
+ ```
75
+
76
+ Or
77
+ ```bash
78
+ make dist
79
+ ```
80
+ to create both `sdidst` and `wheel` packages.
81
+
82
+
83
+ ### Clean build directory
84
+ Execute:
85
+ ```bash
86
+ make clean
87
+ ```
88
+ to clean-up previous dist/* and build/* directories.
89
+
90
+
91
+ ### PyPI
92
+
93
+ > **_WARNING:_** Do not do this if you'r not responsible as author and
94
+ > or maintainer of this project.
95
+
96
+ Execute
97
+ ```bash
98
+ make clean
99
+ make pypi
100
+ ```
101
+ to upload `sdists` and `wheel` packages on [PyPI](https://pypi.org).
@@ -0,0 +1,50 @@
1
+ from yhttp.ext.dbmanager import DatabaseURI
2
+
3
+ import pytest
4
+
5
+
6
+ def test_dburi():
7
+ uristr = 'foo://bar:baz@qux/quux.thud'
8
+ uri = DatabaseURI.loads(uristr)
9
+
10
+ assert uri.provider == 'foo'
11
+ assert uri.user == 'bar'
12
+ assert uri.password == 'baz'
13
+ assert uri.host == 'qux'
14
+ assert uri.dbname == 'quux.thud'
15
+ assert uri.dumps() == uristr
16
+
17
+ # Invalid uri
18
+ uristr = 'baduri'
19
+ with pytest.raises(ValueError):
20
+ DatabaseURI.loads(uristr)
21
+
22
+ # Without password
23
+ uristr = 'foo://bar:@qux/quux.thud'
24
+ uri = DatabaseURI.loads(uristr)
25
+ assert uri.provider == 'foo'
26
+ assert uri.user == 'bar'
27
+ assert uri.password == ''
28
+ assert uri.host == 'qux'
29
+ assert uri.dbname == 'quux.thud'
30
+ assert uri.dumps() == uristr
31
+
32
+ # Without username and password
33
+ uristr = 'foo://:@qux/quux.thud'
34
+ uri = DatabaseURI.loads(uristr)
35
+ assert uri.provider == 'foo'
36
+ assert uri.user == ''
37
+ assert uri.password == ''
38
+ assert uri.host == 'qux'
39
+ assert uri.dbname == 'quux.thud'
40
+ assert uri.dumps() == uristr
41
+
42
+ # Without username, password and host
43
+ uristr = 'foo://:@/quux.thud'
44
+ uri = DatabaseURI.loads(uristr)
45
+ assert uri.provider == 'foo'
46
+ assert uri.user == ''
47
+ assert uri.password == ''
48
+ assert uri.host == ''
49
+ assert uri.dbname == 'quux.thud'
50
+ assert uri.dumps() == uristr
@@ -5,4 +5,4 @@ from .dbmanager import PostgresqlManager
5
5
  from .uri import DatabaseURI
6
6
 
7
7
 
8
- __version__ = '2.7.0'
8
+ __version__ = '2.8.0'
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: yhttp-dbmanager
3
- Version: 2.7.0
3
+ Version: 2.8.0
4
4
  Summary: Database manager command line interface and API for yhttp.
5
5
  Home-page: http://github.com/yhttp/yhttp-dbmanager
6
6
  Author: Vahid Mardani
@@ -26,44 +26,104 @@ Requires-Dist: yhttp<5,>=3.5.2
26
26
  Requires-Dist: dbmanager
27
27
  Requires-Dist: psycopg2
28
28
 
29
- # Dependencies
30
- install `postgreslq` brefore use of this project.
29
+ # yhttp-dbmanager
31
30
 
31
+ A `yhttp` extension to create and remove database(s) using command line and
32
+ API.
32
33
 
33
34
  ## Contribution
34
35
 
36
+ ### Dependencies
37
+ Install `postgreslq` brefore use of this project.
38
+ ```bash
39
+ apt install postgresql
40
+ ```
41
+
35
42
  ### Prepare
36
43
 
37
- Create and grant `postgres` role with `createdb` permission:
44
+ Create and grant the `postgresql` role with `createdb` permission to
45
+ authenticate the current `unix` user within `postgresql` using the peer
46
+ authentication.
38
47
  ```bash
39
48
  echo "CREATE USER ${USER} WITH CREATEDB" | sudo -u postgres psql
40
49
  # Or
41
50
  echo "ALTER USER ${USER} CREATEDB" | sudo -u postgres psql
42
51
  ```
43
52
 
53
+ ### Virtualenv
54
+
44
55
  Create virtual environment:
45
56
  ```bash
46
57
  make venv
47
58
  ```
48
59
 
60
+ Delete virtual environment:
61
+ ```bash
62
+ make venv-delete
63
+ ```
64
+
65
+ Activate the virtual environment:
66
+ ```bash
67
+ source ./activate.sh
68
+ ```
69
+
70
+
71
+ ### Install (editable mode)
49
72
  Install this project as editable mode and all other development dependencies:
50
73
  ```bash
51
74
  make env
52
75
  ```
53
76
 
77
+
54
78
  ### Tests
55
79
  Execute all tests:
56
80
  ```bash
57
81
  make test
58
82
  ```
59
83
 
84
+ Execute specific test(s) using wildcard:
85
+ ```bash
86
+ make test U=db*
87
+ ```
88
+
60
89
  Execute all tests and report coverage result:
61
90
  ```bash
62
91
  make cover
63
92
  make cover-html
64
93
  ```
65
94
 
66
- ### Virtualenv
95
+
96
+ ### Distribution
97
+ Execute these commands to create `Python`'s standard distribution packages
98
+ at `dist` directory:
67
99
  ```bash
68
- source ./activate.sh
100
+ make sdist
101
+ make wheel
102
+ ```
103
+
104
+ Or
105
+ ```bash
106
+ make dist
107
+ ```
108
+ to create both `sdidst` and `wheel` packages.
109
+
110
+
111
+ ### Clean build directory
112
+ Execute:
113
+ ```bash
114
+ make clean
115
+ ```
116
+ to clean-up previous dist/* and build/* directories.
117
+
118
+
119
+ ### PyPI
120
+
121
+ > **_WARNING:_** Do not do this if you'r not responsible as author and
122
+ > or maintainer of this project.
123
+
124
+ Execute
125
+ ```bash
126
+ make clean
127
+ make pypi
69
128
  ```
129
+ to upload `sdists` and `wheel` packages on [PyPI](https://pypi.org).
@@ -1,41 +0,0 @@
1
- # Dependencies
2
- install `postgreslq` brefore use of this project.
3
-
4
-
5
- ## Contribution
6
-
7
- ### Prepare
8
-
9
- Create and grant `postgres` role with `createdb` permission:
10
- ```bash
11
- echo "CREATE USER ${USER} WITH CREATEDB" | sudo -u postgres psql
12
- # Or
13
- echo "ALTER USER ${USER} CREATEDB" | sudo -u postgres psql
14
- ```
15
-
16
- Create virtual environment:
17
- ```bash
18
- make venv
19
- ```
20
-
21
- Install this project as editable mode and all other development dependencies:
22
- ```bash
23
- make env
24
- ```
25
-
26
- ### Tests
27
- Execute all tests:
28
- ```bash
29
- make test
30
- ```
31
-
32
- Execute all tests and report coverage result:
33
- ```bash
34
- make cover
35
- make cover-html
36
- ```
37
-
38
- ### Virtualenv
39
- ```bash
40
- source ./activate.sh
41
- ```
@@ -1,20 +0,0 @@
1
- from yhttp.ext.dbmanager import DatabaseURI
2
-
3
- import pytest
4
-
5
-
6
- def test_dburi():
7
- uristr = 'foo://bar:baz@qux/quux.thud'
8
- uri = DatabaseURI.loads(uristr)
9
-
10
- assert uri.provider == 'foo'
11
- assert uri.user == 'bar'
12
- assert uri.password == 'baz'
13
- assert uri.host == 'qux'
14
- assert uri.dbname == 'quux.thud'
15
- assert uri.dumps() == uristr
16
-
17
- # Invalid uri
18
- uristr = 'baduri'
19
- with pytest.raises(ValueError):
20
- DatabaseURI.loads(uristr)
File without changes