Skip to content

Commit 928b5dd

Browse files
author
dubious90
authored
Create documentation for finding major dependency updates (envoyproxy#884)
Documentation includes: 1. Added step to check for python dependencies once a month when updating envoy. 2. Included documentation for how to find python dependency updates. 3. Included a section on identifying a class of errors as needing a new dependency, which was part of what made envoyproxy#819 more confusing. Signed-off-by: Nathan Perry <[email protected]>
1 parent af69a42 commit 928b5dd

File tree

2 files changed

+66
-7
lines changed

2 files changed

+66
-7
lines changed

MAINTAINERS.md

+58
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,9 @@ important maintenance task. When performing the update, follow this procedure:
7373
[Envoy's version](https://github.com/envoyproxy/envoy/blob/main/tools/gen_compilation_database.py) to
7474
update our build configurations. Be sure to retain our local modifications,
7575
all lines that are unique to Nighthawk are marked with comment `# unique`.
76+
1. If [requirements.txt](requirements.txt) has not been updated in the last month (based on comment at top
77+
of file), check for major dependency updates. See
78+
[Finding python dependencies](#finding-python-dependencies) below for instructions.
7679
1. Run `ci/do_ci.sh test`. Sometimes the dependency update comes with changes
7780
that break our build. Include any changes required to Nighthawk to fix that
7881
in the same PR.
@@ -84,6 +87,61 @@ important maintenance task. When performing the update, follow this procedure:
8487
1. Create a PR with a title like `Update Envoy to 9753819 (Jan 24th 2021)`,
8588
describe all performed changes in the PR's description.
8689
90+
## Finding python dependencies
91+
92+
We should check our python dependencies periodically for major version updates. We attempt to
93+
update these dependencies monthly. Here is an easy way to check for major dependency updates:
94+
95+
1. Create and activate a virtual env:
96+
```
97+
virtualenv pip_update_env
98+
source pip_update_env/bin/activate
99+
```
100+
NOTE: if `pip_update_env/bin/activate` appears to not exist, try
101+
`pip_update_env/local/bin/activate` instead.
102+
103+
1. Install dependencies:
104+
105+
```
106+
pip install -r requirements.txt
107+
```
108+
109+
1. Check for outdated dependencies:
110+
111+
```
112+
pip list --outdated
113+
```
114+
This will likely show both outdated dependencies based on requirements.txt and other outdated
115+
dependencies you may have in addition, such as to `pip` itself. Here, we are only interested in
116+
cross-referencing the ones that appear with the ones in requirements.txt.
117+
118+
1. If you find any dependency updates, you can either try updating the dependency in requirements.txt yourself
119+
or create an issue for the change and assign it to one of the nighthawk maintainers.
120+
121+
If there are not any dependency updates, please update the timestamp at the top of the file.
122+
123+
1. When done, clean up the virtual env:
124+
125+
```
126+
deactivate
127+
rm -rf pip_update_env
128+
```
129+
130+
### Bazel Python Error
131+
132+
If you encounter an error that looks like:
133+
134+
```
135+
ERROR: REDACTED/nighthawk/test/integration/BUILD:32:11: no such package '@python_pip_deps//pypi__more_itertools':
136+
BUILD file not found in directory 'pypi__more_itertools' of external repository @python_pip_deps. Add a BUILD
137+
file to a directory to mark it as a package. and referenced by '//test/integration:integration_test_base_lean'
138+
```
139+
140+
Then we are missing a dependency from requirements.txt. This may happen due to changing other
141+
dependencies.
142+
143+
The name of the dependency to add is everything after `pypi__`, in the above case `more_itertools`.
144+
87145
## Identifying an Envoy commit that introduced a breakage
88146
89147
### Background

requirements.txt

+8-7
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
requests>=2.28.1, <3.0.0
1+
# Last updated 2022-08-02
2+
apipkg>=3.0.1, <4.0.0
3+
chardet>=5.0.0, <6.0.0
4+
importlib_metadata>=4.12.0, <5.0.0
5+
more_itertools>=8.13.0, <9.0.0
26
pytest>=7.1.2, <8.0.0
37
pytest-dependency>=0.5.1, <0.6.0 # versions below 1.0.0 are unstable, so we should only take in bugfixes automatically
48
pytest-xdist>=2.5.0, <3.0.0
5-
apipkg>=3.0.1, <4.0.0
69
pyyaml>=6.0.0, <7.0.0
7-
zipp>=3.8.1, <4.0.0
8-
importlib_metadata>=4.12.0, <5.0.0
9-
more_itertools>=8.13.0, <9.0.0
10-
chardet>=5.0.0, <6.0.0
11-
six>=1.16.0, <2.0.0
10+
requests>=2.28.1, <3.0.0
11+
six>=1.16.0, <2.0.0
12+
zipp>=3.8.1, <4.0.0

0 commit comments

Comments
 (0)