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
|
you've already got the power of python at your fingertips, so you don't
|
||||||
really need PBR.
|
really need PBR.
|
||||||
|
|
||||||
PBR builds on top of `d2to1` to provide for declarative configuration. It
|
PBR builds on top of the work that `d2to1` started to provide for declarative
|
||||||
then filters the `setup.cfg` data through a setup hook to fill in default
|
configuration. `d2to1` is itself an implementation of the ideas behind
|
||||||
values and provide more sensible behaviors.
|
`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
|
Behaviors
|
||||||
=========
|
=========
|
||||||
|
@ -124,11 +135,11 @@ The minimal setup.py should look something like this::
|
||||||
from setuptools import setup
|
from setuptools import setup
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
setup_requires=['d2to1', 'pbr'],
|
setup_requires=['pbr'],
|
||||||
d2to1=True,
|
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.
|
will not be enabled.
|
||||||
|
|
||||||
It should also work fine if additional arguments are passed to `setup()`,
|
It should also work fine if additional arguments are passed to `setup()`,
|
||||||
|
|
|
@ -28,4 +28,4 @@ class DeferredVersionTestCase(tests.BaseTestCase):
|
||||||
|
|
||||||
deferred_string = MyVersionInfo("openstack").\
|
deferred_string = MyVersionInfo("openstack").\
|
||||||
cached_version_string()
|
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 =
|
description-file =
|
||||||
README.rst
|
README.rst
|
||||||
home-page = http://pypi.python.org/pypi/pbr
|
home-page = http://pypi.python.org/pypi/pbr
|
||||||
|
requires-python = >=2.6
|
||||||
classifier =
|
classifier =
|
||||||
Development Status :: 4 - Beta
|
Development Status :: 4 - Beta
|
||||||
Environment :: Console
|
Environment :: Console
|
||||||
|
@ -26,3 +27,7 @@ setup-hooks =
|
||||||
|
|
||||||
[pbr]
|
[pbr]
|
||||||
warnerrors = True
|
warnerrors = True
|
||||||
|
|
||||||
|
[entry_points]
|
||||||
|
distutils.setup_keywords =
|
||||||
|
pbr = pbr.core:pbr
|
||||||
|
|
5
setup.py
5
setup.py
|
@ -16,6 +16,7 @@
|
||||||
|
|
||||||
import setuptools
|
import setuptools
|
||||||
|
|
||||||
|
from pbr.d2to1 import util
|
||||||
|
|
||||||
setuptools.setup(
|
setuptools.setup(
|
||||||
setup_requires=['d2to1>=0.2.10,<0.3'],
|
**util.cfg_to_args())
|
||||||
d2to1=True)
|
|
||||||
|
|
2
tox.ini
2
tox.ini
|
@ -9,7 +9,7 @@ setenv = VIRTUAL_ENV={envdir}
|
||||||
deps = -r{toxinidir}/requirements.txt
|
deps = -r{toxinidir}/requirements.txt
|
||||||
-r{toxinidir}/test-requirements.txt
|
-r{toxinidir}/test-requirements.txt
|
||||||
commands =
|
commands =
|
||||||
python setup.py testr --slowest --testr-args='{posargs}'
|
python setup.py testr --testr-args='{posargs}'
|
||||||
|
|
||||||
[tox:jenkins]
|
[tox:jenkins]
|
||||||
sitepackages = True
|
sitepackages = True
|
||||||
|
|
Loading…
Reference in New Issue