Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow pkcli to execute python files pykern foo.py #277

Closed
robnagler opened this issue Sep 19, 2022 · 1 comment
Closed

allow pkcli to execute python files pykern foo.py #277

robnagler opened this issue Sep 19, 2022 · 1 comment
Milestone

Comments

@robnagler
Copy link
Member

robnagler commented Sep 19, 2022

When you say, e.g. python server.py, it gets this error:

Traceback (most recent call last):
  File "sirepo/server.py", line 12, in <module>
    from sirepo import simulation_db
  File "/home/vagrant/src/radiasoft/sirepo/sirepo/simulation_db.py", line 15, in <module>
    from sirepo import srschema
  File "/home/vagrant/src/radiasoft/sirepo/sirepo/srschema.py", line 11, in <module>
    from sirepo import util
  File "/home/vagrant/src/radiasoft/sirepo/sirepo/util.py", line 26, in <module>
    import werkzeug.utils
  File "/home/vagrant/.pyenv/versions/py3/lib/python3.7/site-packages/werkzeug/__init__.py", line 1, in <module>
    from .serving import run_simple as run_simple
  File "/home/vagrant/.pyenv/versions/py3/lib/python3.7/site-packages/werkzeug/serving.py", line 31, in <module>
    from .exceptions import InternalServerError
  File "/home/vagrant/.pyenv/versions/py3/lib/python3.7/site-packages/werkzeug/exceptions.py", line 50, in <module>
    from html import escape
ImportError: cannot import name 'escape' from 'html' (/home/vagrant/src/radiasoft/sirepo/sirepo/html.py)

#203 fixed this, but it only works for pkcli programs.

Change pkcli to look if the module ends in .py, and then import the module, possibly with a message "compiling module.py".

@robnagler robnagler added this to the tecsup milestone Sep 19, 2022
@robnagler robnagler changed the title 20221031 allow pkcli to execute python files pykern foo.py allow pkcli to execute python files pykern foo.py Apr 17, 2023
@robnagler robnagler modified the milestones: tecsup, any Mar 8, 2024
@robnagler
Copy link
Member Author

dup #204

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant