yhttp 8.4.2__tar.gz → 9.0.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 (61) hide show
  1. {yhttp-8.4.2 → yhttp-9.0.0}/PKG-INFO +5 -13
  2. {yhttp-8.4.2 → yhttp-9.0.0}/README.md +3 -11
  3. {yhttp-8.4.2 → yhttp-9.0.0}/setup.py +1 -1
  4. {yhttp-8.4.2 → yhttp-9.0.0}/tests/test_applicationcli.py +15 -18
  5. {yhttp-8.4.2 → yhttp-9.0.0}/tests/test_rewritecli.py +1 -1
  6. {yhttp-8.4.2 → yhttp-9.0.0}/yhttp/core/application.py +2 -2
  7. {yhttp-8.4.2 → yhttp-9.0.0}/yhttp/core/cli.py +3 -3
  8. yhttp-9.0.0/yhttp/core/version.py +1 -0
  9. {yhttp-8.4.2 → yhttp-9.0.0}/yhttp.egg-info/PKG-INFO +5 -13
  10. {yhttp-8.4.2 → yhttp-9.0.0}/yhttp.egg-info/requires.txt +1 -1
  11. yhttp-8.4.2/yhttp/core/version.py +0 -1
  12. {yhttp-8.4.2 → yhttp-9.0.0}/LICENSE +0 -0
  13. {yhttp-8.4.2 → yhttp-9.0.0}/setup.cfg +0 -0
  14. {yhttp-8.4.2 → yhttp-9.0.0}/tests/test_application.py +0 -0
  15. {yhttp-8.4.2 → yhttp-9.0.0}/tests/test_builtincli_serve.py +0 -0
  16. {yhttp-8.4.2 → yhttp-9.0.0}/tests/test_builtincli_version.py +0 -0
  17. {yhttp-8.4.2 → yhttp-9.0.0}/tests/test_builtincli_yhttp_version.py +0 -0
  18. {yhttp-8.4.2 → yhttp-9.0.0}/tests/test_cookie.py +0 -0
  19. {yhttp-8.4.2 → yhttp-9.0.0}/tests/test_cookieset.py +0 -0
  20. {yhttp-8.4.2 → yhttp-9.0.0}/tests/test_extension.py +0 -0
  21. {yhttp-8.4.2 → yhttp-9.0.0}/tests/test_form.py +0 -0
  22. {yhttp-8.4.2 → yhttp-9.0.0}/tests/test_form_json.py +0 -0
  23. {yhttp-8.4.2 → yhttp-9.0.0}/tests/test_form_multipart.py +0 -0
  24. {yhttp-8.4.2 → yhttp-9.0.0}/tests/test_form_urlencoded.py +0 -0
  25. {yhttp-8.4.2 → yhttp-9.0.0}/tests/test_fswatcher.py +0 -0
  26. {yhttp-8.4.2 → yhttp-9.0.0}/tests/test_guard.py +0 -0
  27. {yhttp-8.4.2 → yhttp-9.0.0}/tests/test_guard_body.py +0 -0
  28. {yhttp-8.4.2 → yhttp-9.0.0}/tests/test_guard_contenttypes.py +0 -0
  29. {yhttp-8.4.2 → yhttp-9.0.0}/tests/test_guard_query.py +0 -0
  30. {yhttp-8.4.2 → yhttp-9.0.0}/tests/test_headerset.py +0 -0
  31. {yhttp-8.4.2 → yhttp-9.0.0}/tests/test_jsonencoding.py +0 -0
  32. {yhttp-8.4.2 → yhttp-9.0.0}/tests/test_locale.py +0 -0
  33. {yhttp-8.4.2 → yhttp-9.0.0}/tests/test_middleware.py +0 -0
  34. {yhttp-8.4.2 → yhttp-9.0.0}/tests/test_multidict.py +0 -0
  35. {yhttp-8.4.2 → yhttp-9.0.0}/tests/test_multipart.py +0 -0
  36. {yhttp-8.4.2 → yhttp-9.0.0}/tests/test_querystring.py +0 -0
  37. {yhttp-8.4.2 → yhttp-9.0.0}/tests/test_request.py +0 -0
  38. {yhttp-8.4.2 → yhttp-9.0.0}/tests/test_responseheaders.py +0 -0
  39. {yhttp-8.4.2 → yhttp-9.0.0}/tests/test_rewrite.py +0 -0
  40. {yhttp-8.4.2 → yhttp-9.0.0}/tests/test_routing.py +0 -0
  41. {yhttp-8.4.2 → yhttp-9.0.0}/tests/test_static.py +0 -0
  42. {yhttp-8.4.2 → yhttp-9.0.0}/tests/test_statuses.py +0 -0
  43. {yhttp-8.4.2 → yhttp-9.0.0}/tests/test_statushandler.py +0 -0
  44. {yhttp-8.4.2 → yhttp-9.0.0}/yhttp/core/__init__.py +0 -0
  45. {yhttp-8.4.2 → yhttp-9.0.0}/yhttp/core/contenttypes.py +0 -0
  46. {yhttp-8.4.2 → yhttp-9.0.0}/yhttp/core/cookieset.py +0 -0
  47. {yhttp-8.4.2 → yhttp-9.0.0}/yhttp/core/fswatcher.py +0 -0
  48. {yhttp-8.4.2 → yhttp-9.0.0}/yhttp/core/guard.py +0 -0
  49. {yhttp-8.4.2 → yhttp-9.0.0}/yhttp/core/headerset.py +0 -0
  50. {yhttp-8.4.2 → yhttp-9.0.0}/yhttp/core/main.py +0 -0
  51. {yhttp-8.4.2 → yhttp-9.0.0}/yhttp/core/multidict.py +0 -0
  52. {yhttp-8.4.2 → yhttp-9.0.0}/yhttp/core/multipart.py +0 -0
  53. {yhttp-8.4.2 → yhttp-9.0.0}/yhttp/core/request.py +0 -0
  54. {yhttp-8.4.2 → yhttp-9.0.0}/yhttp/core/response.py +0 -0
  55. {yhttp-8.4.2 → yhttp-9.0.0}/yhttp/core/rewrite.py +0 -0
  56. {yhttp-8.4.2 → yhttp-9.0.0}/yhttp/core/static.py +0 -0
  57. {yhttp-8.4.2 → yhttp-9.0.0}/yhttp/core/statuses.py +0 -0
  58. {yhttp-8.4.2 → yhttp-9.0.0}/yhttp.egg-info/SOURCES.txt +0 -0
  59. {yhttp-8.4.2 → yhttp-9.0.0}/yhttp.egg-info/dependency_links.txt +0 -0
  60. {yhttp-8.4.2 → yhttp-9.0.0}/yhttp.egg-info/entry_points.txt +0 -0
  61. {yhttp-8.4.2 → yhttp-9.0.0}/yhttp.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: yhttp
3
- Version: 8.4.2
3
+ Version: 9.0.0
4
4
  Summary: A very micro http framework.
5
5
  Home-page: http://github.com/yhttp/yhttp
6
6
  Author: Vahid Mardani
@@ -22,7 +22,7 @@ Classifier: Topic :: Software Development :: Libraries
22
22
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
23
23
  Description-Content-Type: text/markdown
24
24
  License-File: LICENSE
25
- Requires-Dist: pymlconf<4,>=3.0.1
25
+ Requires-Dist: pymlconf<5,>=4.0.1
26
26
  Requires-Dist: easycli<2,>=1.10.1
27
27
  Requires-Dist: ujson
28
28
  Requires-Dist: inotify-simple
@@ -52,10 +52,6 @@ Dynamic: summary
52
52
  ### python-makelib
53
53
  Install [python-makelib](https://github.com/pylover/python-makelib).
54
54
 
55
- ### Clone
56
- ```bash
57
- git clone git@github.com:yhttp/yhttp.git
58
- ```
59
55
 
60
56
  ### Virtualenv
61
57
 
@@ -119,12 +115,6 @@ make sdist
119
115
  make wheel
120
116
  ```
121
117
 
122
- Or
123
- ```bash
124
- make dist
125
- ```
126
- to create both `sdidst` and `wheel` packages.
127
-
128
118
 
129
119
  ### Clean build directory
130
120
  Execute:
@@ -150,14 +140,16 @@ to upload `sdists` and `wheel` packages on [PyPI](https://pypi.org).
150
140
  ## Documentation
151
141
 
152
142
  ```bash
143
+ source activate.sh
153
144
  make doc
154
- make livedoc
145
+ make doclive
155
146
  make doctest
156
147
  ```
157
148
 
158
149
  Or
159
150
 
160
151
  ```bash
152
+ source activate.sh
161
153
  cd sphinx
162
154
  make doctest
163
155
  make html
@@ -13,10 +13,6 @@
13
13
  ### python-makelib
14
14
  Install [python-makelib](https://github.com/pylover/python-makelib).
15
15
 
16
- ### Clone
17
- ```bash
18
- git clone git@github.com:yhttp/yhttp.git
19
- ```
20
16
 
21
17
  ### Virtualenv
22
18
 
@@ -80,12 +76,6 @@ make sdist
80
76
  make wheel
81
77
  ```
82
78
 
83
- Or
84
- ```bash
85
- make dist
86
- ```
87
- to create both `sdidst` and `wheel` packages.
88
-
89
79
 
90
80
  ### Clean build directory
91
81
  Execute:
@@ -111,14 +101,16 @@ to upload `sdists` and `wheel` packages on [PyPI](https://pypi.org).
111
101
  ## Documentation
112
102
 
113
103
  ```bash
104
+ source activate.sh
114
105
  make doc
115
- make livedoc
106
+ make doclive
116
107
  make doctest
117
108
  ```
118
109
 
119
110
  Or
120
111
 
121
112
  ```bash
113
+ source activate.sh
122
114
  cd sphinx
123
115
  make doctest
124
116
  make html
@@ -15,7 +15,7 @@ with open(
15
15
 
16
16
 
17
17
  dependencies = [
18
- 'pymlconf >= 3.0.1, < 4',
18
+ 'pymlconf >= 4.0.1, < 5',
19
19
  'easycli >= 1.10.1, < 2',
20
20
  'ujson',
21
21
  'inotify-simple',
@@ -1,5 +1,4 @@
1
1
  import os
2
- import tempfile
3
2
  import platform
4
3
 
5
4
  from bddcli import Application as CLIApplication, Given, stdout, status, \
@@ -30,7 +29,7 @@ class Foo(SubCommand):
30
29
  else:
31
30
  print(os.curdir)
32
31
  if app.settings.title == 'bar':
33
- return 73 # The best number ever, as Sheldon says.
32
+ return 73 # Best number ever, as the Sheldon Cooper told already.
34
33
 
35
34
  return 0
36
35
 
@@ -46,16 +45,17 @@ class Bar(SubCommand):
46
45
  app = Application('0.1.0', 'foo')
47
46
  app.cliarguments.append(Foo)
48
47
  app.cliarguments.append(Bar)
49
- app.settings.merge('title: foo')
50
- app.settings.merge('''
48
+ app.settings |= '''
49
+ title: foo
51
50
  foo:
52
51
  bar:
53
52
  baz: qux
54
- ''')
53
+ '''
55
54
 
56
55
 
57
- def test_applicationcli():
56
+ def test_applicationcli(mktmpfile):
58
57
  cliapp = CLIApplication('foo', 'tests.test_applicationcli:app.climain')
58
+ configfile = mktmpfile(content='title: bar')
59
59
  with Given(cliapp, '--help'):
60
60
  assert status == 0
61
61
 
@@ -63,20 +63,17 @@ def test_applicationcli():
63
63
  assert status == 0
64
64
  assert stdout == 'foo\n.\n'
65
65
 
66
- with tempfile.NamedTemporaryFile() as f:
67
- f.write(b'title: bar')
68
- f.flush()
69
- when(f'--configuration-file {f.name} foo')
70
- assert status == 73
71
- assert stdout == 'bar\n.\n'
66
+ when(f'--configuration-file {configfile} foo')
67
+ assert status == 73
68
+ assert stdout == 'bar\n.\n'
72
69
 
73
- when('--directory /tmp foo')
74
- assert status == 0
75
- assert stdout == 'foo\n/tmp\n'
70
+ when('--directory /tmp foo')
71
+ assert status == 0
72
+ assert stdout == 'foo\n/tmp\n'
76
73
 
77
- when('--option title=\'baz\' foo')
78
- assert status == 0
79
- assert stdout == 'baz\n.\n'
74
+ when('--option title=\'baz\' foo')
75
+ assert status == 0
76
+ assert stdout == 'baz\n.\n'
80
77
 
81
78
 
82
79
  def test_applicationcli_option():
@@ -19,7 +19,7 @@ class Foo(SubCommand):
19
19
 
20
20
 
21
21
  app = Rewrite()
22
- app.settings.merge('title: foo')
22
+ app.settings |= 'title: foo'
23
23
  app.cliarguments.append(Foo)
24
24
 
25
25
 
@@ -39,7 +39,7 @@ class BaseApplication:
39
39
  debug: true
40
40
  '''
41
41
 
42
- #: Instance of :class:`pymlconf.Root` as the global configuration instance.
42
+ #: Instance of :class:`pymlconf.Meld` as the global configuration instance.
43
43
  settings = None
44
44
 
45
45
  #: A list of :class:`easycli.Argument` or :class:`easycli.SubCommand`.
@@ -62,7 +62,7 @@ class BaseApplication:
62
62
  self.name = name
63
63
  self.events = {}
64
64
  self.cliarguments = []
65
- self.settings = pymlconf.Root(self._builtinsettings)
65
+ self.settings = pymlconf.Meld(self._builtinsettings)
66
66
  self.request_middlewares = []
67
67
 
68
68
  def when(self, func):
@@ -207,7 +207,7 @@ class Main(Root):
207
207
  os.chdir(args.directory)
208
208
 
209
209
  if args.configurationfile:
210
- self.application.settings.loadfile(args.configurationfile)
210
+ self.application.settings.load(args.configurationfile)
211
211
 
212
212
  else: # pragma: no cover
213
213
  # try to find user specific config file
@@ -219,7 +219,7 @@ class Main(Root):
219
219
 
220
220
  if os.path.exists(filename):
221
221
  print(f'loading config file: {filename}')
222
- self.application.settings.loadfile(filename)
222
+ self.application.settings.load(filename)
223
223
 
224
224
  for o in args.option:
225
225
  try:
@@ -240,7 +240,7 @@ class Main(Root):
240
240
  indent += 2
241
241
 
242
242
  yml += f' {value}'
243
- self.application.settings.merge(yml)
243
+ self.application.settings |= yml
244
244
 
245
245
  return super()._execute_subcommand(args)
246
246
 
@@ -0,0 +1 @@
1
+ __version__ = '9.0.0'
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: yhttp
3
- Version: 8.4.2
3
+ Version: 9.0.0
4
4
  Summary: A very micro http framework.
5
5
  Home-page: http://github.com/yhttp/yhttp
6
6
  Author: Vahid Mardani
@@ -22,7 +22,7 @@ Classifier: Topic :: Software Development :: Libraries
22
22
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
23
23
  Description-Content-Type: text/markdown
24
24
  License-File: LICENSE
25
- Requires-Dist: pymlconf<4,>=3.0.1
25
+ Requires-Dist: pymlconf<5,>=4.0.1
26
26
  Requires-Dist: easycli<2,>=1.10.1
27
27
  Requires-Dist: ujson
28
28
  Requires-Dist: inotify-simple
@@ -52,10 +52,6 @@ Dynamic: summary
52
52
  ### python-makelib
53
53
  Install [python-makelib](https://github.com/pylover/python-makelib).
54
54
 
55
- ### Clone
56
- ```bash
57
- git clone git@github.com:yhttp/yhttp.git
58
- ```
59
55
 
60
56
  ### Virtualenv
61
57
 
@@ -119,12 +115,6 @@ make sdist
119
115
  make wheel
120
116
  ```
121
117
 
122
- Or
123
- ```bash
124
- make dist
125
- ```
126
- to create both `sdidst` and `wheel` packages.
127
-
128
118
 
129
119
  ### Clean build directory
130
120
  Execute:
@@ -150,14 +140,16 @@ to upload `sdists` and `wheel` packages on [PyPI](https://pypi.org).
150
140
  ## Documentation
151
141
 
152
142
  ```bash
143
+ source activate.sh
153
144
  make doc
154
- make livedoc
145
+ make doclive
155
146
  make doctest
156
147
  ```
157
148
 
158
149
  Or
159
150
 
160
151
  ```bash
152
+ source activate.sh
161
153
  cd sphinx
162
154
  make doctest
163
155
  make html
@@ -1,4 +1,4 @@
1
- pymlconf<4,>=3.0.1
1
+ pymlconf<5,>=4.0.1
2
2
  easycli<2,>=1.10.1
3
3
  ujson
4
4
  inotify-simple
@@ -1 +0,0 @@
1
- __version__ = '8.4.2'
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes