diff options
author | Monty Taylor <mordred@inaugust.com> | 2013-07-12 03:03:18 -0400 |
---|---|---|
committer | Monty Taylor <mordred@inaugust.com> | 2013-07-12 03:03:18 -0400 |
commit | be8aa97de269ed1993243715a71699e95229cc59 (patch) | |
tree | ee30ea5187613b7ddde7d210295907286d2f5c56 | |
parent | 0cf4cc847190bfa7209b0fba2b5b4d7493ca4def (diff) | |
parent | 091ce52138d65fc0fe0cdbea5556d76a4ecc5b29 (diff) | |
download | oslo-version-be8aa97de269ed1993243715a71699e95229cc59.tar.gz |
Merge feature/merged2to1 into master
Upstream d2to1 has been rather unresponsive, and doing what we need
in this case is really easier without the extra complexity.
Change-Id: Ibd16944e76ad8398b57b6ddcbcd150cd462add3e
-rw-r--r-- | README.rst | 23 | ||||
-rw-r--r-- | pbr/tests/test_version.py | 2 | ||||
-rw-r--r-- | setup.cfg | 5 | ||||
-rwxr-xr-x | setup.py | 5 | ||||
-rw-r--r-- | tox.ini | 2 |
5 files changed, 27 insertions, 10 deletions
@@ -13,9 +13,20 @@ it's simple and repeatable. If you want to do things differently, cool! But you've already got the power of python at your fingertips, so you don't really need PBR. -PBR builds on top of `d2to1` to provide for declarative configuration. It -then filters the `setup.cfg` data through a setup hook to fill in default -values and provide more sensible behaviors. +PBR builds on top of the work that `d2to1` started to provide for declarative +configuration. `d2to1` is itself an implementation of the ideas behind +`distutils2`. Although `distutils2` is now abandoned in favor of work towards +PEP 426 and Metadata 2.0, declarative config is still a great idea and +specifically important in trying to distribute setup code as a library +when that library itself will alter how the setup is processed. As Metadata +2.0 and other modern Python packaging PEPs come out, `pbr` aims to support +them as quickly as possible. + +`pbr` reads and then filters the `setup.cfg` data through a setup hook to +fill in default values and provide more sensible behaviors, and then feeds +the results in as the arguments to a call to `setup.py` - so the heavy +lifting of handling python packaging needs is still being done by +`setuptools`. Behaviors ========= @@ -124,11 +135,11 @@ The minimal setup.py should look something like this:: from setuptools import setup setup( - setup_requires=['d2to1', 'pbr'], - d2to1=True, + setup_requires=['pbr'], + pbr=True, ) -Note that it's important to specify `d2to1=True` or else the pbr functionality +Note that it's important to specify `pbr=True` or else the pbr functionality will not be enabled. It should also work fine if additional arguments are passed to `setup()`, diff --git a/pbr/tests/test_version.py b/pbr/tests/test_version.py index bd72a2d..7ef908b 100644 --- a/pbr/tests/test_version.py +++ b/pbr/tests/test_version.py @@ -28,4 +28,4 @@ class DeferredVersionTestCase(tests.BaseTestCase): deferred_string = MyVersionInfo("openstack").\ cached_version_string() - self.assertEquals("5.5.5.5", deferred_string) + self.assertEqual("5.5.5.5", deferred_string) @@ -6,6 +6,7 @@ summary = Python Build Reasonableness description-file = README.rst home-page = http://pypi.python.org/pypi/pbr +requires-python = >=2.6 classifier = Development Status :: 4 - Beta Environment :: Console @@ -26,3 +27,7 @@ setup-hooks = [pbr] warnerrors = True + +[entry_points] +distutils.setup_keywords = + pbr = pbr.core:pbr @@ -16,6 +16,7 @@ import setuptools +from pbr.d2to1 import util + setuptools.setup( - setup_requires=['d2to1>=0.2.10,<0.3'], - d2to1=True) + **util.cfg_to_args()) @@ -9,7 +9,7 @@ setenv = VIRTUAL_ENV={envdir} deps = -r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt commands = - python setup.py testr --slowest --testr-args='{posargs}' + python setup.py testr --testr-args='{posargs}' [tox:jenkins] sitepackages = True |