From 2f4e6e9406937d10decc7e82b4b1c5f3c529fcf6 Mon Sep 17 00:00:00 2001 From: Antonio Feregrino Date: Sun, 22 Jul 2018 13:26:20 +0100 Subject: [PATCH] Including the .js file --- MANIFEST.in | 13 +++++++++++++ README.md | 36 +++++++++++++++++++++++++++++++++++- setup.py | 4 ++-- 3 files changed, 50 insertions(+), 3 deletions(-) create mode 100644 MANIFEST.in diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000..fc810c5 --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1,13 @@ +# exclude from ANY directory +global-exclude *.ipynb +global-exclude *.py[cod] +global-exclude __pycache__ +global-exclude .git +global-exclude .ipynb_checkpoints +global-exclude .DS_Store +global-exclude *.sh + +# explicit includes +include README.md +include LICENSE +include jupygit/static/* \ No newline at end of file diff --git a/README.md b/README.md index d033147..429488a 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,36 @@ + # jupygit -Integrating Jupyter Notebooks to a git workflow... (at least an attempt 🤞) + +[![CircleCI](https://circleci.com/gh/fferegrino/jupygit.svg?style=svg)](https://circleci.com/gh/fferegrino/jupygit) [![PyPI](https://img.shields.io/pypi/v/jupygit.svg)](https://pypi.org/project/jupygit/) + +Integrating Jupyter Notebooks to a git workflow. + +#### First of all: is this a *hack*? +**yes, yes it is**. + +### Installation. +(I highly recommend installing this into a conda environment) + +To install the extension and enable it just run the following commands: +``` +pip install jupygit +jupyter serverextension enable --py jupygit --sys-prefix +jupyter nbextension install --py jupygit --sys-prefix +jupyter nbextension enable --py jupygit --sys-prefix +``` + +### Why? +I've been working with Jupyter Notebooks for a while, and I always felt something dying inside me everytime I pushed a massive file to GitHub, only to have it overwritten by my next **huge** commit causing me to have unreadable diffs. I decided to create this extension that, as I previously stated, is a hack. + +### How? (and usage) +Let's say you are working on a file called `Awesome.ipynb`. What this extension will do once you press shiny new **git** button on your Notebook is: + + 1. Rename your current file to `Awesome-jupygit___.ipynb` using Jupyter's API so that your kernel stays alive and you do not lose any work, we'll call this the *"dirty"* file. + 2. Adds the pattern `*-jupygit___.ipynb` to your .gitignore file, so that your *"dirty"* file does not show up as a new file in your git repository. + 3. Creates a copy of `Awesome-jupygit___.ipynb` but with the original name `Awesome.ipynb`, this copy is clean, no outputs and no `execution_counts`, we'll call this the *"clean"* file. + 4. Now is your turn to commit `Awesome.ipynb`, the *"clean"* file to source control! + +Are you done pushing things to Git? Now press the **git** button again and the extension will: + + 1. Delete the file `Awesome.ipynb` (do not worry! your kernel and work is safe in the *"dirty"* file). + 2. Rename `Awesome-jupygit___.ipynb` to `Awesome.ipynb` so that you can resume your work where you left it before being a good human and using source control. \ No newline at end of file diff --git a/setup.py b/setup.py index 8b21d2a..3a193af 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ long_description = fh.read() # Package version -VERSION = "0.1.1" +VERSION = "0.1.2" class VerifyVersionCommand(install): """Custom command to verify that the git tag matches our version""" @@ -32,8 +32,8 @@ def run(self): description="Prepare your Notebooks to be pushed to GitHub", long_description=long_description, long_description_content_type="text/markdown", - packages=find_packages(), include_package_data=True, + packages=find_packages(), cmdclass={ 'verify': VerifyVersionCommand, }