You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/gettingstarted.rst
+22-1Lines changed: 22 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -132,4 +132,25 @@ For systems where the shebang line allows arguments, you can use ``#!/usr/bin/en
132
132
.. code-block:: clojure
133
133
134
134
#!/usr/bin/env basilisp-run
135
-
(println "Hello world!")
135
+
(println "Hello world!")
136
+
137
+
Finally, Basilisp has a command line option to bootstrap your Python installation such that Basilisp will already be importable whenever Python is started.
138
+
This takes advantage of the ``.pth`` file feature supported by the `site <https://docs.python.org/3/library/site.html>`_ package.
139
+
Specifically, any file with a ``.pth`` extension located in any of the known ``site-packages`` directories will be read at startup and, if any line of such a file starts with ``import``, it is executed.
140
+
141
+
.. code-block:: bash
142
+
143
+
$ basilisp bootstrap
144
+
Your Python installation has been bootstrapped! You can undo this at any time with with `basilisp bootstrap --uninstall`.
145
+
$ python
146
+
Python 3.12.1 (main, Jan 3 2024, 10:01:43) [GCC 11.4.0] on linux
147
+
Type "help", "copyright", "credits" or "license"for more information.
Code in ``.pth`` files is executed each time the Python interpreter is started.
154
+
The Python ``site`` documentation warns that "[i]ts impact should thus be kept to a minimum".
155
+
Bootstrapping Basilisp can take as long as 30 seconds (or perhaps longer) on the first run due to needing to compile :lpy:ns:`basilisp.core` to Python bytecode.
156
+
Subsequent startups should be considerable faster unless users have taken any measures to disable :ref:`namespace_caching`.
0 commit comments