Commit Graph

411 Commits

Author SHA1 Message Date
Jenkins 53681bec0c Merge "trivial: Add note about multiple builders support" 2017-04-21 07:46:32 +00:00
Gage Hugo 2cf1d2eb18 Fix missing comment from previous change
In a previous commit [0] there was an additional character
escaping added at the end that was not added to the list
in the comment for the function. This change adds the missing
character to the list of escaped characters from the previous
change.

[0] https://review.openstack.org/#/c/439897/

Change-Id: I6e83a10ee51f1f18176bf2d17a0092d5a3cc4dd4
2017-04-18 10:24:02 -05:00
Stephen Finucane 0469bf39d4 trivial: Add note about multiple builders support
Sphinx 1.6 will support the definition of multiple builders in a
setup.cfg file like so:

  [build_sphinx]
  builder = html man

Once we support this version of Sphinx, we should stop carrying the
custom versions of this tooling we use.

Upstreaming things FTW.

Change-Id: Ibf2a003229a4585df96b09da7ca547e201c5aef5
2017-04-18 10:36:09 +01:00
Jenkins ca6e92c723 Merge "Stop building man pages by default" 2017-04-15 15:00:46 +00:00
Stephen Finucane 1ed8531095 Remove 'build_sphinx_latex'
codesearch.o.o shows a single, long-dead project using this [1]. Let's
just remove it and push people to set 'builders' instead in they really
want LaTeX.

[1] http://codesearch.openstack.org/?q=build_sphinx_latex

Change-Id: I820d9c540ae81717d7b33bbb4d2a4031b529b52c
2017-04-14 18:05:42 +00:00
Stephen Finucane d4e4efd779 Stop building man pages by default
From pretty much the beginning [1], pbr has defaulted to building both
man page and html output, but has failed to document it anywhere. People
tend to copy-paste their 'setup.py' and 'conf.py', or rely on the
'cookiecutter' project, with very little understanding of what's going
on under the hood (and why would you care - it's docs :)). This means
that the vast majority of folks using 'pbr' (basically everyone in
OpenStack) have been unwittingly building "man pages" as part of their
doc builds for no good reason, which has also led to a lot of confusion
when this magic behavior is the cause of bugs [2][3].

There's no good reason that pbr should default to building both man
pages and html output. For folks that want this functionality, we should
document it so they can use it. For everyone else though, let's do the
sane thing and output html like the standard 'build_sphinx' plugin.

[1] https://github.com/openstack-dev/pbr/commit/5b8b7f1d
[2] https://bugs.launchpad.net/pbr/+bug/1681983
[3] https://bugs.launchpad.net/oslotest/+bug/1379998

Change-Id: I579134a2b7980669180c1666503b848835cc2957
Closes-Bug: #1681983
2017-04-14 18:05:22 +00:00
Doug Hellmann 84a8599133 add image.nonlocal_uri to the list of warnings ignored
pbr currently hard-codes the list of warnings that are to be ignored.
Many OpenStack projects use remote images to add project "badges" based
on tags defined in the governance repository. Ignore the warning caused
by using remote images so we can unbreak documentation builds using
those badges.

Change-Id: If47e3ca6519cc9f70d62cd887707321fe9199f81
Addresses-Bug: #1682467
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2017-04-13 11:51:55 -04:00
Jenkins d53ce060d4 Merge "Add Changelog build handling for invalid chars" 2017-04-11 17:36:09 +00:00
Jenkins 5a21031398 Merge "Initialize sphinx config using application instead of config" 2017-03-30 18:19:42 +00:00
Clark Boylan 02228ceb21 Lazy import pkg_resources
pkg_resources is costly to import so don't import it until we actually
need it.

Change-Id: I2152b6b3fd47597b5af032e74a840e2f5b89c383
2017-03-28 11:00:16 -07:00
Jenkins f377238903 Merge "Remove testr entry point" 2017-03-27 23:12:29 +00:00
Gage Hugo 3cc5af104e Add Changelog build handling for invalid chars
This change adds new handling when building a Changelog file
for specific characters that cause documentation building
warnings/errors to be emitted when sphinx tries to generate
a Changelog html page. The changes include:

- Escaping any '*' in a commit, which sphinx will interpret as the
  start of a new line and throw a warning.
- Escaping any '_' in a commit, which in certain cases, sphinx will
  interpret as an invalid link and create an error.
- Escaping any '`' in a commit, which in certain cases will
  cause sphinx to interpet as a literal, and throw a warning.

After this change, any entries in the changelog that contain
the above "invalid" syntax no longer generate sphinx
warnings/errors and the offending entries now generate correctly.

Change-Id: I672ef4c56486e59a384849a4b182d11129726ae9
2017-03-27 11:37:24 -05:00
Alfredo Moralejo 2d7c0045f4 Initialize sphinx config using application instead of config
Currently sphinx config is initialized using sphinx.config,
however in recent versions of Sphinx, plugin specific parameters
as man_pages for man builder has been moved to the extension
and is not initialized from sphinx.config but using sphinx.application.
This is making man_pages to be empty when using sphinx 1.5 and man
builder is not properly called.

This patch initializes sphinx config using sphinx.application which
works fine with both old and new Sphinx versions.

Closes-Bug: #1674795

Depends-On: I7bde8fc1f2a7db5bd73635aa197377bf5ac614d2
Change-Id: Ib7c1a6fe8fbb5acfcfcfac61d0b53f080ff2b1e4
2017-03-27 08:46:47 +00:00
Ian Wienand 73ca7e086b Also generate XML coverage report
When using --coverage, also generate a machine-readable XML coverage
report.  This is useful to build tooling around automated tracking of
coverage results.

Change-Id: Idd54ecc627896cc5eab4903658f10a344bdb1778
2017-03-02 15:42:52 +11:00
Stephen Finucane 72e8e42a34 Stop using 'warnerrors'
This legacy option provided the ability to fail on doc warnings.
However, this functionality is broken in recent releases and now exists
in Sphinx itself (since 1.5.0). Rather that fixing it and causing a
whole load of doc build errors introduced in the time since this option
was broken, remove it, preferring the new Sphinx option instead.

This allows us to remove a lot of test code which is essentially testing
Sphinx functionality only now, based on the assumption that Sphinx do
adequate testing themselves.

Change-Id: Ia4b6adefcd437cb1ceb4558b004c17359df2486d
2017-02-27 14:20:57 +00:00
Ian Wienand e3ad98ca19 Remove testr entry point
A "testr" entry-point was added to PBR in
I2227adf3643ffe6bcece0c7d2127d23e20d52f7a in Jun 2013.  However,
testrepository had already started providing this same
disutils.commands entry-point in Jan 2013 [1].

I am not sure if it is deterministic who wins when two packages
declare the same entry-point, but at least for me, running "python
setup.py testr ..." was not calling into any of the pbr hooks.  I
discovered this because I wanted to use the --coverage-package-name
argument provided by the pbr testr wrapper because to s/-/_ in dib.

The original change (I8e4bc9bb78be37b4d13f8d6c2edfe2d67554ad78)
overrides the setuptools provided "test" [2] to call testrepository
when it sees a .testr.conf file (falling back to nose for
compatability).  So it seems the intention was not to add a "testr"
command, but that "test" is overridden to run testr automatically when
available.

Therefore I think that testrepository owns the distutils.command
entry-point for "testr".  To avoid confusion we should remove the
duplicate entry-point here and just leave the "test" command
overrides.

I've added documentation on the test command.  The testr/test split is
quite confusing, being only one letter different, so that is called
out explicitly.  Comments in testr_command are updated to reflect
what's happening better.  This also converts the calls in tox.ini to
use the PBR wrapper "test".

[1] 2a36806c69 (diff-2eeaed663bd0d25b7e608891384b7298R96)
[2] https://github.com/pypa/setuptools/blob/master/setuptools/command/test.py

Change-Id: I5b68f03e782fef5c45424c04cc851be5988f9019
2017-02-24 11:30:09 +11:00
Jenkins 4c8bd90846 Merge "Clean imports in code" 2017-01-03 21:04:20 +00:00
Dirk Mueller 9fd7aa2cc7 Don't raise exception on missing man pages
The revert in Ia6cfbfe5b10a5b714fbb9f21ca61380aaf231638 actually
broke Sphinx 1.3.x support again. Try to fix it for real this
time by avoiding an exception on missing man_pages.

NOTE(dmllr): don't change dict while iterating over it, hopefully
this fixes the gating failure with python 3.5.x

Change-Id: I52d45fa0a0d42de690d3a492068f7bb03483a224
Related-Bug: 1379998
2017-01-02 23:08:30 +01:00
Jenkins 1b7d8859fe Merge "coverage package name option, doc improvement" 2016-11-21 18:17:30 +00:00
Jenkins e5d8a78507 Merge "Fix pypy soabi tests" 2016-11-17 20:05:35 +00:00
Cao Xuan Hoang 8f1e6dc73f Clean imports in code
This patch set modifies lines which are importing objects
instead of modules. As per openstack import guide lines, user should
import modules in a file not objects.

http://docs.openstack.org/developer/hacking/#imports

Change-Id: Iab667c04f4aa57d0c8c882144a550443dacc8f05
2016-11-17 09:45:29 +07:00
Cao Xuan Hoang 1454461714 Docstrings should not start with a space
As per OpenStack Docstrings guide lines [1]:
[H401] Docstrings should not start with a space.
[H403] Multi line docstrings should end on a new line.
[H404] Multi line docstrings should start without a leading new line.
[H405] Multi line docstrings should start with a one line summary
followed by an empty line.

[1] http://docs.openstack.org/developer/hacking/#docstrings

Change-Id: Ic943e837b8b4f55c2957643ad29dfa004b3c2eb3
2016-11-16 08:44:54 +07:00
Thomas Morin 30962137f9 coverage package name option, doc improvement
The --coverage-package-name allows to specify
multiple packages. This change updates the doc to
reflect that.

Change-Id: Id9cfedf699c3e15b7e1c7b20531488682775462a
2016-10-18 16:51:58 +02:00
Jenkins e8613428c1 Merge "Fix handling of old git log output" 2016-10-17 16:25:36 +00:00
Jenkins 2ccb2d21c0 Merge "Don't ignore data-files" 2016-10-02 01:47:53 +00:00
jiansong 77d9ab7d07 Deprecated warning for SafeConfigParser
tox -e py34 is reporting a deprecation warning for SafeConfigParser
/octavia/.tox/py34/lib/python3.4/site-packages/pbr/util.py:207:
DeprecationWarning: The SafeConfigParser class has been renamed to
ConfigParser in Python 3.2. This alias will be removed in future
versions. Use ConfigParser directly instead.
  parser = configparser.SafeConfigParser()

Closes-Bug: #1618666
Change-Id: Ib280b778938b64717ee1cf94efae2f7b553c8f5e
2016-09-11 23:15:54 -07:00
Monty Taylor 8d64858523
Add more words to a confusing error message
When setup.cfg has a different value than pbr.version.VersionInfo(),
then the version call is unable to look up the right value in the
pkg_resources metadata. However, nothing in the current error message
communicates this to the user, which leads to them not being able to
look in all the right places for the possible error.

Change-Id: I31c4e0e2ed15986ba8274a0c5270a9d214ac4b48
2016-08-26 10:45:41 -05:00
Sachi King a432bc2930 Don't ignore data-files
We're currently ignoring data-files, and it looks like the problem
would sometimes be present starting with 2796f9, 0.5.7, and always be present
from 04984a, 0.5.15.

This normalises all config keys from - to _ as soon as we read the
config, which means future access and modification does not need to
concern itself with the possibility of the key being a '-' instead '_'.

This should make it more difficult for code accessing/modifying values
in the config to clobber user set values or be unaware of them, like
in the case of the files hook.

As well, support download-url, but properly expose it as download_url.

Co-Authored-By: Julien Danjou <julien@danjou.info>
Change-Id: I062774c706b8f7339dda46689a226b80ae6ac277
2016-08-26 14:28:38 +10:00
zhangyanxian 24c8f8475b Change assertTrue(isinstance()) by optimal assert
Some of tests use different method of assertTrue(isinstance(A, B))
or assertEqual(type(A), B).
The correct way is to use assertIsInstance(A, B) provided by testtools.

Change-Id: I6c7aa04a3a3aaaab7f428cb86549a4d043af802f
2016-08-19 01:57:14 +00:00
Jenkins aa54bfed27 Merge "Replace OpenStack LLC with OpenStack Foundation" 2016-08-18 09:31:55 +00:00
Randall Nortman 626ecb6275 Fix handling of old git log output
Older versions of git produce log output (using --format specifiers)
that doesn't prefix tags with a "tag:" prefix, though they do using
the --decorate log format.  This was a bug in git that was fixed, but
the older git is still in the wild.  This change combines both the new
--format specifier method with the --decorate method to find tags even
if used with the old, buggy git, while (hopefully) avoiding
identifying non-tags as tags.

This is based on I6b557687f2428a528a8aa7f76e84797162488887 but tries to
use a single format string that works across all versions of git.

Because the format string has changed, some of the test data has had to
change to reflect the new format.

Change-Id: I58a1b12e0f4054fd25bddc77fabb6c89239561ff
Closes-Bug: #1570458
Co-Authored-By: James Polley <jp@jamezpolley.com>
2016-08-16 12:17:55 +10:00
Joshua Harlow 76d3ab1242 Expose deb version to match exposing rpm version
It seems like we only (currently) exposed to rpm
version translation command when the deb version
translation command is equally useful (for those
that package deb things).

Change-Id: I0df175e5206d9d3a806bf33c486765ad1aa8aa6b
2016-08-03 18:48:01 -07:00
dineshbhor a95982f9a0 Replace OpenStack LLC with OpenStack Foundation
Change-Id: I03fac862d7346bdac83503afb5f26119d0ea300d
Closes-Bug: #1214176
2016-07-26 17:37:42 +05:30
Jenkins 40c0d5e501 Merge "Move to oslosphinx" 2016-07-20 05:15:29 +00:00
Sachi King d529e2b2a2 Fix pypy soabi tests
Xenial PyPy adds multiarch to the compiled c library, so if PyPy reports
multiarch we add it to the soabi string.

If the installed PyPy is not configured for multiarch, the multiarch
config variable will not exist and `arch` will be None, in which case we
should only update the string if multiarch exists.

Change-Id: Idcd3af4878d5b66c6770f96e7235a7d2f848df81
2016-07-18 18:09:36 +10:00
weiweigu 3438c2b8ad Fix argument order for assertEqual to (expected, observed)
assertEqual expects that the arguments provided to it should be
(expected, observed). If a particluar order is kept as a convention,
then it helps to provide a cleaner message to the developer if Unit
Tests fail. The following patch fixes this issue.

TrivialFix
Closes-Bug: #1259292

Change-Id: I03c414a763b2d51210aaec362405912f29850e36
2016-07-12 12:29:24 +08:00
Ian Wienand 87288ccfd8 Move to oslosphinx
I noticed the current API documentation is unreadable [1].  Remove the
inbuilt theme and move to oslosphinx for module/api documentation.

[1] http://docs.openstack.org/developer/pbr/api/pbr.version.html

Change-Id: I8d92d849b8a2ab4baca960ae8c271214d3c2b8f4
2016-06-22 13:18:59 +10:00
Jenkins 48af2c1dbf Merge "Restore warnerrors behavior and support Sphinx 1.4" 2016-06-20 22:20:39 +00:00
Jenkins c3b5321920 Merge "Sort 'pbr freeze' output" 2016-06-18 13:31:19 +00:00
Sachi King 9a5a9052ac Restore warnerrors behavior and support Sphinx 1.4
Pass the flag to tell Sphinx to treat warnings as errors.

Add compatability note for versions 1.4.0 and suppress
re-register warnings on subsequent runs.

Change-Id: I680b448471e687919d202e8f2abe57f8ba3b22ee
Closes-Bug: #1496882
Co-Authored-By: Doug Hellmann <doug@doughellmann.com>
2016-06-18 11:18:38 +10:00
Jenkins f26e264cda Merge "Remember the insertion order for pbr.json" 2016-06-15 20:27:28 +00:00
Sachi King c9b2c50434 Fix pypy wsgi tests
Adds the path to site-packages for pypy

Change-Id: Idabf537cdaf0eadf960888ecd2f13809271facd5
2016-05-25 12:23:17 +10:00
Davanum Srinivas b340c3990e Remember the insertion order for pbr.json
When we were reviewing all the tarballs in the release
team, we were comparing the generated tar.gz from sdist
and what was actually uploaded, we saw that the pbr.json
contents keeps changing but with the same key/value pairs.
So let's try to stick to a specific order by using
sort_keys when we are converting json into a string

Change-Id: I82186522240599a240737e2c87ad524d0ed8bd28
2016-05-04 14:47:16 -04:00
Jenkins 8509e8ed94 Merge "Fix soabi tests with pypy" 2016-04-20 13:55:12 +00:00
Jenkins a05b55b3e3 Merge "Fix wsgiref script use with oslo.config" 2016-04-18 20:43:09 +00:00
Davanum Srinivas 7f02669f69 File is wrongly marked as executable
Closes-Bug: #1570014
Change-Id: I3c33ff12b0ff75651b9189bdad72276d6edc09c5
2016-04-17 01:59:41 +00:00
Thomas Herve 8778c64776 Fix wsgiref script use with oslo.config
The script generated for wsgi-script entrypoint adds a argument for
listening on a specific port using argparse. Unfortunately it's not
compatible with oslo.config handling of config options, as used by
keystone for example. This fixes the situation by only parsing known
options.

Change-Id: I37f82e8d78a4288323854282da300c123561218a
Closes-Bug: #1501756
2016-04-14 17:11:15 +02:00
Jenkins 6aa1149398 Merge "Correct server test" 2016-04-14 13:35:55 +00:00
Randall Nortman a27f51242b Handle IndexError during version string parsing
Some odd version strings can cause SemanticVersion.from_pip_string()
to raise IndexError.  This change converts IndexError to ValueError.

Change-Id: Ic3046817b6c5808c61c4a3bc3d912501e6a52274
Closes-Bug: #1570145
2016-04-13 21:52:02 -04:00
Brant Knudson ef759ed5db Correct server test
This test was relying on the short sleep allowing the subprocess
time to write to an external file. Rather than write to an
external file, have the output go to a pipe that the test process
can read so that the test doesn't have to guess how long to sleep.

Change-Id: I128a9dc5c7525d941f6e00c0073d983eab1e44e6
2016-04-13 14:17:31 -05:00
Sachi King b87e4c0824 Fix soabi tests with pypy
Change-Id: I9f20fad6487463ee85278d17bd79740ae337bfd7
2016-04-07 09:39:00 +10:00
Julien Danjou 9b5f422c34 package: fix wrong catch in email parsing
email.MessageError exception does not exist, so if an error occur, the
code block will fail completely. Fix the path to the correct class.

Co-Authored-By: Ian Cordasco <graffatcolmingov@gmail.com>
Change-Id: Ic4e69405ca6346191da66a86f0b7aa5b3b75bed6
2016-04-01 17:41:06 -05:00
Sachi King 5b046f44b2 Sort 'pbr freeze' output
Case-insensitive sort of pbr freeze output to make the output friendly
to human eyes.

Change-Id: I314082b5c7890e3cd4a99697fc2b1868dfedbb0f
2016-03-31 17:22:24 +11:00
Steve Kowalik b4d21581e2 Do not convert git tags when searching history
Currently, when the sem-ver processing is searching the git history,
it stores the canonical version and uses that as the tag, which is
fine if the project uses the canonical version as a tag. Instead,
return the original tag so that history can be correctly checked.

Change-Id: I1b83fc3dc3dd287ae3b23fd4cba07fdfdd673a7f
Closes-Bug: 1561254
2016-03-24 12:54:44 +11:00
Ian Cordasco 139110c89b Include wsgi_scripts in generated wheels
Downstream consumers, such as OpenStack Ansible, generate wheels for all
packages (including services). More and more services are moving to use
the wsgi_scripts entry-points provided and handled by pbr. Unfortunately,
these scripts are not generated during wheel creation unless we force
them to be generated because Setuptools and Distutils will only generate
console_scripts entry-points.

This also fixes the C extension on Python 3 because it was previously
broken.

Change-Id: Icecc8474028436e8b2fb752d576204d9439fb0e7
Closes-bug: #1542383
2016-03-22 16:44:49 -05:00
Jenkins 64699d79be Merge "Don't attempt to test with 0.6c11 with Py3" 2016-03-13 22:47:26 +00:00
Jenkins 75dcf9cc3d Merge "fix some variable names" 2016-03-09 05:08:53 +00:00
Sachi King 11ffee94fa Do not silently drop markers that fail to evaluate
We are silently dropping requirements that do not parse, do not do this
and bubble the error up.

Change-Id: I5bfce7c7d0be2ccd880e78509856074a09c57166
Closes-Bug: 1554331
2016-03-09 11:26:43 +11:00
Doug Hellmann 639edb49ed fix some variable names
The same variable name was being used for three argument group
objects. Replace some occurrences with more properly named variables.

Change-Id: Ibbec94d03f14fae6bed86c9479671d41b775c057
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2016-02-26 06:45:50 -05:00
Sachi King 1facf7310b Don't attempt to test with 0.6c11 with Py3
Setuptools 0.6c11 is ancient, and doesn't install on Py3, so don't
attempt to do so.  We don't test Py3 in the gate with integration, so
this is a noop there, however this means if we do so in the future
this won't bubble up as a failure.  It also allows me to run this block
of integration tests with Py3 in addtion to Py27 locally.

Change-Id: I1dc6eb7591be847573231ca1056c2cd31b2f673a
2016-02-10 16:03:34 +11:00
Sachi King d19459daa8 Support entry point patching on setuptools < 12
In patch 789888 we began relying on EntryPoint.resolve(), which only
exists in setuptools >= 12, breaking support for setuptools < 12.  This
includes the default virtualenv installations from may LTS distributions.
As ep.load with arguments is deprecated we will attempt to use
ep.resolve if it exists and fall back to ep.load(false) if it does not.
setuptools 11 is the odd release out, as this was when load with
arguments was deprecated, suggesting the use of ep._load.  We will
continue to use ep.load(False) here.

Change-Id: I272f76fef7e447378697a3980372191f4ffe1a2f
2016-01-21 13:22:06 +11:00
Jenkins 12940d5b9d Merge "Split changelog on nulls instead of (" 2016-01-14 19:37:05 +00:00
Jenkins 43e2f33e7f Merge "Handle markers to support sdist on pip < 6" 2016-01-14 02:29:33 +00:00
Monty Taylor da9ab10220 Split changelog on nulls instead of (
The logic that splits the git log lines to find tags gets confused by
parentheses in the commit message and truncates the line at the first
one. To mitigate this, have git emit a null character and split on that.

As a consequence of doing and testing this, fix the bug where
non-semantic-version tags in the tag history would show up in the
ChangeLog.

Change-Id: I5e522d6d374534f2921aaded42780df97c3d1987
2016-01-13 14:18:53 -05:00
Sachi King 7898882fa5 Handle markers to support sdist on pip < 6
Old versions of pip do not properly evaluate blank envmarkers such as
':python_version>=2.7', so as long as we are not creating a bdist_wheel
we evaluate these immediately to support these old installations

Change-Id: I94a5f9bccd658a2529a727d99f5a2b79e6b00aa8
Closes-Bug: 1502692
2015-12-17 10:59:00 +11:00
Jenkins 6c5ccdebce Merge "Enable pep8 H405 tests" 2015-12-09 10:18:03 +00:00
Luo Gangyi 768c53474d Enable pep8 H405 tests
Enabled H405 multi line docstring summary not separated with an empty
line in tox testing.

Change-Id: I1a4bfbd2bad6eb2c132843ca21451807737121df
Closes-Bug:#1524176
2015-12-08 22:35:42 -08:00
Sachi King 379e42abde Add patch to properly get all commands from dist
Distribution().get_command_list() is not hooked by setuptools like
print_commands() is, as such we do not get a complete command list.

Here we perform the hook ourselves to prevent the need to depend on
a super new version of setuptools.

Change-Id: Ie6088aedb92713be4b8b9af4a4ce3d300a114d7b
2015-12-07 19:08:36 +13:00
Jenkins 02ca3e7aae Merge "Do not error when running pep8 with py3" 2015-11-16 14:26:13 +00:00
Jenkins 0c105b0ee2 Merge "Support git://, git+ssh://, git+https:// without -e flag." 2015-11-16 06:37:19 +00:00
Jenkins bd264dfe39 Merge "More support Sphinx >=1.3b1 and <1.3.1" 2015-11-14 02:15:15 +00:00
Ryan Bourgeois 31a0e97cbf Support git://, git+ssh://, git+https:// without -e flag.
Closes-Bug: 1467683
Change-Id: I09163c8072ecbee5c1a24951511c75009511b6f8
2015-11-13 13:05:27 +11:00
Jenkins 79b8ed0dbc Merge "Cleanup jeepyb and pypi-mirror special casing" 2015-11-12 23:51:40 +00:00
Ian Y. Choi a5d46d5ce7 More support Sphinx >=1.3b1 and <1.3.1
Although https://review.openstack.org/#/c/171309/
says Sphinx >=1.3, the actual implementation does not
support Sphinx >=1.3b1 and 1.3.1.
I have seen Sphinx release notes and source codes for
those versions, and found that up to 1.2.3 used
init_values(self) and Sphinx from 1.3b1 used
init_values(self, warn).

So to change the code from >=1.3.1 to >1.2.3, it can
more support Sphinx >=1.3b1 and <1.3.1.

Change-Id: Ia73be8111d3af7f72aaf640e4c7c519a5d0b08c5
Partial-Bug: #1379998
Related-Bug: #1496882
2015-11-09 21:14:47 +09:00
Jenkins 62ee1b917b Merge "Ensure changelog log output is written if it already exists" 2015-11-07 02:35:14 +00:00
Sachi King b8cbe78e3e Do not error when running pep8 with py3
Ignore pep8 errors on python2 specific lines that fail in python 3 pep8.

Change-Id: I3895e09ea9e68eb318da92297743f5090b50c3f5
2015-10-30 10:27:01 +09:00
Joshua Harlow 00b8d5a866 Ensure changelog log output is written if it already exists
Change-Id: I85b507fd8ebe4442c420228315013707e32cd35b
2015-10-22 11:18:09 -07:00
Jenkins ae184c0742 Merge "Add build_sphinx test coverage" 2015-10-17 03:14:34 +00:00
Clark Boylan 0aeca9020e Cleanup jeepyb and pypi-mirror special casing
We have removed them from the d-g PROJECTS list so special casing in
PBR's tests is no longer necessary.

Change-Id: I6c4a587a21a81cb2dea08d2c13ecba033b1ebee0
Depends-On: I61c2f3f8a724dc789479278e7ba493e095c52305
2015-10-15 10:42:02 -07:00
James Polley 36a2bf1309 Handle the case where cmd.distribution has no pbr attribute
This can arise if pbr has been installed indirectly (for instance,
because a package depends on mock which requires pbr) - pbr will be
running, but the cmd.distribution object has no pbr attribute. In this
case, pbr code should not run.

Change-Id: Ib7db0c8ab78e3cb700671f6a123ec603b4dbfdbe
Closes-bug: 1493735
Co-Authored-By: Sachi King <nakato@nakato.io>
2015-10-07 15:28:43 +11:00
Robert Collins 58ee65d68c test_integration cleanups
We need to write some new targeted venv using tests. This fixture will
make that directly accessible without cruft. Also fixup a global-state
polluting hack in test_integration I noticed at the same time.

Change-Id: I247de9236919cb7a8b1a3257a357b4a4bac37dfd
2015-10-07 15:19:32 +13:00
Robert Collins d92f3a736e Remove redundant testscenarios glue.
discover can correctly handle packages these days, so we can load and
apply just once.

Change-Id: I8bedf6d15b0aaf3e45c2a47098ffe24240192193
2015-10-07 14:51:23 +13:00
Sachi King daa905cad4 Strip comments present in setup.cfg
When processing setup.cfg strip trailing comments from lines as this is
unsupported by setuptools.

Change-Id: I7712c07552b50830549644a6ff4167b90d897125
Closes-bug: 1494330
2015-09-14 18:26:11 +10:00
Jenkins bcc9b304b8 Merge "Support Sphinx >=1.3 new protoype and warnings" 2015-09-11 01:04:25 +00:00
Jenkins bfff48026f Merge "Protect WSGI application with a critical section" 2015-09-10 23:39:53 +00:00
Alexander Makarov 6757913f0f Protect WSGI application with a critical section
When configured as an Apache WSGI module a race condition
is possible during keystone cache initialization.
The operation raises exception region.RegionAlreadyConfigured.
This is a result of the race condition involving global
'application' variable being initialized several times
(1 per thread).
Apache modwsgi documentation suggests protecting global objects
with thread locks.

Change-Id: Ib9e2207b0d1d9cee656736e94865fb404b6a868d
Related-Bug: 1482271
2015-08-28 15:04:44 +03:00
Sachi King 8047f2feaf Have pbr egg_info.writer check PBR is enabled
PBR is currently creating a pbr.json for any install originating from a
git tree as pbr_json is an entry point for egg_info.writers.  If pbr is
not set to True in setup() we now exit before doing any work.

Change-Id: Ia37e37c22c2396f6a10aa2075ea8c501e571fee3
Closes-Bug: 1483067
2015-08-27 15:52:03 +10:00
Davanum Srinivas 1e05037c2a Strip comments in requirements files
Since we don't strip comments from end of the requirements like:
requests-kerberos>=0.6;python_version=='2.7' # MIT

The currnet code ends up failing with a:
"Invalid environment marker"

We should strip the comments out before processing.

Closes-Bug: #1487835
Change-Id: I75d2e83a5f60f93e1c38d53fb4f0a29ba35120b1
2015-08-23 21:54:15 -04:00
Jenkins 628073a31c Merge "Expose a 'rpm_version' extra command" 2015-08-17 18:08:18 +00:00
Jenkins 7253c18c72 Merge "Fix retrieval of commit data and most recent tag." 2015-08-16 12:13:02 +00:00
Timothy Chavez e19572e2d1 Support Sphinx >=1.3 new protoype and warnings
Sphinx >= 1.3 changes:
- Prototypes for init_values() requires a handle to warnings.warn
- New warning for setting the html_theme in conf.py to 'default':
   sphinx.errors.SphinxWarning: WARNING: 'default' html theme has been
   renamed to 'classic'. Please change your html_theme setting either
   to the new 'alabaster' default theme, or to 'classic' to keep using
   the old default.

This change deals with the above sphinx updates by adding the handle to
init_values() and setting pbr to _not_ fail on warnings when building the
docs.

Change-Id: Iba92628263e20efca84aeada0e19000f4c9b1fac
2015-08-10 12:39:39 -07:00
Robert Collins 5c0bb9186f Handle git being entirely absent
When we try to find the git directory, if git is not present, treat
that the same as an error from git itself. Sadly tests for this are
nearly impossible to meaningfully write, since we always have git
installed. I can do a mock based test if folk want one.

Change-Id: If6160d1fb3def8133bdd0b66105e60ef93f80f82
Closes-Bug: #1481468
2015-08-10 16:24:14 +12:00
Florian Wilhelm c3fc63c64f Fix retrieval of commit data and most recent tag.
git._iter_log_online() returns None in some cases for instance
when SKIP_WRITE_GIT_CHANGELOG is set to true. This is fixed by
returning an empty list in _iter_log_online.

Also the check if a changelog based on git should be written
was moved from git._iter_log_online to git.write_git_changelog
which makes more sense since some functions were calling
git._iter_log_online to get the changelog for other reasons than
writing it.

Additionally a unittest was added to check that setting the
environment variable SKIP_WRITE_GIT_CHANGELOG to true does not
break anything when retrieving the git version.

Change-Id: Ib12df23ab25b290dd394f9cb1456b8d5da57306a
Closes-Bug: 1467440
2015-08-03 14:44:11 +02:00
Robert Collins 89402a7177 Export ChangeLog and AUTHORS in install
readthedocs uses 'setup.py install' to prepare trees for doc creation,
but ChangeLog is not currently created there, and doing so would be
nice. This won't affect develop invocations AFAICT, and even if it
did, the overheads are ~10% of the time to run 0 tests in Nova today -
e.g. quite tolerable.

Change-Id: I7bc18fc9ca2dbe852598cc79b2ad6273fc53557d
2015-07-29 06:19:40 +12:00
Robert Collins 898f71374a Show how long the git querying takes
We get complaints on timing from time to time.

Change-Id: I51bb69f413721197dc37e974b596bae4e8b2bce2
2015-07-16 11:58:15 +12:00
Sean Dague 5b46cb8574 Add wsgi_scripts support to PBR
As we attempt to get more of OpenStack API servers to be runnable as a
regular WSGI application, we should provide support in PBR for
building these base scripts just like the console scripts.

This adds a new 'wsgi_scripts' group which builds a base script that
will run under mod_wsgi as expected. It also has a CLI fallback mode,
so that the application can be brought up as a wsgiref simple_server
for quick local testing and development. All wsgiref servers default
to binding to port 8000, but that can be overridden.

To support this, and possible future expansion of the script types,
the group list now iterates over a dictionary of group_name =>
template mappings.

This includes basic testing.

It also includes tests which would run an actual wsgi
environment. These are currently skipped as they can't be reliably run
in the gate for timing reasons on stdout processing.

Change-Id: I334639d7ecaad2703d1ff675880a314cc28e2334
2015-07-14 11:40:39 -04:00
Monty Taylor 61a3a1ecdf Wrap env markers in parens
If there are boolean conditions in the env marker, the existing join
causes the extra tag to only be applied to the first of them, causing
carnage.

Change-Id: I7b735befae76b330f923276e1c48ef23816774d4
2015-07-10 21:24:35 +00:00
Joshua Harlow 8263806033 Expose a 'rpm_version' extra command
Intended usage, getting a rpm *compatible* version number from pbr
from a pbr using python package. Typically this will then get
put into a rpm spec file (what is used to build an rpm) and used to
build an rpm using `rpmbuild` (the thing used to translate rpm spec
files into rpms).

For example: this allows [1][2] (which I am the primary maintainer of
and godaddy, cray, and y! are users of) to get out of the whacky
and/or flakey rpm version number calculation/conversion process (which
previously just worked around by saying only use tags).

[1] https://github.com/stackforge/anvil
[2] https://anvil.readthedocs.org/en/latest/topics/summary.html

Change-Id: I26cd1d6e8aef69d52e8a4f36bd264c690e712ba3
2015-07-02 04:52:14 +00:00
Thomas Bechtold 5039c9a3f8 Use string for 'OS_TEST_TIMEOUT' default
Setting env variables with os.environ needs a string as value.
This fixes:

TypeError: must be string, not int

Closes-Bug: #1467880
Change-Id: Ib0c8bbf24f9d4f8926ad71773eb57c3ff41cbec2
2015-06-23 12:16:44 +02:00
Robert Collins 4b1503849c Strip markers from test requirements.
Setuptools doesn't [yet] support markeres in tests_require parameters
to setup(). While we need to get that fixed, we also need to support
syncing marker constrained requirements from global-requirements.

Since version constraints are needed to successfully port to Python3
this won't be a long term viable solution: but few of our test-only
dependencies require version constraints, so we can do this in the
interim. The ones that do - such as python-mysql - we're either
moving away from, or centralising them into optional dependencies
on other packages where the tests_require limitation shouldn't apply.

Change-Id: I31adaf35c8d7b72fe3f8c9242cc356fe34d537e8
2015-06-19 13:58:42 +12:00