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

How to install package locally for local builds #81

Open
asmeurer opened this issue Jan 5, 2023 · 1 comment
Open

How to install package locally for local builds #81

asmeurer opened this issue Jan 5, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@asmeurer
Copy link

asmeurer commented Jan 5, 2023

Problem

I'm looking into using this in the SymPy documentation. We have 4 different types of documentation builds, the "latest" docs which are updated whenever we do a release (https://docs.sympy.org/latest/index.html), the "dev" docs which get updated automatically whenever sympy master is updated (https://docs.sympy.org/dev/index.html), PR preview builds (e.g., https://output.circle-artifacts.com/output/job/c652bab0-554b-460e-8a57-ced8c5f3c99a/artifacts/0/doc/_build/html/index.html), and local builds, which is any build that would be done locally.

Is it possible to make jupyterlite automatically install the correct corresponding SymPy package? For the "latest" builds, it is already correct since it will pull in the latest package from the repository (except for a possible lag between when sympy gets released to pypi and when it gets released to the micropip repos, which I'm assuming won't be a big deal).

For dev builds, it should install from the git master. Can micropip install from git? It's not clear from https://micropip.pyodide.org/en/stable/project/api.html whether it can. I'd prefer not to have to upload a package build artifact to GitHub pages for every build.

Similarly, for PR preview builds ideally it should install the version from the corresponding PR commit.

For local builds, it ideally should install from the local copy of SymPy. Is this possible? I know the browser limits access to the filesystem, but maybe this can be done as part of the build step, or maybe just by starting the local webserver at the root of the git repo so that it can access the package files in addition to the built docs.

I already know how to use a different configuration in conf.py depending on which build is happening, so the question is mainly about whether it is possible to install from the different sources, especially locally.

Obviously this isn't a huge issue, but I think it would be confusing for developers if they develop a notebook for the documentation and it doesn't run the version of SymPy they are developing. If the notebook uses some feature they are developing, they won't be able to test it in the docs.

Proposed Solution

Additional context

@asmeurer asmeurer added the enhancement New feature or request label Jan 5, 2023
@martinRenou
Copy link
Member

Thank you for opening an issue. I suppose micropip cannot install from a git repository, but maybe it's worth trying?

I'm currently working on supporting pre-installing pip packages in xeus-python kernels for Jupyterlite in this PR, I suppose this would ease this kind of setup, and you wouldn't need to use micropip anymore, SymPy would be already installed for your users.

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

No branches or pull requests

2 participants