diff options
author | Chandan Singh <csingh43@bloomberg.net> | 2019-01-03 22:59:15 +0000 |
---|---|---|
committer | Tristan Van Berkom <tristan.van.berkom@gmail.com> | 2019-01-04 15:21:35 +0000 |
commit | b97928375edb3685eb53357439ddc27d1911a9ab (patch) | |
tree | 004d51a519b5bb144a6332d4c697129f2cc2e085 | |
parent | bb7128869d0b44caeb3d49f913a0af9e1369e287 (diff) | |
download | buildstream-chandan/update-requirements-one-liner.tar.gz |
CONTRIBUTING.rst: Add instructions to update requirements fileschandan/update-requirements-one-liner
Split the "The MANIFEST.in and setup.py" section in two:
"Managing data files" and "Updating BuildStream's Python dependencies".
Briefly explain the layout of `requirements` directory and add
instructions to use the Makefile added in the last commit.
-rw-r--r-- | CONTRIBUTING.rst | 26 | ||||
-rw-r--r-- | requirements/Makefile | 2 |
2 files changed, 23 insertions, 5 deletions
diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index ddcc4130d..1e672adf1 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -1736,10 +1736,8 @@ obtain profiles:: ForceCommand BST_PROFILE=artifact-receive cd /tmp && bst-artifact-receive --pull-url https://example.com/ /home/artifacts/artifacts -The MANIFEST.in and setup.py ----------------------------- -When adding a dependency to BuildStream, it's important to update the setup.py accordingly. - +Managing data files +------------------- When adding data files which need to be discovered at runtime by BuildStream, update setup.py accordingly. When adding data files for the purpose of docs or tests, or anything that is not covered by @@ -1749,3 +1747,23 @@ At any time, running the following command to create a source distribution shoul creating a tarball which contains everything we want it to include:: ./setup.py sdist + + +Updating BuildStream's Python dependencies +------------------------------------------ +BuildStream's Python dependencies are listed in multiple +`requirements files <https://pip.readthedocs.io/en/latest/reference/pip_install/#requirements-file-format>` +present in the ``requirements`` directory. + +All ``.txt`` files in this directory are generated from the corresponding +``.in`` file, and each ``.in`` file represents a set of dependencies. For +example, ``requirements.in`` contains all runtime dependencies of BuildStream. +``requirements.txt`` is generated from it, and contains pinned versions of all +runtime dependencies (including transitive dependencies) of BuildStream. + +When adding a new dependency to BuildStream, or updating existing dependencies, +it is important to update the appropriate requirements file accordingly. After +changing the ``.in`` file, run the following to update the matching ``.txt`` +file:: + + make -C requirements diff --git a/requirements/Makefile b/requirements/Makefile index 4f966254f..c49a2e2d0 100644 --- a/requirements/Makefile +++ b/requirements/Makefile @@ -14,7 +14,7 @@ VENV_PIP = $(VENVDIR)/bin/pip all: $(REQUIREMENTS_TXT) %.txt: %.in - $(eval VENVDIR := $(shell mktemp -d $$TMPDIR/bst-venv.XXXXXX)) + $(eval VENVDIR := $(shell mktemp -d $(CURDIR)/.bst-venv.XXXXXX)) $(VENV) $(VENVDIR) $(VENV_PIP) install -r $^ $(VENV_PIP) freeze -r $^ > $@ |