Skip to content

Commit 78eed00

Browse files
committed
upgrade to versioneer-0.9
1 parent 1076c97 commit 78eed00

File tree

2 files changed

+76
-33
lines changed

2 files changed

+76
-33
lines changed

ecdsa/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# that just contains the computed version number.
77

88
# This file is released into the public domain. Generated by
9-
# versioneer-0.8+ (https://github.com/warner/python-versioneer)
9+
# versioneer-0.9 (https://github.com/warner/python-versioneer)
1010

1111
# these strings will be replaced by git during git-archive
1212
git_refnames = "$Format:%d$"

versioneer.py

Lines changed: 75 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
# Version: 0.8+
2+
# Version: 0.9
33

44
"""
55
The Versioneer
@@ -22,21 +22,19 @@
2222
2323
## Quick Install
2424
25-
* `pip install versioneer` somewhere to your $PATH
26-
* run `versioneerer` in your source tree: installs `versioneer.py`
27-
* follow the instructions below
25+
* `pip install versioneer` to somewhere to your $PATH
26+
* run `versioneer-installer` in your source tree: this installs `versioneer.py`
27+
* follow the instructions below (also in the `versioneer.py` docstring)
2828
2929
## Version Identifiers
3030
3131
Source trees come from a variety of places:
3232
33-
* a version-control system checkout (mostly used by developers or eager
34-
followers)
33+
* a version-control system checkout (mostly used by developers)
3534
* a nightly tarball, produced by build automation
36-
* a snapshot tarball, produced by a web-based VCS browser, like hgweb or
37-
github's "tarball from tag" feature
38-
* a release tarball, produced by "setup.py sdist", and perhaps distributed
39-
through PyPI
35+
* a snapshot tarball, produced by a web-based VCS browser, like github's
36+
"tarball from tag" feature
37+
* a release tarball, produced by "setup.py sdist", distributed through PyPI
4038
4139
Within each source tree, the version identifier (either a string or a number,
4240
this tool is format-agnostic) can come from a variety of places:
@@ -68,26 +66,26 @@
6866
## Theory of Operation
6967
7068
Versioneer works by adding a special `_version.py` file into your source
71-
tree, where your `__init__.py` can import it. This _version.py knows how to
69+
tree, where your `__init__.py` can import it. This `_version.py` knows how to
7270
dynamically ask the VCS tool for version information at import time. However,
7371
when you use "setup.py build" or "setup.py sdist", `_version.py` in the new
7472
copy is replaced by a small static file that contains just the generated
7573
version data.
7674
7775
`_version.py` also contains `$Revision$` markers, and the installation
78-
process marks _version.py to have this marker rewritten with a tag name
76+
process marks `_version.py` to have this marker rewritten with a tag name
7977
during the "git archive" command. As a result, generated tarballs will
8078
contain enough information to get the proper version.
8179
8280
8381
## Installation
8482
85-
You will need to provide versioneer with a few configuration variables:
83+
First, decide on values for the following configuration variables:
8684
8785
* `versionfile_source`:
8886
8987
A project-relative pathname into which the generated version strings should
90-
be written. This is usually a _version.py next to your project's main
88+
be written. This is usually a `_version.py` next to your project's main
9189
`__init__.py` file. If your project uses `src/myproject/__init__.py`, this
9290
should be `src/myproject/_version.py`. This file should be checked in to
9391
your VCS as usual: the copy created below by 'setup.py update_files' will
@@ -116,34 +114,36 @@
116114
all unpacked tarball filenames. If your tarball unpacks into
117115
'myproject-1.2.0', this should be 'myproject-'.
118116
119-
This tool provides one script, named `versioneer.py`.
117+
This tool provides one script, named `versioneer-installer`. That script does
118+
one thing: write a copy of `versioneer.py` into the current directory.
120119
121120
To versioneer-enable your project:
122121
123-
* 1: copy `versioneer.py` into the top of your source tree
122+
* 1: Run `versioneer-installer` to copy `versioneer.py` into the top of your
123+
source tree.
124124
125-
* 2: add the following lines to the top of your `setup.py`, with suitable
126-
values for each configuration setting:
125+
* 2: add the following lines to the top of your `setup.py`, with the
126+
configuration values you decided earlier:
127127
128-
import versioneer
129-
versioneer.versionfile_source = 'src/myproject/_version.py'
130-
versioneer.versionfile_build = 'myproject/_version.py'
131-
versioneer.tag_prefix = '' # tags are like 1.2.0
132-
versioneer.parentdir_prefix = 'myproject-' # dirname like 'myproject-1.2.0'
128+
import versioneer
129+
versioneer.versionfile_source = 'src/myproject/_version.py'
130+
versioneer.versionfile_build = 'myproject/_version.py'
131+
versioneer.tag_prefix = '' # tags are like 1.2.0
132+
versioneer.parentdir_prefix = 'myproject-' # dirname like 'myproject-1.2.0'
133133
134134
* 3: add the following arguments to the setup() call in your setup.py:
135135
136-
version=versioneer.get_version(),
137-
cmdclass=versioneer.get_cmdclass(),
136+
version=versioneer.get_version(),
137+
cmdclass=versioneer.get_cmdclass(),
138138
139-
* 4: run `setup.py update_files`, which will create `_version.py`, and will
140-
modify your `__init__.py` to define `__version__` (by calling a function
141-
from `_version.py`)
139+
* 4: now run `setup.py update_files`, which will create `_version.py`, and
140+
will modify your `__init__.py` to define `__version__` (by calling a
141+
function from `_version.py`)
142142
143143
* 5: modify your MANIFEST.in to include `versioneer.py` in sdist tarballs
144144
145145
* 6: commit these changes to your VCS. `update_files` will mark both
146-
`versioneer.py` and the generated `_version.py` for addition.
146+
`versioneer.py` and the generated `_version.py` for addition.
147147
148148
## Post-Installation Usage
149149
@@ -167,6 +167,48 @@
167167
report "unknown" until your tree has at least one tag in its history. This
168168
restriction will be fixed eventually (see issue #12).
169169
170+
## Version-String Flavors
171+
172+
Code which uses Versioneer can learn about its version string at runtime by
173+
importing `_version` from your main `__init__.py` file and running the
174+
`get_versions()` function. From the "outside" (e.g. in `setup.py`), you can
175+
import the top-level `versioneer.py` and run `get_versions()`.
176+
177+
Both functions return a dictionary with different keys for different flavors
178+
of the version string:
179+
180+
* `['version']`: condensed tag+distance+shortid+dirty identifier. For git,
181+
this uses the output of `git describe --tags --dirty --always` but strips
182+
the tag_prefix. For example "0.11-2-g1076c97-dirty" indicates that the tree
183+
is like the "1076c97" commit but has uncommitted changes ("-dirty"), and
184+
that this commit is two revisions ("-2-") beyond the "0.11" tag. For
185+
released software (exactly equal to a known tag), the identifier will only
186+
contain the stripped tag, e.g. "0.11".
187+
188+
* `['full']`: detailed revision identifier. For Git, this is the full SHA1
189+
commit id, followed by "-dirty" if the tree contains uncommitted changes,
190+
e.g. "1076c978a8d3cfc70f408fe5974aa6c092c949ac-dirty".
191+
192+
Some variants are more useful than others. Including `full` in a bug report
193+
should allow developers to reconstruct the exact code being tested (or
194+
indicate the presence of local changes that should be shared with the
195+
developers). `version` is suitable for display in an "about" box or a CLI
196+
`--version` output: it can be easily compared against release notes and lists
197+
of bugs fixed in various releases.
198+
199+
In the future, this will also include a
200+
[PEP-0440](http://legacy.python.org/dev/peps/pep-0440/) -compatible flavor
201+
(e.g. `1.2.post0.dev123`). This loses a lot of information (and has no room
202+
for a hash-based revision id), but is safe to use in a `setup.py`
203+
"`version=`" argument. It also enables tools like *pip* to compare version
204+
strings and evaluate compatibility constraint declarations.
205+
206+
The `setup.py update_files` command adds the following text to your
207+
`__init__.py` to place a basic version in `YOURPROJECT.__version__`:
208+
209+
from ._version import get_versions
210+
__version = get_versions()['version']
211+
del get_versions
170212
171213
## Future Directions
172214
@@ -185,7 +227,8 @@
185227
## License
186228
187229
To make Versioneer easier to embed, all its code is hereby released into the
188-
public domain. The `_version.py` that it creates is also in the public domain.
230+
public domain. The `_version.py` that it creates is also in the public
231+
domain.
189232
190233
"""
191234

@@ -210,7 +253,7 @@
210253
# that just contains the computed version number.
211254
212255
# This file is released into the public domain. Generated by
213-
# versioneer-0.8+ (https://github.com/warner/python-versioneer)
256+
# versioneer-0.9 (https://github.com/warner/python-versioneer)
214257
215258
# these strings will be replaced by git during git-archive
216259
git_refnames = "%(DOLLAR)sFormat:%%d%(DOLLAR)s"
@@ -588,7 +631,7 @@ def do_vcs_install(versionfile_source, ipy):
588631
run_command(GITS, ["add", "--"] + files)
589632

590633
SHORT_VERSION_PY = """
591-
# This file was generated by 'versioneer.py' (0.8+) from
634+
# This file was generated by 'versioneer.py' (0.9) from
592635
# revision-control system data, or from the parent directory name of an
593636
# unpacked source archive. Distribution tarballs contain a pre-generated copy
594637
# of this file.

0 commit comments

Comments
 (0)