Files
catalyst/release-process.html
T
2017-10-19 15:49:01 -06:00

625 lines
38 KiB
HTML

<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Release Process &mdash; Catalyst 0.3 documentation</title>
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<link rel="top" title="Catalyst 0.3 documentation" href="index.html"/>
<link rel="next" title="Release Notes" href="releases.html"/>
<link rel="prev" title="API Reference" href="appendix.html"/>
<script src="_static/js/modernizr.min.js"></script>
</head>
<body class="wy-body-for-nav" role="document">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-nav-search">
<a href="index.html" class="icon icon-home"> Catalyst
</a>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
<input type="text" name="q" placeholder="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="install.html">Install</a><ul>
<li class="toctree-l2"><a class="reference internal" href="install.html#installing-with-pip">Installing with <code class="docutils literal"><span class="pre">pip</span></code></a><ul>
<li class="toctree-l3"><a class="reference internal" href="install.html#gnu-linux">GNU/Linux</a></li>
<li class="toctree-l3"><a class="reference internal" href="install.html#osx">OSX</a></li>
<li class="toctree-l3"><a class="reference internal" href="install.html#windows">Windows</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="install.html#installing-with-conda">Installing with <code class="docutils literal"><span class="pre">conda</span></code></a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="beginner-tutorial.html">Zipline Beginner Tutorial</a><ul>
<li class="toctree-l2"><a class="reference internal" href="beginner-tutorial.html#basics">Basics</a></li>
<li class="toctree-l2"><a class="reference internal" href="beginner-tutorial.html#my-first-algorithm">My first algorithm</a></li>
<li class="toctree-l2"><a class="reference internal" href="beginner-tutorial.html#running-the-algorithm">Running the algorithm</a><ul>
<li class="toctree-l3"><a class="reference internal" href="beginner-tutorial.html#ingesting-data">Ingesting Data</a></li>
<li class="toctree-l3"><a class="reference internal" href="beginner-tutorial.html#command-line-interface">Command line interface</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="beginner-tutorial.html#ipython-notebook">IPython Notebook</a></li>
<li class="toctree-l2"><a class="reference internal" href="beginner-tutorial.html#access-to-previous-prices-using-history">Access to previous prices using <code class="docutils literal"><span class="pre">history</span></code></a><ul>
<li class="toctree-l3"><a class="reference internal" href="beginner-tutorial.html#working-example-dual-moving-average-cross-over">Working example: Dual Moving Average Cross-Over</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="beginner-tutorial.html#conclusions">Conclusions</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="bundles.html">Data Bundles</a><ul>
<li class="toctree-l2"><a class="reference internal" href="bundles.html#discovering-available-bundles">Discovering Available Bundles</a></li>
<li class="toctree-l2"><a class="reference internal" href="bundles.html#ingesting-data">Ingesting Data</a></li>
<li class="toctree-l2"><a class="reference internal" href="bundles.html#old-data">Old Data</a></li>
<li class="toctree-l2"><a class="reference internal" href="bundles.html#running-backtests-with-data-bundles">Running Backtests with Data Bundles</a></li>
<li class="toctree-l2"><a class="reference internal" href="bundles.html#default-data-bundles">Default Data Bundles</a><ul>
<li class="toctree-l3"><a class="reference internal" href="bundles.html#quandl-wiki-bundle">Quandl WIKI Bundle</a><ul>
<li class="toctree-l4"><a class="reference internal" href="bundles.html#quantopian-quandl-wiki-mirror">Quantopian Quandl WIKI Mirror</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="bundles.html#yahoo-bundle-factories">Yahoo Bundle Factories</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="bundles.html#writing-a-new-bundle">Writing a New Bundle</a><ul>
<li class="toctree-l3"><a class="reference internal" href="bundles.html#environ"><code class="docutils literal"><span class="pre">environ</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="bundles.html#asset-db-writer"><code class="docutils literal"><span class="pre">asset_db_writer</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="bundles.html#minute-bar-writer"><code class="docutils literal"><span class="pre">minute_bar_writer</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="bundles.html#daily-bar-writer"><code class="docutils literal"><span class="pre">daily_bar_writer</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="bundles.html#adjustment-writer"><code class="docutils literal"><span class="pre">adjustment_writer</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="bundles.html#calendar"><code class="docutils literal"><span class="pre">calendar</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="bundles.html#start-session"><code class="docutils literal"><span class="pre">start_session</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="bundles.html#end-session"><code class="docutils literal"><span class="pre">end_session</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="bundles.html#cache"><code class="docutils literal"><span class="pre">cache</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="bundles.html#show-progress"><code class="docutils literal"><span class="pre">show_progress</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="bundles.html#output-dir"><code class="docutils literal"><span class="pre">output_dir</span></code></a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="development-guidelines.html">Development Guidelines</a><ul>
<li class="toctree-l2"><a class="reference internal" href="development-guidelines.html#creating-a-development-environment">Creating a Development Environment</a></li>
<li class="toctree-l2"><a class="reference internal" href="development-guidelines.html#development-with-docker">Development with Docker</a></li>
<li class="toctree-l2"><a class="reference internal" href="development-guidelines.html#style-guide-running-tests">Style Guide &amp; Running Tests</a></li>
<li class="toctree-l2"><a class="reference internal" href="development-guidelines.html#continuous-integration">Continuous Integration</a></li>
<li class="toctree-l2"><a class="reference internal" href="development-guidelines.html#packaging">Packaging</a></li>
<li class="toctree-l2"><a class="reference internal" href="development-guidelines.html#contributing-to-the-docs">Contributing to the Docs</a></li>
<li class="toctree-l2"><a class="reference internal" href="development-guidelines.html#commit-messages">Commit messages</a></li>
<li class="toctree-l2"><a class="reference internal" href="development-guidelines.html#formatting-docstrings">Formatting Docstrings</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="appendix.html">API Reference</a><ul>
<li class="toctree-l2"><a class="reference internal" href="appendix.html#running-a-backtest">Running a Backtest</a></li>
<li class="toctree-l2"><a class="reference internal" href="appendix.html#algorithm-api">Algorithm API</a><ul>
<li class="toctree-l3"><a class="reference internal" href="appendix.html#data-object">Data Object</a></li>
<li class="toctree-l3"><a class="reference internal" href="appendix.html#scheduling-functions">Scheduling Functions</a></li>
<li class="toctree-l3"><a class="reference internal" href="appendix.html#orders">Orders</a><ul>
<li class="toctree-l4"><a class="reference internal" href="appendix.html#order-cancellation-policies">Order Cancellation Policies</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="appendix.html#assets">Assets</a></li>
<li class="toctree-l3"><a class="reference internal" href="appendix.html#trading-controls">Trading Controls</a></li>
<li class="toctree-l3"><a class="reference internal" href="appendix.html#simulation-parameters">Simulation Parameters</a><ul>
<li class="toctree-l4"><a class="reference internal" href="appendix.html#commission-models">Commission Models</a></li>
<li class="toctree-l4"><a class="reference internal" href="appendix.html#slippage-models">Slippage Models</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="appendix.html#pipeline">Pipeline</a></li>
<li class="toctree-l3"><a class="reference internal" href="appendix.html#miscellaneous">Miscellaneous</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="appendix.html#pipeline-api">Pipeline API</a><ul>
<li class="toctree-l3"><a class="reference internal" href="appendix.html#built-in-factors">Built-in Factors</a></li>
<li class="toctree-l3"><a class="reference internal" href="appendix.html#pipeline-engine">Pipeline Engine</a></li>
<li class="toctree-l3"><a class="reference internal" href="appendix.html#data-loaders">Data Loaders</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="appendix.html#asset-metadata">Asset Metadata</a></li>
<li class="toctree-l2"><a class="reference internal" href="appendix.html#trading-calendar-api">Trading Calendar API</a></li>
<li class="toctree-l2"><a class="reference internal" href="appendix.html#data-api">Data API</a><ul>
<li class="toctree-l3"><a class="reference internal" href="appendix.html#writers">Writers</a></li>
<li class="toctree-l3"><a class="reference internal" href="appendix.html#readers">Readers</a></li>
<li class="toctree-l3"><a class="reference internal" href="appendix.html#bundles">Bundles</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="appendix.html#utilities">Utilities</a><ul>
<li class="toctree-l3"><a class="reference internal" href="appendix.html#caching">Caching</a></li>
<li class="toctree-l3"><a class="reference internal" href="appendix.html#command-line">Command Line</a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l1 current"><a class="current reference internal" href="">Release Process</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#updating-the-release-notes">Updating the Release Notes</a></li>
<li class="toctree-l2"><a class="reference internal" href="#updating-the-python-stub-files">Updating the Python stub files</a></li>
<li class="toctree-l2"><a class="reference internal" href="#updating-the-version">Updating the <code class="docutils literal"><span class="pre">__version__</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="#uploading-pypi-packages">Uploading PyPI packages</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#sdist"><code class="docutils literal"><span class="pre">sdist</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="#bdist"><code class="docutils literal"><span class="pre">bdist</span></code></a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="#documentation">Documentation</a></li>
<li class="toctree-l2"><a class="reference internal" href="#uploading-conda-packages">Uploading conda packages</a></li>
<li class="toctree-l2"><a class="reference internal" href="#next-commit">Next Commit</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="releases.html">Release Notes</a><ul>
<li class="toctree-l2"><a class="reference internal" href="releases.html#development">Development</a><ul>
<li class="toctree-l3"><a class="reference internal" href="releases.html#highlights">Highlights</a></li>
<li class="toctree-l3"><a class="reference internal" href="releases.html#enhancements">Enhancements</a></li>
<li class="toctree-l3"><a class="reference internal" href="releases.html#experimental-features">Experimental Features</a></li>
<li class="toctree-l3"><a class="reference internal" href="releases.html#bug-fixes">Bug Fixes</a></li>
<li class="toctree-l3"><a class="reference internal" href="releases.html#performance">Performance</a></li>
<li class="toctree-l3"><a class="reference internal" href="releases.html#maintenance-and-refactorings">Maintenance and Refactorings</a></li>
<li class="toctree-l3"><a class="reference internal" href="releases.html#build">Build</a></li>
<li class="toctree-l3"><a class="reference internal" href="releases.html#documentation">Documentation</a></li>
<li class="toctree-l3"><a class="reference internal" href="releases.html#miscellaneous">Miscellaneous</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="releases.html#release-1-1-0">Release 1.1.0</a><ul>
<li class="toctree-l3"><a class="reference internal" href="releases.html#id1">Enhancements</a></li>
<li class="toctree-l3"><a class="reference internal" href="releases.html#id2">Bug Fixes</a></li>
<li class="toctree-l3"><a class="reference internal" href="releases.html#id3">Performance</a></li>
<li class="toctree-l3"><a class="reference internal" href="releases.html#id4">Maintenance and Refactorings</a></li>
<li class="toctree-l3"><a class="reference internal" href="releases.html#id5">Build</a></li>
<li class="toctree-l3"><a class="reference internal" href="releases.html#id6">Documentation</a></li>
<li class="toctree-l3"><a class="reference internal" href="releases.html#id7">Miscellaneous</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="releases.html#release-1-0-2">Release 1.0.2</a><ul>
<li class="toctree-l3"><a class="reference internal" href="releases.html#id8">Enhancements</a></li>
<li class="toctree-l3"><a class="reference internal" href="releases.html#experimental">Experimental</a></li>
<li class="toctree-l3"><a class="reference internal" href="releases.html#id9">Bug Fixes</a></li>
<li class="toctree-l3"><a class="reference internal" href="releases.html#id10">Performance</a></li>
<li class="toctree-l3"><a class="reference internal" href="releases.html#id11">Maintenance and Refactorings</a></li>
<li class="toctree-l3"><a class="reference internal" href="releases.html#id12">Documentation</a></li>
<li class="toctree-l3"><a class="reference internal" href="releases.html#testing">Testing</a></li>
<li class="toctree-l3"><a class="reference internal" href="releases.html#data-format-changes">Data Format Changes</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="releases.html#release-1-0-1">Release 1.0.1</a><ul>
<li class="toctree-l3"><a class="reference internal" href="releases.html#id13">Enhancements</a></li>
<li class="toctree-l3"><a class="reference internal" href="releases.html#id14">Bug Fixes</a></li>
<li class="toctree-l3"><a class="reference internal" href="releases.html#id15">Documentation</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="releases.html#release-1-0-0">Release 1.0.0</a><ul>
<li class="toctree-l3"><a class="reference internal" href="releases.html#id16">Highlights</a><ul>
<li class="toctree-l4"><a class="reference internal" href="releases.html#zipline-1-0-rewrite-1105">Zipline 1.0 Rewrite (#1105)</a></li>
<li class="toctree-l4"><a class="reference internal" href="releases.html#new-entry-points-1173-and-1178">New Entry Points (#1173 and #1178)</a></li>
<li class="toctree-l4"><a class="reference internal" href="releases.html#data-bundles-1173-and-1178">Data Bundles (#1173 and #1178)</a></li>
<li class="toctree-l4"><a class="reference internal" href="releases.html#string-support-in-pipeline-1174">String Support in Pipeline (#1174)</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="releases.html#id17">Enhancements</a></li>
<li class="toctree-l3"><a class="reference internal" href="releases.html#id18">Experimental Features</a></li>
<li class="toctree-l3"><a class="reference internal" href="releases.html#id19">Bug Fixes</a></li>
<li class="toctree-l3"><a class="reference internal" href="releases.html#id20">Performance</a></li>
<li class="toctree-l3"><a class="reference internal" href="releases.html#id21">Maintenance and Refactorings</a></li>
<li class="toctree-l3"><a class="reference internal" href="releases.html#id22">Build</a></li>
<li class="toctree-l3"><a class="reference internal" href="releases.html#id23">Documentation</a></li>
<li class="toctree-l3"><a class="reference internal" href="releases.html#id24">Miscellaneous</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="releases.html#release-0-9-0">Release 0.9.0</a><ul>
<li class="toctree-l3"><a class="reference internal" href="releases.html#id25">Highlights</a></li>
<li class="toctree-l3"><a class="reference internal" href="releases.html#id26">Enhancements</a></li>
<li class="toctree-l3"><a class="reference internal" href="releases.html#id27">Experimental Features</a></li>
<li class="toctree-l3"><a class="reference internal" href="releases.html#id28">Bug Fixes</a></li>
<li class="toctree-l3"><a class="reference internal" href="releases.html#id29">Performance</a></li>
<li class="toctree-l3"><a class="reference internal" href="releases.html#id30">Maintenance and Refactorings</a></li>
<li class="toctree-l3"><a class="reference internal" href="releases.html#id31">Build</a></li>
<li class="toctree-l3"><a class="reference internal" href="releases.html#id32">Documentation</a></li>
<li class="toctree-l3"><a class="reference internal" href="releases.html#id33">Miscellaneous</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="releases.html#release-0-8-4">Release 0.8.4</a><ul>
<li class="toctree-l3"><a class="reference internal" href="releases.html#id34">Highlights</a></li>
<li class="toctree-l3"><a class="reference internal" href="releases.html#id35">Enhancements</a></li>
<li class="toctree-l3"><a class="reference internal" href="releases.html#id36">Experimental Features</a></li>
<li class="toctree-l3"><a class="reference internal" href="releases.html#id37">Bug Fixes</a></li>
<li class="toctree-l3"><a class="reference internal" href="releases.html#id38">Performance</a></li>
<li class="toctree-l3"><a class="reference internal" href="releases.html#id39">Maintenance and Refactorings</a></li>
<li class="toctree-l3"><a class="reference internal" href="releases.html#id40">Build</a></li>
<li class="toctree-l3"><a class="reference internal" href="releases.html#id41">Documentation</a></li>
<li class="toctree-l3"><a class="reference internal" href="releases.html#id42">Miscellaneous</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="releases.html#release-0-8-3">Release 0.8.3</a></li>
<li class="toctree-l2"><a class="reference internal" href="releases.html#release-0-8-0">Release 0.8.0</a><ul>
<li class="toctree-l3"><a class="reference internal" href="releases.html#id43">Highlights</a></li>
<li class="toctree-l3"><a class="reference internal" href="releases.html#id44">Enhancements</a></li>
<li class="toctree-l3"><a class="reference internal" href="releases.html#id45">Experimental Features</a></li>
<li class="toctree-l3"><a class="reference internal" href="releases.html#id46">Bug Fixes</a></li>
<li class="toctree-l3"><a class="reference internal" href="releases.html#id47">Performance</a></li>
<li class="toctree-l3"><a class="reference internal" href="releases.html#id48">Maintenance and Refactorings</a></li>
<li class="toctree-l3"><a class="reference internal" href="releases.html#id49">Build</a></li>
<li class="toctree-l3"><a class="reference internal" href="releases.html#id50">Documentation</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="releases.html#release-0-7-0">Release 0.7.0</a><ul>
<li class="toctree-l3"><a class="reference internal" href="releases.html#id51">Highlights</a></li>
<li class="toctree-l3"><a class="reference internal" href="releases.html#id52">Enhancements</a></li>
<li class="toctree-l3"><a class="reference internal" href="releases.html#id53">Bug Fixes</a></li>
<li class="toctree-l3"><a class="reference internal" href="releases.html#id54">Performance</a></li>
<li class="toctree-l3"><a class="reference internal" href="releases.html#id55">Maintenance and Refactorings</a></li>
<li class="toctree-l3"><a class="reference internal" href="releases.html#id56">Build</a></li>
<li class="toctree-l3"><a class="reference internal" href="releases.html#contributors">Contributors</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="releases.html#release-0-6-1">Release 0.6.1</a><ul>
<li class="toctree-l3"><a class="reference internal" href="releases.html#id57">Highlights</a></li>
<li class="toctree-l3"><a class="reference internal" href="releases.html#id58">Enhancements</a></li>
<li class="toctree-l3"><a class="reference internal" href="releases.html#id59">Bug Fixes</a></li>
<li class="toctree-l3"><a class="reference internal" href="releases.html#id60">Performance</a></li>
<li class="toctree-l3"><a class="reference internal" href="releases.html#id61">Maintenance and Refactorings</a></li>
<li class="toctree-l3"><a class="reference internal" href="releases.html#id62">Build</a></li>
<li class="toctree-l3"><a class="reference internal" href="releases.html#id63">Contributors</a></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
&nbsp;
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="index.html">Catalyst</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="index.html">Docs</a> &raquo;</li>
<li>Release Process</li>
<li class="wy-breadcrumbs-aside">
<a href="_sources/release-process.txt" rel="nofollow"> View page source</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document">
<div class="section" id="release-process">
<h1>Release Process<a class="headerlink" href="#release-process" title="Permalink to this headline"></a></h1>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">This page is intended for developers of zipline.</p>
</div>
<div class="section" id="updating-the-release-notes">
<h2>Updating the Release Notes<a class="headerlink" href="#updating-the-release-notes" title="Permalink to this headline"></a></h2>
<p>When we are ready to ship a new release of zipline, edit the <a class="reference internal" href="releases.html"><em>Release Notes</em></a>
page. We will have been maintaining a whatsnew file while working on the release
with the new version. First, find that file in:
<code class="docutils literal"><span class="pre">docs/source/whatsnew/&lt;version&gt;.txt</span></code>. It will be the highest version number.
Edit the release date field to be today&#8217;s date in the format:</p>
<div class="highlight-python"><div class="highlight"><pre>&lt;month&gt; &lt;day&gt;, &lt;year&gt;
</pre></div>
</div>
<p>for example, November 6, 2015.
Remove the active development warning from the whatsnew, since it will no
longer be pending release.
Update the title of the release from &#8220;Development&#8221; to &#8220;Release x.x.x&#8221; and
update the underline of the title to match the title&#8217;s width.</p>
<p>If you are renaming the release at this point, you&#8217;ll need to git mv the file
and also update releases.rst to reference the renamed file.</p>
<p>To build and view the docs locally, run:</p>
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span><span class="nb">cd </span>docs
<span class="nv">$ </span>make html
<span class="nv">$ </span><span class="o">{</span>BROWSER<span class="o">}</span> build/html/index.html
</pre></div>
</div>
</div>
<div class="section" id="updating-the-python-stub-files">
<h2>Updating the Python stub files<a class="headerlink" href="#updating-the-python-stub-files" title="Permalink to this headline"></a></h2>
<p>PyCharm and other linters and type checkers can use <a class="reference external" href="https://www.python.org/dev/peps/pep-0484/#stub-files">Python stub files</a> for type hinting. For
example, we generate stub files for the <code class="xref py py-mod docutils literal"><span class="pre">api</span></code> namespace, since that
namespace is populated at import time by decorators on TradingAlgorithm
methods. Those functions are therefore hidden from static analysis tools, but
we can generate static files to make them available. Under <strong>Python 3</strong>, run
the following to generate any stub files:</p>
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>python etc/gen_type_stubs.py
</pre></div>
</div>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">In order to make stub consumers aware of the classes referred to in the
stub, the stub file should import those classes. However, since
<code class="docutils literal"><span class="pre">...</span> <span class="pre">import</span> <span class="pre">*</span></code> and <code class="docutils literal"><span class="pre">...</span> <span class="pre">import</span> <span class="pre">...</span> <span class="pre">as</span> <span class="pre">...</span></code> in a stub file will export
those imports, we import the names explicitly. For the stub for
<code class="docutils literal"><span class="pre">zipline.api</span></code>, this is done in a header string in the
<code class="docutils literal"><span class="pre">gen_type_stubs.py</span></code> script mentioned above. If new classes are added as
parameters or return types of <code class="docutils literal"><span class="pre">zipline.api</span></code> functions, then new imports
should be added to that header.</p>
</div>
</div>
<div class="section" id="updating-the-version">
<h2>Updating the <code class="docutils literal"><span class="pre">__version__</span></code><a class="headerlink" href="#updating-the-version" title="Permalink to this headline"></a></h2>
<p>We use <a class="reference external" href="https://github.com/warner/python-versioneer">versioneer</a> to
manage the <code class="docutils literal"><span class="pre">__version__</span></code> and <code class="docutils literal"><span class="pre">setup.py</span></code> version. This means that we pull
this information from our version control&#8217;s tags to ensure that they stay in
sync and to have very fine grained version strings for development installs.</p>
<p>To upgrade the version use the git tag command like:</p>
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>git tag &lt;major&gt;.&lt;minor&gt;.&lt;micro&gt;
<span class="nv">$ </span>git push <span class="o">&amp;&amp;</span> git push --tags
</pre></div>
</div>
<p>This will push the the code and the tag information.</p>
<p>Next, click the &#8220;Draft a new release&#8221; button on the <a class="reference external" href="https://github.com/quantopian/zipline/releases">zipline releases page</a>. For the new release,
choose the tag you just pushed, and publish the release.</p>
</div>
<div class="section" id="uploading-pypi-packages">
<h2>Uploading PyPI packages<a class="headerlink" href="#uploading-pypi-packages" title="Permalink to this headline"></a></h2>
<div class="section" id="sdist">
<h3><code class="docutils literal"><span class="pre">sdist</span></code><a class="headerlink" href="#sdist" title="Permalink to this headline"></a></h3>
<p>To build the <code class="docutils literal"><span class="pre">sdist</span></code> (source distribution) run:</p>
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>python setup.py sdist
</pre></div>
</div>
<p>from the zipline root. This will create a gzipped tarball that includes all the
python, cython, and miscellaneous files needed to install zipline. To test that
the source dist worked correctly, <code class="docutils literal"><span class="pre">cd</span></code> into an empty directory, create a new
virtualenv and then run:</p>
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>pip install &lt;zipline-root&gt;/dist/zipline-&lt;major&gt;.&lt;minor&gt;.&lt;micro&gt;.tar.gz
<span class="nv">$ </span>python -c <span class="s1">&#39;import zipline;print(zipline.__version__)&#39;</span>
</pre></div>
</div>
<p>This should print the version we are expecting to release.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">It is very important to both <code class="docutils literal"><span class="pre">cd</span></code> into a clean directory and make a clean
virtualenv. Changing directories ensures that we have included all the needed
files in the manifest. Using a clean virtualenv ensures that we have listed
all the required packages.</p>
</div>
<p>Now that we have tested the package locally, it should be tested using the test
PyPI server.</p>
<p>Edit your <code class="docutils literal"><span class="pre">~/.pypirc</span></code> file to look like:</p>
<div class="highlight-python"><div class="highlight"><pre>[distutils]
index-servers =
pypi
pypitest
[pypi]
username:
password:
[pypitest]
repository: https://testpypi.python.org/pypi
username:
password:
</pre></div>
</div>
<p>after that, run:</p>
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>python setup.py sdist upload -r pypitest
</pre></div>
</div>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p>If the package version has been taken: locally update your setup.py to
override the version with a new number. Do not use the next version, just
append a <code class="docutils literal"><span class="pre">.&lt;nano&gt;</span></code> section to the current version. PyPI prevents the same
package version from appearing twice, so we need to work around this when
debugging packaging problems on the test server.</p>
<div class="last admonition warning">
<p class="first admonition-title">Warning</p>
<p class="last">Do not commit the temporary version change.</p>
</div>
</div>
<p>This will upload zipline to the pypi test server. To test installing from pypi,
create a new virtualenv, <code class="docutils literal"><span class="pre">cd</span></code> into a clean directory and then run:</p>
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>pip install --extra-index-url https://testpypi.python.org/pypi zipline
<span class="nv">$ </span>python -c <span class="s1">&#39;import zipline;print(zipline.__version__)&#39;</span>
</pre></div>
</div>
<p>This should pull the package you just uploaded and then print the version
number.</p>
<p>Now that we have tested locally and on PyPI test, it is time to upload to PyPI:</p>
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>python setup.py sdist upload
</pre></div>
</div>
</div>
<div class="section" id="bdist">
<h3><code class="docutils literal"><span class="pre">bdist</span></code><a class="headerlink" href="#bdist" title="Permalink to this headline"></a></h3>
<p>Because zipline now supports multiple versions of numpy, we&#8217;re not building
binary wheels, since they are not tagged with the version of numpy with which
they were compiled.</p>
</div>
</div>
<div class="section" id="documentation">
<h2>Documentation<a class="headerlink" href="#documentation" title="Permalink to this headline"></a></h2>
<p>To update <a class="reference external" href="http://www.zipline.io/index.html">zipline.io</a>, checkout the
latest master and run:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">python</span> <span class="o">&lt;</span><span class="n">zipline_root</span><span class="o">&gt;/</span><span class="n">docs</span><span class="o">/</span><span class="n">deploy</span><span class="o">.</span><span class="n">py</span>
</pre></div>
</div>
<p>This will build the documentation, checkout a fresh copy of the <code class="docutils literal"><span class="pre">gh-pages</span></code>
git branch, and copy the built docs into the zipline root.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">The docs should always be built with <strong>Python 3</strong>. Many of our api functions
are wrapped by preprocessing functions which accept *args and **kwargs. In
Python 3, sphinx will respect the <code class="docutils literal"><span class="pre">__wrapped__</span></code> attribute and display the
correct arguments.</p>
</div>
<p>Now, using our browser of choice, view the <code class="docutils literal"><span class="pre">index.html</span></code> page and verify that
the docs look correct.</p>
<p>Once we are happy, push the updated docs to the GitHub <code class="docutils literal"><span class="pre">gh-pages</span></code> branch.</p>
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>git add .
<span class="nv">$ </span>git commit -m <span class="s2">&quot;DOC: update zipline.io&quot;</span>
<span class="nv">$ </span>git push origin gh-pages
</pre></div>
</div>
<p><a class="reference external" href="http://www.zipline.io/index.html">zipline.io</a> will update in a few moments.</p>
</div>
<div class="section" id="uploading-conda-packages">
<h2>Uploading conda packages<a class="headerlink" href="#uploading-conda-packages" title="Permalink to this headline"></a></h2>
<p>Travis and AppVeyor build zipline conda packages for us. Once they have built
and uploaded to anaconda.org the packages (and their dependencies) for the
release commit to master, we should move those packages from the &#8220;ci&#8221; label to
the &#8220;main&#8221; label. You can do this from the anaconda.org web interface. This
is also a good time to remove all the old &#8220;ci&#8221; packages from anaconda.</p>
<p>Travis and AppVeyor only build and upload linux-64 and win-64 packages. We&#8217;ll
need to build and upload osx-64 packages manually on an OSX machine.</p>
<p>To build the conda packages for zipline locally, run:</p>
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>python etc/conda_build_matrix.py
</pre></div>
</div>
<p>If all of the builds succeed, then this will not print anything and exit with
<code class="docutils literal"><span class="pre">EXIT_SUCCESS</span></code>. If there are build issues, we must address them and decide
what to do.</p>
<p>Once all of the builds in the matrix pass, we can upload them to anaconda with:</p>
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>python etc/conda_build_matrix.py --upload
</pre></div>
</div>
<p>If you would like to test this command by uploading to a different user, this
may be specified with the <code class="docutils literal"><span class="pre">--user</span></code> flag.</p>
</div>
<div class="section" id="next-commit">
<h2>Next Commit<a class="headerlink" href="#next-commit" title="Permalink to this headline"></a></h2>
<p>Push a new commit post-release that adds the whatsnew for the next release,
which should be titled according to a micro version increment. If that next
release turns out to be a major/minor version increment, the file can be
renamed when that&#8217;s decided. You can use <code class="docutils literal"><span class="pre">docs/source/whatsnew/skeleton.txt</span></code>
as a template for the new file.</p>
<p>Include the whatsnew file in <code class="docutils literal"><span class="pre">docs/source/releases.rst</span></code>. New releases should
appear at the top. The syntax for this is:</p>
<div class="highlight-python"><div class="highlight"><pre>.. include:: whatsnew/&lt;version&gt;.txt
</pre></div>
</div>
</div>
</div>
</div>
<footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="releases.html" class="btn btn-neutral float-right" title="Release Notes" accesskey="n">Next <span class="fa fa-arrow-circle-right"></span></a>
<a href="appendix.html" class="btn btn-neutral" title="API Reference" accesskey="p"><span class="fa fa-arrow-circle-left"></span> Previous</a>
</div>
<hr/>
<div role="contentinfo">
<p>
&copy; Copyright 2017, Enigma MPC, Inc..
</p>
</div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'0.3',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="_static/js/theme.js"></script>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.StickyNav.enable();
});
</script>
</body>
</html>