home / code

lines

9,454 rows

View and edit SQL

id file_id line_no line
101 versioneer.py 3 2 # Version: 0.18
102 versioneer.py 3 3
103 versioneer.py 3 4 """The Versioneer - like a rocketeer, but for versions.
104 versioneer.py 3 5
105 versioneer.py 3 6 The Versioneer
106 versioneer.py 3 7 ==============
107 versioneer.py 3 8
108 versioneer.py 3 9 * like a rocketeer, but for versions!
109 versioneer.py 3 10 * https://github.com/warner/python-versioneer
110 versioneer.py 3 11 * Brian Warner
111 versioneer.py 3 12 * License: Public Domain
112 versioneer.py 3 13 * Compatible With: python2.6, 2.7, 3.2, 3.3, 3.4, 3.5, 3.6, and pypy
113 versioneer.py 3 14 * [![Latest Version]
114 versioneer.py 3 15 (https://pypip.in/version/versioneer/badge.svg?style=flat)
115 versioneer.py 3 16 ](https://pypi.python.org/pypi/versioneer/)
116 versioneer.py 3 17 * [![Build Status]
117 versioneer.py 3 18 (https://travis-ci.org/warner/python-versioneer.png?branch=master)
118 versioneer.py 3 19 ](https://travis-ci.org/warner/python-versioneer)
119 versioneer.py 3 20
120 versioneer.py 3 21 This is a tool for managing a recorded version number in distutils-based
121 versioneer.py 3 22 python projects. The goal is to remove the tedious and error-prone "update
122 versioneer.py 3 23 the embedded version string" step from your release process. Making a new
123 versioneer.py 3 24 release should be as easy as recording a new tag in your version-control
124 versioneer.py 3 25 system, and maybe making new tarballs.
125 versioneer.py 3 26
126 versioneer.py 3 27
127 versioneer.py 3 28 ## Quick Install
128 versioneer.py 3 29
129 versioneer.py 3 30 * `pip install versioneer` to somewhere to your $PATH
130 versioneer.py 3 31 * add a `[versioneer]` section to your setup.cfg (see below)
131 versioneer.py 3 32 * run `versioneer install` in your source tree, commit the results
132 versioneer.py 3 33
133 versioneer.py 3 34 ## Version Identifiers
134 versioneer.py 3 35
135 versioneer.py 3 36 Source trees come from a variety of places:
136 versioneer.py 3 37
137 versioneer.py 3 38 * a version-control system checkout (mostly used by developers)
138 versioneer.py 3 39 * a nightly tarball, produced by build automation
139 versioneer.py 3 40 * a snapshot tarball, produced by a web-based VCS browser, like github's
140 versioneer.py 3 41 "tarball from tag" feature
141 versioneer.py 3 42 * a release tarball, produced by "setup.py sdist", distributed through PyPI
142 versioneer.py 3 43
143 versioneer.py 3 44 Within each source tree, the version identifier (either a string or a number,
144 versioneer.py 3 45 this tool is format-agnostic) can come from a variety of places:
145 versioneer.py 3 46
146 versioneer.py 3 47 * ask the VCS tool itself, e.g. "git describe" (for checkouts), which knows
147 versioneer.py 3 48 about recent "tags" and an absolute revision-id
148 versioneer.py 3 49 * the name of the directory into which the tarball was unpacked
149 versioneer.py 3 50 * an expanded VCS keyword ($Id$, etc)
150 versioneer.py 3 51 * a `_version.py` created by some earlier build step
151 versioneer.py 3 52
152 versioneer.py 3 53 For released software, the version identifier is closely related to a VCS
153 versioneer.py 3 54 tag. Some projects use tag names that include more than just the version
154 versioneer.py 3 55 string (e.g. "myproject-1.2" instead of just "1.2"), in which case the tool
155 versioneer.py 3 56 needs to strip the tag prefix to extract the version identifier. For
156 versioneer.py 3 57 unreleased software (between tags), the version identifier should provide
157 versioneer.py 3 58 enough information to help developers recreate the same tree, while also
158 versioneer.py 3 59 giving them an idea of roughly how old the tree is (after version 1.2, before
159 versioneer.py 3 60 version 1.3). Many VCS systems can report a description that captures this,
160 versioneer.py 3 61 for example `git describe --tags --dirty --always` reports things like
161 versioneer.py 3 62 "0.7-1-g574ab98-dirty" to indicate that the checkout is one revision past the
162 versioneer.py 3 63 0.7 tag, has a unique revision id of "574ab98", and is "dirty" (it has
163 versioneer.py 3 64 uncommitted changes.
164 versioneer.py 3 65
165 versioneer.py 3 66 The version identifier is used for multiple purposes:
166 versioneer.py 3 67
167 versioneer.py 3 68 * to allow the module to self-identify its version: `myproject.__version__`
168 versioneer.py 3 69 * to choose a name and prefix for a 'setup.py sdist' tarball
169 versioneer.py 3 70
170 versioneer.py 3 71 ## Theory of Operation
171 versioneer.py 3 72
172 versioneer.py 3 73 Versioneer works by adding a special `_version.py` file into your source
173 versioneer.py 3 74 tree, where your `__init__.py` can import it. This `_version.py` knows how to
174 versioneer.py 3 75 dynamically ask the VCS tool for version information at import time.
175 versioneer.py 3 76
176 versioneer.py 3 77 `_version.py` also contains `$Revision$` markers, and the installation
177 versioneer.py 3 78 process marks `_version.py` to have this marker rewritten with a tag name
178 versioneer.py 3 79 during the `git archive` command. As a result, generated tarballs will
179 versioneer.py 3 80 contain enough information to get the proper version.
180 versioneer.py 3 81
181 versioneer.py 3 82 To allow `setup.py` to compute a version too, a `versioneer.py` is added to
182 versioneer.py 3 83 the top level of your source tree, next to `setup.py` and the `setup.cfg`
183 versioneer.py 3 84 that configures it. This overrides several distutils/setuptools commands to
184 versioneer.py 3 85 compute the version when invoked, and changes `setup.py build` and `setup.py
185 versioneer.py 3 86 sdist` to replace `_version.py` with a small static file that contains just
186 versioneer.py 3 87 the generated version data.
187 versioneer.py 3 88
188 versioneer.py 3 89 ## Installation
189 versioneer.py 3 90
190 versioneer.py 3 91 See [INSTALL.md](./INSTALL.md) for detailed installation instructions.
191 versioneer.py 3 92
192 versioneer.py 3 93 ## Version-String Flavors
193 versioneer.py 3 94
194 versioneer.py 3 95 Code which uses Versioneer can learn about its version string at runtime by
195 versioneer.py 3 96 importing `_version` from your main `__init__.py` file and running the
196 versioneer.py 3 97 `get_versions()` function. From the "outside" (e.g. in `setup.py`), you can
197 versioneer.py 3 98 import the top-level `versioneer.py` and run `get_versions()`.
198 versioneer.py 3 99
199 versioneer.py 3 100 Both functions return a dictionary with different flavors of version
200 versioneer.py 3 101 information:

Next page

Advanced export

JSON shape: default, array, object

CSV options:

CREATE TABLE [lines] (
               [id] INTEGER  PRIMARY KEY ,
   [file_id] INTEGER   REFERENCES [files]([id]),
   [line_no] INTEGER  ,
   [line] TEXT  
        )
Powered by Datasette · Query took 3.01ms