I am testing a patch. Basically you really want the html file to be installed like the other python files. Then you can use SAGE_LIB which really is the top level of "site-packages" instead of SAGE_SRC. This is what I am testing right now diff --git a/src/sage/plot/plot3d/base.pyx b/src/sage/plot/plot3d/base.pyx index 0ca1c71..6bb89e5 100644 --- a/src/sage/plot/plot3d/base.pyx +++ b/src/sage/plot/plot3d/base.pyx @@ -407,8 +407,8 @@ cdef class Graphics3d(SageObject): surfaces = flatten_list(surfaces) surfaces = '[' + ','.join(surfaces) + ']'

## Advertising

- from sage.env import SAGE_SRC - filename = os.path.join(SAGE_SRC, 'sage', + from sage.env import SAGE_LIB + filename = os.path.join(SAGE_LIB, 'sage', 'plot', 'plot3d', 'threejs_template.html') f = open(filename, 'r') html = f.read() diff --git a/src/setup.py b/src/setup.py index 7451519..7b96378 100755 --- a/src/setup.py +++ b/src/setup.py @@ -666,7 +666,7 @@ class sage_build_ext(build_ext): dist = self.distribution from sage_setup.find import find_extra_files self.cythonized_files = find_extra_files(dist.packages, - ".", SAGE_CYTHONIZED, ["ntlwrap.cpp"]) + ".", SAGE_CYTHONIZED, ["ntlwrap.cpp", "threejs_template.html"]) for (dst_dir, src_files) in self.cythonized_files: dst = os.path.join(self.build_lib, dst_dir) On 02/12/16 14:47, Paul Masson wrote:

François, I'm responsible for this but need more information. It was recommended by one of my reviewers that I keep an HTML template for Three.js support separate from the Python code and the template must be accessible at runtime. For this first version it's sitting in the source code next to the other 3d plotting files. Where should it actually go in the source so that it's accessible at runtime, both for developers and end users? I see many instances of SAGE_SRC in the source code but not so many of SAGE_LIB. I'm also not finding any documentation for SAGE_LIB. How are people supposed to know what is considered the proper use of the two locations? On Thursday, December 1, 2016 at 5:06:29 PM UTC-8, François wrote: Can please people stop using files in SAGE_SRC at runtime and people stop reviewing such things positively unless there is absolutely no choices. In sage/plot/plot3d/base.pyx we have line 410 and after: from sage.env import SAGE_SRC filename = os.path.join(SAGE_SRC, 'sage', 'plot', 'plot3d', 'threejs_template.html') f = open(filename, 'r') html = f.read() f.close() If you really need this at run time, ship it and access it relative to SAGE_LIB instead of SAGE_SRC. Thank you #12402. Francois On 02/12/16 12:15, Volker Braun wrote: > As always, you can get the latest beta version from the "develop" git > branch. Alternatively, the self-contained source tarball is at > http://www.sagemath.org/download-latest.html <http://www.sagemath.org/download-latest.html> > > 163489e Updated SageMath version to 7.5.beta5 > d1d859d Trac #22000: The coding conventions for INPUT: blocks have periods > 0d7c45d Trac #21805: Use psutil instead of various hacks > 909d9e1 Trac #12402: Make a three.js backend for 3d plotting > df2adac Trac #8181: cannot convert residue field elements back to p-adic > ring > f5afa90 Trac #21979: Wrong conversion from algebraic to interval > 6d380f9 Trac #21947: Don't let "tightpage" in view cut tikz images > ee25e65 Trac #21647: Doctest continuation marker / combinat > 4baf341 Trac #20692: Add sage-apply-patches helper script for use in > spkg-install scripts > 5944641 Trac #21988: Implement epimorphisms from finitely presented group. > 21d920f Trac #21982: Py3: Unicode errors in docstrings > 2306db0 Trac #21895: Better metaclass inference in dynamic classes > 14b6fe7 Trac #21911: Docstring for IncidenceStructure.is_uniform has issues > d7e2d06 Trac #21949: some various typos > 1490af2 Trac #21978: py3 richcmp in pyx files for finite rings > 94b5b1d Trac #21970: py3 richcmp in function fields (pyx) > 9acd3ad Trac #21967: little cleanup for universal cyclotomic field > 20ea82e Trac #21964: py3 richcmp in 2 pyx files (in structure and > symbolic folders) > 8cc8ff5 Trac #21491: IndexError in integral_points_count of Polyhedron > 056f5c6 Trac #21953: Chain complexes: implement shift (= translation = > suspension) > f022846 Trac #21929: Make "tightpage=True" the default behavior for view > 04deb1f Trac #21925: Remove some deprecated code > dc97fb2 Trac #21960: Get rid of six.itervalues in Cython > 0da1c25 Trac #21701: Compiling sagelib with clang on OS X (Sierra): > failure in cythonized sage/symbolic/expression.pyx > cbb59f1 Trac #21962: Don't import max from builtins > abd7ed7 Trac #21961: Get rid of six.moves.range in Cython files (step 4) > 2068019 Trac #21958: py3 richcmp in Laurent and power series (pyx files) > 113c7c2 Trac #21955: py3 get rid of cmp() in two pyx files in modular folder > 68a5e5a Trac #21938: Problem in the documentation of block design > 0cd8bb6 Trac #21930: Add rank for hypergraphs > 649379c Trac #21926: Deprecate unused stuff from sage/misc/misc.py > f9af853 Trac #21919: documentation of FiniteSetMaps(n) says it is over > {1, 2, ..., n} > e2729c8 Trac #21913: LatticePoset: Add certicate for > is_vertically_decomposable > 1ca5b30 Trac #21908: Fix _ascii_art_ for 0 in a CombinatorialFreeModule > 1b2e37c Trac #21607: Posets: with_linear_extension() and wrong constructor > 4c9e162 Trac #21513: Package rst2ipynb > c4df8bb Trac #17147: Overriding checks to generate poset and lattice faster > aa2bcc1 Updated SageMath version to 7.5.beta4 > > -- > You received this message because you are subscribed to the Google > Groups "sage-release" group. > To unsubscribe from this group and stop receiving emails from it, send > an email to sage-release...@googlegroups.com <javascript:> > <mailto:sage-release+unsubscr...@googlegroups.com <javascript:>>. > To post to this group, send email to sage-r...@googlegroups.com <javascript:> > <mailto:sage-r...@googlegroups.com <javascript:>>. > Visit this group at https://groups.google.com/group/sage-release <https://groups.google.com/group/sage-release>. > For more options, visit https://groups.google.com/d/optout <https://groups.google.com/d/optout>. -- You received this message because you are subscribed to the Google Groups "sage-release" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-release+unsubscr...@googlegroups.com <mailto:sage-release+unsubscr...@googlegroups.com>. To post to this group, send email to sage-release@googlegroups.com <mailto:sage-release@googlegroups.com>. Visit this group at https://groups.google.com/group/sage-release. For more options, visit https://groups.google.com/d/optout.

-- You received this message because you are subscribed to the Google Groups "sage-release" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-release+unsubscr...@googlegroups.com. To post to this group, send email to sage-release@googlegroups.com. Visit this group at https://groups.google.com/group/sage-release. For more options, visit https://groups.google.com/d/optout.