Skip to content

Add Python packaging #1

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

Open
wants to merge 15 commits into
base: main
Choose a base branch
from
Open

Add Python packaging #1

wants to merge 15 commits into from

Conversation

mkoeppe
Copy link

@mkoeppe mkoeppe commented Nov 29, 2020

We add Python packaging scripts, following the model of https://github.com/jupyter-widgets/ipywidgets

By running python3 setup.py sdist, a source distribution can be created, which can then be uploaded to PyPI. The PyPI tarball can then become the upstream tarball for the Sage distribution. Users can also install it into the virtual environment where the Jupyter notebook runs using pip. No more symlinking required.

The idea for versioning is that jupyter_threejs_sage/static will contain and ship all versions of threejs that are relevant for Sage releases. Right now there is only one version, r122, but if that makes it into Sage 9.3 but for Sage 9.4 we switch to (incompatible) version r155, then the new distribution of this package will ship both r122 and r155. In this way, when this package is installed into the virtual environment that runs the Jupyter notebook, it will work with both Sage 9.3 and Sage 9.4.

@mkoeppe
Copy link
Author

mkoeppe commented Dec 1, 2020

@paulmasson When you have a chance, please take a look at the updated instructions in README.md. Thanks!

@paulmasson
Copy link
Collaborator

@mkoeppe I only committed to building the JavaScript library because your build is a simple extension of my own custom build and can be done at the same time with little extra effort. I did not commit to anything to do with Python distribution and have no desire to do so.

This repository should be just the JavaScript build. Anything Python related should be in a separate repository. This repository is intended to parallel releases in the source repository and nothing more.

Furthermore, including a second entire copy of the library goes strongly against the JavaScript mindset. This repository should only have one copy of the library in each release.

@mkoeppe
Copy link
Author

mkoeppe commented Dec 4, 2020

We can get rid of the copy in build/ by adjusting the paths, then there is only one copy.

@mkoeppe
Copy link
Author

mkoeppe commented Dec 4, 2020

No worries, I will set up an automatic github action that publishes the Python package to PyPI.

I just want to be sure that the updates that I added in README.md are clear to you. Perhaps you could comment on this specific point?

@mkoeppe
Copy link
Author

mkoeppe commented Dec 4, 2020

Merged the update to r123 from main. Updating the version is now easier – it is no longer needed to make edits to the Python files on an update.

@mkoeppe
Copy link
Author

mkoeppe commented Dec 4, 2020

This repository should be just the JavaScript build. Anything Python related should be in a separate repository. This repository is intended to parallel releases in the source repository and nothing more.

I am guessing that you are still concerned about the github repo archive tarball that you are using as the upstream tarball in https://trac.sagemath.org/ticket/30915 – well, https://trac.sagemath.org/ticket/30123 changes the upstream tarball of "threejs" to the source archive that is uploaded to PyPI.org (see https://pypi.org/project/jupyter-threejs-sage/#files). So there is no need to be concerned about that tarball – with 30123, it will no longer be used.

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