-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add python3 -m cog.server.http wrapper
- Loading branch information
1 parent
b88d926
commit a2046e4
Showing
6 changed files
with
13 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import os | ||
import sys | ||
|
||
# Lightweight wrapper from `python3 -m cog.server.http` to cog-server | ||
|
||
args = sys.argv | ||
args[0] = 'cog-server' | ||
port = os.getenv('PORT') | ||
if port is not None: | ||
args += ['--port', port] | ||
os.execvp('cog-server', args) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,4 @@ | ||
import pathlib | ||
import sys | ||
import warnings | ||
|
||
try: | ||
from ._version import __version__ | ||
except ImportError: | ||
__version__ = '0.0.0+unknown' | ||
|
||
warnings.warn( | ||
( | ||
'coglet/_compat/ is being added to the front of sys.path ' | ||
"for 'cog' import compatibility" | ||
), | ||
category=ImportWarning, | ||
stacklevel=2, | ||
) | ||
sys.path.insert(0, str(pathlib.Path(__file__).absolute().parent / '_compat')) |