{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# A long time without news" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Since Last post lots of things happend, I had 2 [pull](https://github.com/Carreau/posts/pull/5) [requests](https://github.com/Carreau/posts/pull/4) on github to fix some typos on previous posts (now updated). We had yet another Jupyter/IPython developper meeting in Berkeley. \n", "By the way, part of IPython will be renamed Jupyter. See [Fernando Perez Slides and Talk](https://speakerdeck.com/fperez/project-jupyter). I got my PhD on my spare time when not workin on IPython. Went to EuroSciPy, hacked in London In Bloomberg Headquarters for a week-end organized by BloomberLab, got a Post Doc at Berkeley BIDS under the direction of above cited IPython BDFL and is about to move almost 9000 km from my current location to spen a year working on improving your everyday scientific workflow from the West of United-States, I think that's not too bad. " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Since I got a little more time than usual to do some python everyday since this \n", "is officially my day job I was confronted to a few pyton problems, and also sa some amazing stuff.\n", "\n", "Eg, James Powel Ast Expression hack of CPyhton: \n", "[(original tweet)](https://twitter.com/dontusethiscode/status/538690194825039872)\n", "\n", "```\n", ">>> e = $(x+y) * w * x\n", ">>> e(x = $z+10, w = 20)(30, 40)\n", "(\u00d7, [(\u00d7, [(+, [(+, [40, 10]), 30]), 20]), (+, [40, 10])])\n", ">>> _()\n", "80000\n", "```\n", "\n", "Give you unbound python expression that you can manipulate as you like. \n", "Pretty awesome, and would allow some neat meta programming. Woudl be nice \n", "if he could release his patch so that we could play with it." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "A discussion with Olivier Grisel (sikit-learn) raised the point that a good package to deal with deprecation would be nice. Not just deprecation warning, but a decorator/context manager that takes as parameter the version of the software at which point a feature is removed and warn you that you have soem code you can clean.\n", "\n", "Using grep to find deprecation warning don't always work, and sometime you would like a flag to just raise instead of printing a deprecation warning, or even do nothing when you are developpin aginst dev library." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## And on the code side ?" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Jupyter/IPython 3.0 is on its way. Slowly, we are late as usual.Recap will come at the right time.\n", "\n", "I am working on integratin with [Google Drive](https://github.com/jupyter/jupyter-drive), and will try to add real-time synchronisation to Jupyter 1.0/IPython 4.0. IWe plan on addin other Operational Transform library backend, but workin on Google drive first got me my post doc. (Yes Google signed a Check to UC Berkeley)\n", "\n", "Of course new project mean more packagin, and as you all know Python packaging is painfull. \n", "Especially when starting a new project you need to get all the basic files...etc.\n", "\n", "Of course you can use project like [audrayr/cookiecutter](https://github.com/audreyr/cookiecutter), but the you stil have the hassle to :\n", " - set up the GitHub repository, \n", " - Find a name\n", " - Hook Travis-CI find the annoyin setting that let you trigger build.\n", " - Hook up Readthedoc, \n", " - ... [1]\n", " - And so on and so forth\n", " \n", "[1] add everything that every project should do." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "I stronly believe that intelligence shoudl be in the package-manager, not the packager, and my few experiences with [julia](https://github.com/JuliaLang) `Pgk`, and a small adventure with nodejs `npm` convinced me that there is really something wrong with Python packagin." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "I'm not for a complete rewrite of it, and I completly understand the need for really custom setup script, but the complexity just to create a python package is too high. SO as a week-end hack introducing..." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Pip Create" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "So yes I know that cookiecutter as pre- and post- hooks that might allow you to do that, but that's not the point. \n", "I just want a (few) simple command I can remember and which can do most of the heavy liftin for me.\n", "\n", "I shamelessly call it `PipCreate`, because I hope that at some point in the future you will be able to just do a `$pip create` to enerate a new package.\n", "\n", "So to work beyond dependencies, it just need a GitHub Private token (and maybe that you once loin to TravisCI, but haven't tested). The best thin is, if you don't have github token availlble, it will even open the browser for you at the right page. Here are teh step:\n", "\n", "```bash\n", "$ python3 -m pipcreate # need to create a real executable in future\n", "```" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Now either it grabs the github token from your keychain, or ask you for it and then does all the rest for you:\n", "\n", "```bash\n", "$ python3 -m pipcreate\n", "will use target dir /Users/bussonniermatthias/eraseme\n", "Comparing \"SoftLilly\" to other existing package name...\n", "SoftLilly seem to have a sufficiently specific name\n", "Logged in on GitHub as Matthias Bussonnier\n", "Workin with repository Carreau/SoftLilly\n", "Clonning github repository locally\n", "Cloning into 'SoftLilly'...\n", "warning: You appear to have cloned an empty repository.\n", "Checking connectivity... done.\n", "I am now in /Users/bussonniermatthias/eraseme/SoftLilly\n", "Travis user: Matthias Bussonnier\n", "syncing Travis with Github, this can take a while...\n", ".....\n", "syncing done\n", "Enabling travis hooks for this repository\n", "Travis hook for this repository are now enabled.\n", "Continuous interation test shoudl be triggerd everytime you push code to github\n", "/Users/bussonniermatthias/eraseme/SoftLilly\n", "[master (root-commit) f4a9a5d] 'initial commit of SoftLilly'\n", " 28 files changed, 1167 insertions(+)\n", " create mode 100644 .editorconfig\n", " create mode 100644 .gitignore\n", " create mode 100644 .travis.yml\n", " create mode 100644 AUTHORS.rst\n", " create mode 100644 CONTRIBUTING.rst\n", " create mode 100644 HISTORY.rst\n", " create mode 100644 LICENSE\n", " create mode 100644 MANIFEST.in\n", " create mode 100644 Makefile\n", " create mode 100644 README.rst\n", " create mode 100644 docs/Makefile\n", " create mode 100644 docs/authors.rst\n", " create mode 100755 docs/conf.py\n", " create mode 100644 docs/contributing.rst\n", " create mode 100644 docs/history.rst\n", " create mode 100644 docs/index.rst\n", " create mode 100644 docs/installation.rst\n", " create mode 100644 docs/make.bat\n", " create mode 100644 docs/readme.rst\n", " create mode 100644 docs/usage.rst\n", " create mode 100644 requirements.txt\n", " create mode 100644 setup.cfg\n", " create mode 100755 setup.py\n", " create mode 100755 softlilly/__init__.py\n", " create mode 100755 softlilly/softlilly.py\n", " create mode 100755 tests/__init__.py\n", " create mode 100755 tests/test_softlilly.py\n", " create mode 100644 tox.ini\n", "Counting objects: 32, done.\n", "Delta compression using up to 4 threads.\n", "Compressing objects: 100% (25/25), done.\n", "Writing objects: 100% (32/32), 13.41 KiB | 0 bytes/s, done.\n", "Total 32 (delta 0), reused 0 (delta 0)\n", "To git@github.com:Carreau/SoftLilly.git\n", " * [new branch] master -> master\n", "```" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "It finishes up by openin travis on the test page after a push so that you can see the first test passin after a few seconds." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Hope that will give you soem ideas and patch welcomes." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Anyway, late now, Have fun, PR [if you see typos](https://github.com/Carreau/posts) are welcommed too." ] } ], "metadata": { "kernelspec": { "display_name": "IPython (Python 3)", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.4.2" }, "signature": "sha256:1e73ea0e885865be1effebc240db25f00efc41937427797aafdaffbf60af8b79" }, "nbformat": 4, "nbformat_minor": 0 }