Skip to content

Commit 4406437

Browse files
authored
Use --no-deps when installing compiled requirements files (#2752)
1 parent 4819ecc commit 4406437

File tree

8 files changed

+14
-13
lines changed

8 files changed

+14
-13
lines changed

.circleci/config.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
command: |
3535
python3.8 -m venv venv/
3636
venv/bin/pip install pip-tools --constraint requirements.in
37-
venv/bin/pip-sync
37+
venv/bin/pip-sync --pip-args=--no-deps
3838
- run:
3939
name: Yamllint Test
4040
command: PATH="venv/bin:$PATH" yamllint -c .yamllint.yaml .
@@ -176,7 +176,8 @@ jobs:
176176
apt update
177177
apt install -y maven default-jdk-headless
178178
mvn dependency:copy-dependencies
179-
venv/bin/pip-sync requirements.txt java-requirements.txt
179+
venv/bin/pip-sync --pip-args=--no-deps requirements.txt \
180+
java-requirements.txt
180181
- run:
181182
name: PyTest Integration Test
182183
# Google's client libraries will check for
@@ -497,8 +498,8 @@ jobs:
497498
bigquery-etl-main
498499
499500
cd bigquery-etl-main
500-
pip install -r requirements.txt
501-
pip install -r java-requirements.txt
501+
pip install --no-deps -r requirements.txt
502+
pip install --no-deps -r java-requirements.txt
502503
mvn dependency:copy-dependencies
503504
./script/bqetl generate all \
504505
--target-project moz-fx-data-shared-prod

Dockerfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,10 @@ WORKDIR /app
1313
FROM base AS python-deps
1414
RUN apt-get update -qqy && apt-get install -qqy gcc libc-dev
1515
COPY java-requirements.txt ./
16-
RUN pip install -r java-requirements.txt
16+
RUN pip install --no-deps -r java-requirements.txt
1717
COPY requirements.txt ./
18-
RUN pip install -r requirements.txt
18+
# use --no-deps to work around https://github.com/pypa/pip/issues/9644
19+
RUN pip install --no-deps -r requirements.txt
1920

2021
# download java dependencies in separate stage because it requires maven
2122
FROM base AS java-deps

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ venv/bin/pre-commit install
4949
4. Download java dependencies
5050
```bash
5151
mvn dependency:copy-dependencies
52-
venv/bin/pip-sync requirements.txt java-requirements.txt
52+
# specify `<(echo mozilla-bigquery-etl)` to retain bqetl from `./bqetl bootstrap`
53+
venv/bin/pip-sync --pip-args=--no-deps requirements.txt java-requirements.txt <(echo mozilla-bigquery-etl)
5354
```
5455

5556
Finally, if you are using Visual Studio Code, you may also wish to use our recommended defaults:

bqetl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ if [ "$CMD" == "bootstrap" ]; then
2929
# see e.g. https://github.com/scipy/scipy/issues/13102#issuecomment-788160041
3030
export SYSTEM_VERSION_COMPAT=1
3131

32-
venv/bin/pip install -r requirements.txt
32+
venv/bin/pip install --no-deps -r requirements.txt
3333
venv/bin/pip install -e .
3434
echo "bqetl configured! It should now be ready for use."
3535
exit 0

docs/cookbooks/common_workflows.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ python3 -m venv venv/
227227
source venv/bin/activate
228228

229229
# If not installed:
230-
pip install pip-tools
230+
pip install pip-tools --constraint requirements.in
231231

232232
# Add the dependency to requirements.in e.g. Jinja2.
233233
echo Jinja2==2.11.1 >> requirements.in

docs/cookbooks/testing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ python3.8 -m venv venv/
1010
./venv/bin/pip install pip-tools -c requirements.in
1111
1212
# install python dependencies with pip-sync (provided by pip-tools)
13-
./venv/bin/pip-sync
13+
./venv/bin/pip-sync --pip-args=--no-deps requirements.txt java-requirements.txt
1414
1515
# install java dependencies with maven
1616
mvn dependency:copy-dependencies

requirements.in

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,8 @@ click==8.0.4
55
gcsfs==2022.2.0
66
gcloud==0.18.3
77
gitpython==3.1.27
8-
google-api-core==1.31.5 # transitive dep that needs dependabot updates
98
google-cloud-bigquery==2.34.0
109
google-cloud-storage==2.1.0
11-
googleapis-common-protos==1.54.0 # transitive dep that needs dependabot updates
1210
importlib-resources>=1.4.0 # jsonschema dep for python<3.9
1311
Jinja2==3.0.3
1412
jsonschema==4.4.0

script/glam/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ python3 -m venv venv
1717
source venv/bin/activate
1818

1919
# install dependencies
20-
pip install -r requirements.txt
20+
pip install --no-deps -r requirements.txt
2121
# install bqetl command-line tool
2222
pip install -e .
2323
```

0 commit comments

Comments
 (0)