yhttp-dbmanager 2.7.0__tar.gz → 2.8.1__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.1}/PKG-INFO +72 -7
  2. yhttp_dbmanager-2.8.1/README.md +107 -0
  3. {yhttp_dbmanager-2.7.0 → yhttp_dbmanager-2.8.1}/setup.py +0 -1
  4. yhttp_dbmanager-2.8.1/tests/test_dburi.py +50 -0
  5. {yhttp_dbmanager-2.7.0 → yhttp_dbmanager-2.8.1}/yhttp/ext/dbmanager/__init__.py +1 -1
  6. {yhttp_dbmanager-2.7.0 → yhttp_dbmanager-2.8.1/yhttp_dbmanager.egg-info}/PKG-INFO +72 -7
  7. {yhttp_dbmanager-2.7.0 → yhttp_dbmanager-2.8.1}/yhttp_dbmanager.egg-info/requires.txt +0 -1
  8. yhttp_dbmanager-2.7.0/README.md +0 -41
  9. yhttp_dbmanager-2.7.0/tests/test_dburi.py +0 -20
  10. {yhttp_dbmanager-2.7.0 → yhttp_dbmanager-2.8.1}/LICENSE +0 -0
  11. {yhttp_dbmanager-2.7.0 → yhttp_dbmanager-2.8.1}/setup.cfg +0 -0
  12. {yhttp_dbmanager-2.7.0 → yhttp_dbmanager-2.8.1}/tests/test_cli.py +0 -0
  13. {yhttp_dbmanager-2.7.0 → yhttp_dbmanager-2.8.1}/tests/test_dbmanager.py +0 -0
  14. {yhttp_dbmanager-2.7.0 → yhttp_dbmanager-2.8.1}/tests/test_install.py +0 -0
  15. {yhttp_dbmanager-2.7.0 → yhttp_dbmanager-2.8.1}/yhttp/ext/dbmanager/cli.py +0 -0
  16. {yhttp_dbmanager-2.7.0 → yhttp_dbmanager-2.8.1}/yhttp/ext/dbmanager/dbmanager.py +0 -0
  17. {yhttp_dbmanager-2.7.0 → yhttp_dbmanager-2.8.1}/yhttp/ext/dbmanager/install.py +0 -0
  18. {yhttp_dbmanager-2.7.0 → yhttp_dbmanager-2.8.1}/yhttp/ext/dbmanager/uri.py +0 -0
  19. {yhttp_dbmanager-2.7.0 → yhttp_dbmanager-2.8.1}/yhttp_dbmanager.egg-info/SOURCES.txt +0 -0
  20. {yhttp_dbmanager-2.7.0 → yhttp_dbmanager-2.8.1}/yhttp_dbmanager.egg-info/dependency_links.txt +0 -0
  21. {yhttp_dbmanager-2.7.0 → yhttp_dbmanager-2.8.1}/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.1
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
@@ -23,47 +23,112 @@ Classifier: Topic :: Software Development :: Libraries :: Python Modules
23
23
  Description-Content-Type: text/markdown
24
24
  License-File: LICENSE
25
25
  Requires-Dist: yhttp<5,>=3.5.2
26
- Requires-Dist: dbmanager
27
26
  Requires-Dist: psycopg2
28
27
 
29
- # Dependencies
30
- install `postgreslq` brefore use of this project.
28
+ # yhttp-dbmanager
31
29
 
30
+ A `yhttp` extension to create and remove database(s) using command line and
31
+ API.
32
32
 
33
33
  ## Contribution
34
34
 
35
+ ### Dependencies
36
+ Install `postgreslq` brefore use of this project.
37
+ ```bash
38
+ apt install postgresql
39
+ ```
40
+
35
41
  ### Prepare
36
42
 
37
- Create and grant `postgres` role with `createdb` permission:
43
+ Create and grant the `postgresql` role with `createdb` permission to
44
+ authenticate the current `unix` user within `postgresql` using the peer
45
+ authentication.
38
46
  ```bash
39
47
  echo "CREATE USER ${USER} WITH CREATEDB" | sudo -u postgres psql
40
48
  # Or
41
49
  echo "ALTER USER ${USER} CREATEDB" | sudo -u postgres psql
42
50
  ```
43
51
 
52
+ ### Virtualenv
53
+
44
54
  Create virtual environment:
45
55
  ```bash
46
56
  make venv
47
57
  ```
48
58
 
59
+ Delete virtual environment:
60
+ ```bash
61
+ make venv-delete
62
+ ```
63
+
64
+ Activate the virtual environment:
65
+ ```bash
66
+ source ./activate.sh
67
+ ```
68
+
69
+
70
+ ### Install (editable mode)
49
71
  Install this project as editable mode and all other development dependencies:
50
72
  ```bash
51
73
  make env
52
74
  ```
53
75
 
76
+
54
77
  ### Tests
55
78
  Execute all tests:
56
79
  ```bash
57
80
  make test
58
81
  ```
59
82
 
83
+ Execute specific test(s) using wildcard:
84
+ ```bash
85
+ make test U=db*
86
+ ```
87
+
60
88
  Execute all tests and report coverage result:
61
89
  ```bash
62
90
  make cover
63
91
  make cover-html
64
92
  ```
65
93
 
66
- ### Virtualenv
94
+
95
+ # Lint
67
96
  ```bash
68
- source ./activate.sh
97
+ make lint
98
+ ```
99
+
100
+
101
+ ### Distribution
102
+ Execute these commands to create `Python`'s standard distribution packages
103
+ at `dist` directory:
104
+ ```bash
105
+ make sdist
106
+ make wheel
107
+ ```
108
+
109
+ Or
110
+ ```bash
111
+ make dist
112
+ ```
113
+ to create both `sdidst` and `wheel` packages.
114
+
115
+
116
+ ### Clean build directory
117
+ Execute:
118
+ ```bash
119
+ make clean
120
+ ```
121
+ to clean-up previous dist/* and build/* directories.
122
+
123
+
124
+ ### PyPI
125
+
126
+ > **_WARNING:_** Do not do this if you'r not responsible as author and
127
+ > or maintainer of this project.
128
+
129
+ Execute
130
+ ```bash
131
+ make clean
132
+ make pypi
69
133
  ```
134
+ to upload `sdists` and `wheel` packages on [PyPI](https://pypi.org).
@@ -0,0 +1,107 @@
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
+ # Lint
69
+ ```bash
70
+ make lint
71
+ ```
72
+
73
+
74
+ ### Distribution
75
+ Execute these commands to create `Python`'s standard distribution packages
76
+ at `dist` directory:
77
+ ```bash
78
+ make sdist
79
+ make wheel
80
+ ```
81
+
82
+ Or
83
+ ```bash
84
+ make dist
85
+ ```
86
+ to create both `sdidst` and `wheel` packages.
87
+
88
+
89
+ ### Clean build directory
90
+ Execute:
91
+ ```bash
92
+ make clean
93
+ ```
94
+ to clean-up previous dist/* and build/* directories.
95
+
96
+
97
+ ### PyPI
98
+
99
+ > **_WARNING:_** Do not do this if you'r not responsible as author and
100
+ > or maintainer of this project.
101
+
102
+ Execute
103
+ ```bash
104
+ make clean
105
+ make pypi
106
+ ```
107
+ to upload `sdists` and `wheel` packages on [PyPI](https://pypi.org).
@@ -18,7 +18,6 @@ with open(
18
18
 
19
19
  dependencies = [
20
20
  'yhttp >= 3.5.2, < 5',
21
- 'dbmanager',
22
21
  'psycopg2',
23
22
  ]
24
23
 
@@ -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.1'
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: yhttp-dbmanager
3
- Version: 2.7.0
3
+ Version: 2.8.1
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
@@ -23,47 +23,112 @@ Classifier: Topic :: Software Development :: Libraries :: Python Modules
23
23
  Description-Content-Type: text/markdown
24
24
  License-File: LICENSE
25
25
  Requires-Dist: yhttp<5,>=3.5.2
26
- Requires-Dist: dbmanager
27
26
  Requires-Dist: psycopg2
28
27
 
29
- # Dependencies
30
- install `postgreslq` brefore use of this project.
28
+ # yhttp-dbmanager
31
29
 
30
+ A `yhttp` extension to create and remove database(s) using command line and
31
+ API.
32
32
 
33
33
  ## Contribution
34
34
 
35
+ ### Dependencies
36
+ Install `postgreslq` brefore use of this project.
37
+ ```bash
38
+ apt install postgresql
39
+ ```
40
+
35
41
  ### Prepare
36
42
 
37
- Create and grant `postgres` role with `createdb` permission:
43
+ Create and grant the `postgresql` role with `createdb` permission to
44
+ authenticate the current `unix` user within `postgresql` using the peer
45
+ authentication.
38
46
  ```bash
39
47
  echo "CREATE USER ${USER} WITH CREATEDB" | sudo -u postgres psql
40
48
  # Or
41
49
  echo "ALTER USER ${USER} CREATEDB" | sudo -u postgres psql
42
50
  ```
43
51
 
52
+ ### Virtualenv
53
+
44
54
  Create virtual environment:
45
55
  ```bash
46
56
  make venv
47
57
  ```
48
58
 
59
+ Delete virtual environment:
60
+ ```bash
61
+ make venv-delete
62
+ ```
63
+
64
+ Activate the virtual environment:
65
+ ```bash
66
+ source ./activate.sh
67
+ ```
68
+
69
+
70
+ ### Install (editable mode)
49
71
  Install this project as editable mode and all other development dependencies:
50
72
  ```bash
51
73
  make env
52
74
  ```
53
75
 
76
+
54
77
  ### Tests
55
78
  Execute all tests:
56
79
  ```bash
57
80
  make test
58
81
  ```
59
82
 
83
+ Execute specific test(s) using wildcard:
84
+ ```bash
85
+ make test U=db*
86
+ ```
87
+
60
88
  Execute all tests and report coverage result:
61
89
  ```bash
62
90
  make cover
63
91
  make cover-html
64
92
  ```
65
93
 
66
- ### Virtualenv
94
+
95
+ # Lint
67
96
  ```bash
68
- source ./activate.sh
97
+ make lint
98
+ ```
99
+
100
+
101
+ ### Distribution
102
+ Execute these commands to create `Python`'s standard distribution packages
103
+ at `dist` directory:
104
+ ```bash
105
+ make sdist
106
+ make wheel
107
+ ```
108
+
109
+ Or
110
+ ```bash
111
+ make dist
112
+ ```
113
+ to create both `sdidst` and `wheel` packages.
114
+
115
+
116
+ ### Clean build directory
117
+ Execute:
118
+ ```bash
119
+ make clean
120
+ ```
121
+ to clean-up previous dist/* and build/* directories.
122
+
123
+
124
+ ### PyPI
125
+
126
+ > **_WARNING:_** Do not do this if you'r not responsible as author and
127
+ > or maintainer of this project.
128
+
129
+ Execute
130
+ ```bash
131
+ make clean
132
+ make pypi
69
133
  ```
134
+ to upload `sdists` and `wheel` packages on [PyPI](https://pypi.org).
@@ -1,3 +1,2 @@
1
1
  yhttp<5,>=3.5.2
2
- dbmanager
3
2
  psycopg2
@@ -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