Clean up hacking and path issues with d2to1
We imported in another code base. It takes a little bit of path adjusting to get things right. Change-Id: Ifb96652c822d5d243a6bedb77bc34e919be2d3a8
This commit is contained in:
parent
7e7d8f06aa
commit
1417c58ae1
23
README.rst
23
README.rst
|
@ -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()`,
|
||||
|
|
|
@ -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
|
||||
|
|
5
setup.py
5
setup.py
|
@ -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())
|
||||
|
|
Loading…
Reference in New Issue