Skip to content

Commit

Permalink
Merge branch 'quickfix'
Browse files Browse the repository at this point in the history
  • Loading branch information
u8sand committed Oct 20, 2023
2 parents ededb88 + 5910709 commit a32198b
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 22 deletions.
2 changes: 1 addition & 1 deletion appyter/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.19.21
0.19.22
7 changes: 2 additions & 5 deletions appyter/execspec/implementations/subprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,9 @@ async def _submit(self, **job):
job['ipynb'],
stderr=sys.stderr,
env=dict(
SYSTEMROOT=os.environ.get('SYSTEMROOT', ''),
HOME=os.environ.get('HOME', ''),
USERPROFILE=os.environ.get('USERPROFILE', ''),
PYTHONUTF8='1',
os.environ,
{ k: v for k, v in os.environ.items() if not k.startswith('APPYTER_') },
PYTHONPATH=':'.join(sys.path),
PATH=os.environ['PATH'],
),
):
yield msg, done
Expand Down
6 changes: 1 addition & 5 deletions appyter/helpers/serve.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,7 @@ def serve(data_dir, cwd, host, port, args):
],
stdin=sys.stdin, stdout=sys.stdout, stderr=sys.stderr,
cwd=tmp.resolve(),
env=dict(os.environ,
PYTHONUTF8='1',
PYTHONPATH=':'.join(sys.path),
PATH=os.environ['PATH']
),
env=dict(os.environ, PYTHONPATH=':'.join(sys.path)),
)
exit_code = None
while exit_code is None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ startsecs=1
startretries=3
autostart=true
autorestart=true
{#- NOTE: a `'` anywhere in `v` would cause an issue, we should come up with a way around this #}
environment={% for k, v in _config.items() %}{% if v is not none %}{{ k }}='{{ v|jsonify }}'{% if not loop.last %},{% endif %}{% endif %}{% endfor %}
command={{ sys.executable }} -u -m appyter --socket={{ str(_tmp_dir/'%(program_name)s_%(process_num)d.sock') }}
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
Expand Down
2 changes: 1 addition & 1 deletion appyter/render/flask_app/development.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ async def run_app(config):
f"--socket={config['HOST']}:{config['PORT']}",
stdout=sys.stdout,
stderr=sys.stderr,
env=dict(os.environ),
env=os.environ,
)

async def app_runner(emitter, config):
Expand Down
13 changes: 10 additions & 3 deletions appyter/render/flask_app/production.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,19 @@ def serve(app_path, **kwargs):
#
logger.info(f"Generating production config...")
with (tmp_dir/'supervisord.conf').open('w') as fw:
env.get_template('production/supervisord.conf.j2').stream(_tmp_dir=tmp_dir, sys=sys, str=str).dump(fw)
env.get_template('production/supervisord.conf.j2').stream(
_tmp_dir=tmp_dir,
list=list,
str=str,
sys=sys,
).dump(fw)
with (tmp_dir/'nginx.conf').open('w') as fw:
env.get_template('production/nginx.conf.j2').stream(
_tmp_dir=tmp_dir, os=os, str=str,
get_appyter_directory=get_appyter_directory,
_tmp_dir=tmp_dir,
find_blueprints=find_blueprints,
get_appyter_directory=get_appyter_directory,
os=os,
str=str,
).dump(fw)
logger.info(f"Starting production instance at http://{config['HOST']}:{config['PORT']}{config['PREFIX']}/ ...")
with Popen(['supervisord', '-n', '-c', str(tmp_dir/'supervisord.conf')], env=os.environ) as proc:
Expand Down
6 changes: 1 addition & 5 deletions appyter/render/nbexecute.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,8 @@ async def nbexecute_async(ipynb='', emit=json_emitter_factory(sys.stdout), cwd='
await emit({ 'type': 'nb', 'data': nb_to_json(nb) })
async with client.async_setup_kernel(
env=dict(
SYSTEMROOT=os.environ.get('SYSTEMROOT', ''),
HOME=str(mnt),
USERPROFILE=str(mnt),
PYTHONUTF8='1',
{ k: v for k, v in os.environ.items() if not k.startswith('APPYTER_') },
PYTHONPATH=':'.join(sys.path),
PATH=os.environ['PATH'],
),
):
logger.info('executing')
Expand Down

0 comments on commit a32198b

Please sign in to comment.