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

Add a quick way to launch a REPL with pybindings #4696

Merged
merged 3 commits into from
Feb 9, 2023

Conversation

nilsvu
Copy link
Member

@nilsvu nilsvu commented Feb 6, 2023

Proposed changes

Do this to jump into a pybindings REPL:

$ ./bin/python-spectre
>>> import spectre
>>> print(spectre.__version__)

You can also use this to run py scripts, launch a jupyter server, etc.

Upgrade instructions

Code review checklist

  • The code is documented and the documentation renders correctly. Run
    make doc to generate the documentation locally into BUILD_DIR/docs/html.
    Then open index.html.
  • The code follows the stylistic and code quality guidelines listed in the
    code review guide.
  • The PR lists upgrade instructions and is labeled bugfix or
    new feature if appropriate.

Further comments

This is the canonical place to store version info.
@@ -44,6 +44,17 @@ file(COPY "${CMAKE_BINARY_DIR}/tmp/spectre"
FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ
GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)

# Also link the Python interpreter to bin/python-spectre as an easy way to jump
# into a REPL or run a script that uses pybindings
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you spell out what REPL is? I have no idea what this means and searching online isn't helpful...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

REPL means "read-evaluate-print loop". I replaced it with "Python shell". It's the interactive session you get when you just type python on the command line.

Do this to jump into a Python shell:

    $ ./bin/python-spectre
    >>> import spectre
    >>> print(spectre.__version__)

Or, if you have ipython installed, do `./bin/python-spectre -m ipython`.
You can also use this to run py scripts, launch a jupyter server, etc.
This way you don't need to deal with PYTHONPATHs etc.
@nilsdeppe nilsdeppe merged commit beb5ef7 into sxs-collaboration:develop Feb 9, 2023
@nilsvu nilsvu deleted the py_repl branch February 9, 2023 23:35
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

Successfully merging this pull request may close these issues.

2 participants