This repo does not need tools/tox_install.sh at all, instead call pip
install directly and add constraints to dependencies.
Change-Id: Id6b1afde54d3dc26c1e95e85ec7e6a7100ff671b
Having neutron-lib in the upper-constraints file causes
the api-ref build fail. With this change neutron-lib is
removed by edit-constraints.
Change-Id: Ic6ae5ca829f73477c54999bab3eb5d9320636219
Signed-off-by: csatari <gergely.csatari@nokia.com>
This patch updates our api-report tooling as follows:
- Bugfix to support None as a valid public API attribute value.
- Rather than tracking collections with scalars, the tool now just
tracks the type of the collection (e.g. dict, list, etc.). There's no
reason for this tool to dig into collections and track their values
for API (tho it could do more with additional effort/code).
- Better handling/output for API signature changes. Previously
some of the output describing a changed API was a bit confusing.
This patch tries to address that issue by adding additional handling
for the scenario.
Sample output from current report [1] vs output with this patch [2].
[1] http://paste.openstack.org/show/587662/
[2] http://paste.openstack.org/show/587663/
Change-Id: Ic380633477c9939773198463a21ef887d575aa21
This will make neutron-lib gate use dependency versions that are sanity
checked by jobs in openstack/requirements gate.
Since the library is itself in upper-constraints.txt file, we should
remove its entry from the constraints file before applying it, otherwise
pip will fail due to version conflict between what's in the current
library repo and what's in constraints file.
Change-Id: I6a708e7b618f2f2da9c9210a19e4d4e4ac370462
This change updates the pyir report tooling:
- Regex patterns for blacklisting report generation and
diff are now supported via CLI.
- CLI commands are modularized for easier extension.
- A new CLI command is added that takes an existing JSON
API report and outputs its signatures to STDOUT. This is
useful for listing an API given a report.
- A few minor bugs are fixed that were found during testing.
Note:
This is the last major "enhancement" I have planned for this
tooling code in its current form. Of course bugs will be
addressed. Once we give it a little burn-in time (assuming we
find it useful) I'll query the broader community for interest.
If there's broader interest I'll consider refactoring + hosting
it as a separate project (obviously a ways out, as that takes
time).
Change-Id: Ia6ed70bd9457e119a6c12d8d133f77384e392282
NB: The code here is not pretty and could use some love.
However there's many more pressing things to do, so perhaps
this can be revisited later need be (as we agreed during the
neutron-lib meeting [3]).
This patch adds a python and bash script to our tools that can be
run during tox/gate to generate python public API reports as
discussed during out neutron lib meeting [2][3]. The idea is that
this tool can be run to generate a public API report that we can
use to release note our neutron-lib releases [3].
There are 2 main approaches for extracting an API from python
source; (a) loading the source an using inspect based modules
to reflect the API and (b) reading the source without loading
it and parsing API signatures from raw source text. In addition
a hybrid approach can be taken with uses a combination of
This script uses preprocessing and inspection to permit python
source to be loaded (without its dependencies) and inspected.
The inspected source's public signatures are collected and
stored in a JSON format that defines the public API for the
inspected source. JSON API reports can also be compared to
determine what public APIs have changed, added, removed or
stayed the same.
The high level approach for generating an API is as follows:
- Copy the source directory tree to a temp staging location.
- Replace all imports in the staging source with mock imports
so that modules can be loaded without dependencies.
- Walk the source, dynamically loading modules and inspecting
them.
- Build a representation of the inspection including public
signatures. This include public functions, methods, and
variables. Only simple/scalar variable (module or class attrs)
values are tracked at present.
- Format the representation into a JSON format that can
be saved to a file and later used for comparison.
For a sample of the current output, see [1].
This patch also adds a standalone tox target called 'api-report'
that can be used to generate a new API report against the
current change. Note that tox target explicitly specifies the
neutron-lib version to do the api diff against and thus will need
updating per neutron-lib release.
[1] http://paste.openstack.org/show/526626/
[2] http://goo.gl/9Xpi4K
[3] http://goo.gl/LlAjX7
Change-Id: If31ae832f86ff146bd8fb53b6d4a5aa9b8217f72
Without this the tool reports:
gkotton@ubuntu:~/neutron-lib$ ./tools/migration_report.sh ../vmware-nsx/
You have 2517 total imports
You imported Neutron 477 times
You imported Neutron-Lib 108 times
./tools/migration_report.sh: line 30: bc: command not found
./tools/migration_report.sh: line 31: bc: command not found
./tools/migration_report.sh: line 33: [: : integer expression expected
Closes-bug: #1604438
Change-Id: Ib8236ae214d423c993d9e22035f70af1821af944
Add a tool that tracks how far off a subproject is from breaking
the dependency from neutron.
Something fun to help us ease the pain. An example output is like
the one below:
You have 229 total imports
You imported Neutron 78 times
You imported Neutron-Lib 10 times
You need to get to 100%, you are this far: 11.3600%, get on with it!
Change-Id: I1a1d89a2628587e95e339524e5593191a27fe5bf