scope 0.4.5__tar.gz → 0.4.6__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: scope
3
- Version: 0.4.5
3
+ Version: 0.4.6
4
4
  Summary: Metrics logging and analysis
5
5
  Home-page: http://github.com/danijar/scope
6
6
  Classifier: Intended Audience :: Science/Research
@@ -1,4 +1,4 @@
1
- __version__ = '0.4.5'
1
+ __version__ = '0.4.6'
2
2
 
3
3
  from .reader import Reader
4
4
  from .writer import Writer
@@ -0,0 +1,27 @@
1
+ import os
2
+ import pathlib
3
+ import sys
4
+
5
+ import uvicorn
6
+
7
+ package = str(pathlib.Path(__file__).parent)
8
+ sys.path.insert(0, package)
9
+ from config import config
10
+
11
+
12
+ def main():
13
+
14
+ # Uvicorn watches cwd for changes for reload.
15
+ os.chdir(package)
16
+
17
+ uvicorn.run(
18
+ 'server:app',
19
+ host='0.0.0.0',
20
+ port=config.port,
21
+ reload=config.debug,
22
+ workers=None if config.debug else config.workers,
23
+ )
24
+
25
+
26
+ if __name__ == '__main__':
27
+ main()