Skip to content

Commit

Permalink
src/doc/en/developer/coding_basics.rst: Don't encourage PRs that upda…
Browse files Browse the repository at this point in the history
…te direct access to data files using __file__ for now
  • Loading branch information
mkoeppe committed Mar 5, 2024
1 parent 52f6a3d commit d645175
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions src/doc/en/developer/coding_basics.rst
Original file line number Diff line number Diff line change
Expand Up @@ -188,18 +188,13 @@ included in one of the following places:
:func:`importlib.resources.as_file`. It should be imported in the
same way as shown above.

.. NOTE::

You may notice that some older code in the Sage library accesses
the package data in more direct ways. For example,
``SAGE_ROOT/src/sage/interfaces/maxima.py`` uses the file
``SAGE_ROOT/src/sage/interfaces/maxima.lisp`` at runtime, so it
refers to it as::

os.path.join(os.path.dirname(__file__), 'sage-maxima.lisp')
- Older code in the Sage library accesses
the package data in more direct ways. For example,
``SAGE_ROOT/src/sage/interfaces/maxima.py`` uses the file
``SAGE_ROOT/src/sage/interfaces/maxima.lisp`` at runtime, so it
refers to it as::

This is no longer recommended, and PRs that update such uses
are welcome.
os.path.join(os.path.dirname(__file__), 'sage-maxima.lisp')

- In an appropriate subdirectory of ``SAGE_ROOT/src/sage/ext_data/``.
(At runtime, it is then available in the directory indicated by
Expand Down

0 comments on commit d645175

Please sign in to comment.