8bc094cf9e
Some constraints files[1] contain valid data but we want to ignore them when generating a combined lower-constraints.txt, rather than erroring out: [tony@thor requirements]$ time .tox/venv/bin/build-lower-constraints ../*/lower-constraints.txt > tjmaxx.txt Traceback (most recent call last): File ".tox/venv/bin/build-lower-constraints", line 10, in <module> sys.exit(main()) File "/home/tony/projects/openstack/openstack/requirements/openstack_requirements/cmds/build_lower_constraints.py", line 71, in main merged = list(merge_constraints_sets(constraints_sets)) File "/home/tony/projects/openstack/openstack/requirements/openstack_requirements/cmds/build_lower_constraints.py", line 53, in merge_constraints_sets val = max((c[0] for c in constraints), key=get_requirements_version) File "/home/tony/projects/openstack/openstack/requirements/openstack_requirements/cmds/build_lower_constraints.py", line 43, in get_requirements_version raise ValueError('could not find version for {}'.format(req)) ValueError: could not find version for Requirement(package='', location='', specifiers='', markers='', comment='# flake8==2.5.5', extras=frozenset()) Let's just ignore comments in those files. [1] http://git.openstack.org/cgit/openstack/zaqar/tree/lower-constraints.txt#n28 Change-Id: Ie347ab273a1b239d9d264704482d3202dc4e4c74 |
||
---|---|---|
.zuul.d | ||
babel-test | ||
doc/source | ||
openstack_requirements | ||
playbooks | ||
tools | ||
.gitignore | ||
.gitreview | ||
.stestr.conf | ||
bindep.txt | ||
blacklist.txt | ||
detail.py | ||
global-requirements.txt | ||
lower-constraints-xfails.txt | ||
lower-constraints.txt | ||
MANIFEST.in | ||
projects.txt | ||
README.rst | ||
requirements.txt | ||
setup.cfg | ||
setup.py | ||
test-requirements.txt | ||
tox.ini | ||
update.py | ||
upper-constraints-xfails.txt | ||
upper-constraints.txt |
Global Requirements for OpenStack Projects
Why Global Requirements?
Refer to the Dependency Management section of the Project Team Guide for information about the history of the project and the files involved.
Tools
All the tools require openstack_requirements to be installed (e.g. in a Python virtualenv). They all have help, which is the authoritative documentation.
update-requirements
This will update the requirements in a project from the global
requirements file found in .
. Alternatively, pass
--source
to use a different global requirements file:
update-requirements --source /opt/stack/requirements /opt/stack/nova
Entries in all requirements files will have their versions updated to match the entries listed in the global requirements. Excess entries will cause errors in hard mode (the default) or be ignored in soft mode.
generate-constraints
Compile a constraints file showing the versions resulting from
installing all of global-requirements.txt
:
generate-constraints -p /usr/bin/python2.7 -p /usr/bin/python3 \
-b blacklist.txt -r global-requirements.txt > new-constraints.txt
edit-constraints
Replace all references to a package in a constraints file with a new specification. Used by DevStack to enable git installations of libraries that are normally constrained:
edit-constraints oslo.db "-e file://opt/stack/oslo.db#egg=oslo.db"
build-lower-constraints
Combine multiple lower-constraints.txt files to produce a list of the highest version of each package mentioned in the files. This can be used to produce the "highest minimum" for a global lower constraints list (a.k.a., the "TJ Maxx").
To use the script, run:
$ tox -e venv -- build-lower-constraints input1.txt input2.txt
Where the input files are lower-constraints.txt or requirements.txt files from one or more projects.
If the inputs are requirements files, a lower constraints list for the requirements is produced. If the inputs are lower-constraints.txt, the output includes the highest version of each package referenced in the files.
Proposing changes
Look at the Review Guidelines and make sure your change meets them.
All changes to global-requirements.txt
may dramatically
alter the contents of upper-constraints.txt
due to adding
or removing transitive dependencies. As such you should always generate
a diff against the current merged constraints, otherwise your change may
fail if it is incompatible with the current tested constraints.
A change to the minimum specified vesion of a library in
global-requirements.txt
currenty requires adjusting the
lower-constraints.txt
file alongside with the new
constrainted coinstallable version of minimums.
Regenerating involves five steps.
Install the dependencies needed to compile various Python packages:
sudo apt-get install $(bindep -b)
Create a reference file (do this without your patch applied):
generate-constraints -p /usr/bin/python2.7 -p /usr/bin/python3 \ -b blacklist.txt -r global-requirements.txt > baseline
Apply your patch and generate a new reference file:
generate-constraints -p /usr/bin/python2.7 -p /usr/bin/python3 \ -b blacklist.txt -r global-requirements.txt > updated
Diff them:
diff -p baseline updated
Apply the patch to
upper-constraints.txt
. This may require some fiddling.edit-constraint
can do this for you when the change does not involve multiple lines for one package.