0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-11-22 13:07:39 +01:00
mongodb/etc/pip
2019-06-04 13:33:53 -04:00
..
components SERVER-40895 Dynamically generate burn_in_tests for tag validation 2019-06-04 13:33:53 -04:00
compile-requirements.txt
core-requirements.txt
dev-requirements.txt
evgtest-requirements.txt SERVER-38615 The psutil module should be installed on all platforms 2018-12-14 09:23:42 -05:00
jira-requirements.txt
lint-requirements.txt
powercycle-requirements.txt
README.md SERVER-40770 Remove etc/pip/constraints.txt and related infrastructure 2019-05-13 10:47:47 -04:00
toolchain-requirements.txt SERVER-40548 Install Python dependencies once immediately after creating virtualenv 2019-04-23 11:00:08 -04:00

On requirements (*-requirements.txt) files

MongoDB requires multiple pypa projects installed to build and test. To that end, we provide our own *-requirements.txt files for specific domains of use. Inside each requirements file, there are only include statements for component files. These files are the bare requirements for specific components of our python environment. This separation allows us to avoid repetition and conflict in our requirements across components.

For most developers, if you pip-install dev-requirements.txt, you have the python requirements to lint, build, and test MongoDB.

How to modify a pypa project requirement in a component

The most common edit of our requirements is likely a change to the constraints on a pypa project that we already use. For example, say that we currently require pymongo >= 3.0, < 3.6.0 in the component core. You would like to use PyMongo 3.7, so you instead modify the line in etc/pip/components/core.req to read pymongo >= 3.0, != 3.6.0.

How to add a new component (*.req) file

Occasionally, we will require a set of pypa projects for an entirely new piece of software in our repository. This usually implies adding a new component file. For example, say that we need to add a logging system to both local development and evergreen. This system requires the fictional pypa project FooLog. So we add a file foolog.req and require it from both dev-requirements.txt and evgtest-requirements.txt. Like the majority of our components, we want it in the toolchain, so we also add it to toolchain-requirements.txt. The workflow will usually look like:

$ # Make the component file
$ echo "FooLog" >etc/pip/components/foolog.req
$ # Require the component from the requirements files
$ echo "-r components/foolog.req" >>etc/pip/dev-requirements.txt
$ echo "-r components/foolog.req" >>etc/pip/evgtest-requirements.txt
$ echo "-r components/foolog.req" >>etc/pip/toolchain-requirements.txt

How to add a new requirements (*-requirements.txt) file

Rarely, we will have an entirely new domain of requirements that is useful. In this case, we need to at least make a new requirements file. For example, say we want to make a requirements file for packaging our code. We would need most of the requirements for dev-requirements.txt but the testing has already been done in our continuous integration. So we create a new file package-requirements.txt and require a smaller subset of components. The new file at etc/pip/package-requirements.txt would look like this:

-r components/platform.req
-r components/core.req

-r components/compile.req
-r components/lint.req