Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: Deduplicate mismatched pip.txt files that caused build failure #32081

Merged
merged 2 commits into from
Apr 17, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 15 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ pull: ## update the Docker image used by "make shell"
docker pull edxops/edxapp:latest

pre-requirements: ## install Python requirements for running pip-tools
pip install -qr requirements/pip.txt
pip install -qr requirements/edx/pip-tools.txt
pip install -r requirements/pip.txt
pip install -r requirements/pip-tools.txt

local-requirements:
# edx-platform installs some Python projects from within the edx-platform repo itself.
Expand All @@ -74,7 +74,7 @@ local-requirements:
dev-requirements: pre-requirements
@# The "$(wildcard..)" is to include private.txt if it exists, and make no mention
@# of it if it does not. Shell wildcarding can't do that with default options.
pip-sync -q requirements/edx/development.txt $(wildcard requirements/edx/private.txt)
pip-sync requirements/edx/development.txt $(wildcard requirements/edx/private.txt)
make local-requirements

base-requirements: pre-requirements
Expand All @@ -96,7 +96,6 @@ shell: ## launch a bash shell in a Docker container with all edx-platform depend

# Order is very important in this list: files must appear after everything they include!
REQ_FILES = \
requirements/edx/pip-tools \
requirements/edx/coverage \
requirements/edx/doc \
requirements/edx/paver \
Expand All @@ -117,23 +116,26 @@ $(COMMON_CONSTRAINTS_TXT):
echo "$(COMMON_CONSTRAINTS_TEMP_COMMENT)" | cat - $(@) > temp && mv temp $(@)

compile-requirements: export CUSTOM_COMPILE_COMMAND=make upgrade
compile-requirements: $(COMMON_CONSTRAINTS_TXT) ## Re-compile *.in requirements to *.txt
pip install -q pip-tools
pip-compile --allow-unsafe --upgrade -o requirements/edx/pip.txt requirements/edx/pip.in
compile-requirements: pre-requirements $(COMMON_CONSTRAINTS_TXT) ## Re-compile *.in requirements to *.txt
@# Bootstrapping: Rebuild pip and pip-tools first, and then install them
@# so that if there are any failures we'll know now, rather than the next
@# time someone tries to use the outputs.
pip-compile -v --allow-unsafe ${COMPILE_OPTS} -o requirements/pip.txt requirements/pip.in
pip install -r requirements/pip.txt

pip-compile -v ${COMPILE_OPTS} -o requirements/pip-tools.txt requirements/pip-tools.in
pip install -r requirements/pip-tools.txt

@ export REBUILD='--rebuild'; \
for f in $(REQ_FILES); do \
echo ; \
echo "== $$f ===============================" ; \
echo "pip-compile -v --no-emit-trusted-host --no-emit-index-url $$REBUILD ${COMPILE_OPTS} -o $$f.txt $$f.in"; \
pip-compile -v --no-emit-trusted-host --no-emit-index-url $$REBUILD ${COMPILE_OPTS} -o $$f.txt $$f.in || exit 1; \
echo "pip-compile -v $$REBUILD ${COMPILE_OPTS} -o $$f.txt $$f.in"; \
pip-compile -v $$REBUILD ${COMPILE_OPTS} -o $$f.txt $$f.in || exit 1; \
export REBUILD=''; \
done

pip install -qr requirements/edx/pip.txt
pip install -qr requirements/edx/pip-tools.txt

upgrade: pre-requirements ## update the pip requirements files to use the latest releases satisfying our constraints
upgrade: ## update the pip requirements files to use the latest releases satisfying our constraints
$(MAKE) compile-requirements COMPILE_OPTS="--upgrade"

check-types: ## run static type-checking tests
Expand Down
2 changes: 1 addition & 1 deletion requirements/edx/development.in
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

-c ../constraints.txt

-r pip-tools.txt # pip-tools and its dependencies, for managing requirements files
-r ../pip-tools.txt # pip-tools and its dependencies, for managing requirements files
timmc-edx marked this conversation as resolved.
Show resolved Hide resolved
-r testing.txt # Dependencies for running the various test suites

click # Used for perf_tests utilities in modulestore
Expand Down
14 changes: 7 additions & 7 deletions requirements/edx/development.txt
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ bridgekeeper==0.9
# via -r requirements/edx/testing.txt
build==0.10.0
# via
# -r requirements/edx/pip-tools.txt
# -r requirements/edx/../pip-tools.txt
# pip-tools
celery==5.2.7
# via
Expand Down Expand Up @@ -168,8 +168,8 @@ chem==1.2.0
click==8.1.3
# via
# -c requirements/edx/../constraints.txt
# -r requirements/edx/../pip-tools.txt
# -r requirements/edx/development.in
# -r requirements/edx/pip-tools.txt
# -r requirements/edx/testing.txt
# celery
# click-didyoumean
Expand Down Expand Up @@ -1047,7 +1047,7 @@ outcome-surveys==2.4.0
# via -r requirements/edx/testing.txt
packaging==23.0
# via
# -r requirements/edx/pip-tools.txt
# -r requirements/edx/../pip-tools.txt
# -r requirements/edx/testing.txt
# build
# drf-yasg
Expand Down Expand Up @@ -1093,7 +1093,7 @@ pillow==9.4.0
# edx-enterprise
# edx-organizations
pip-tools==6.12.3
# via -r requirements/edx/pip-tools.txt
# via -r requirements/edx/../pip-tools.txt
pkgutil-resolve-name==1.3.10
# via
# -r requirements/edx/testing.txt
Expand Down Expand Up @@ -1237,7 +1237,7 @@ pyparsing==3.0.9
# openedx-calc
pyproject-hooks==1.0.0
# via
# -r requirements/edx/pip-tools.txt
# -r requirements/edx/../pip-tools.txt
# build
pyquery==2.0.0
# via -r requirements/edx/testing.txt
Expand Down Expand Up @@ -1584,7 +1584,7 @@ toml==0.10.2
# via vulture
tomli==2.0.1
# via
# -r requirements/edx/pip-tools.txt
# -r requirements/edx/../pip-tools.txt
# -r requirements/edx/testing.txt
# build
# coverage
Expand Down Expand Up @@ -1691,7 +1691,7 @@ webob==1.8.7
# xblock
wheel==0.40.0
# via
# -r requirements/edx/pip-tools.txt
# -r requirements/edx/../pip-tools.txt
# pip-tools
wrapt==1.15.0
# via
Expand Down
14 changes: 0 additions & 14 deletions requirements/edx/pip.txt

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
# * confirm that it has no system requirements beyond what we already install
# * run "make upgrade" to update the detailed requirements files

-c ../constraints.txt
-c constraints.txt

pip-tools # Contains pip-compile, used to generate pip requirements files
4 changes: 2 additions & 2 deletions requirements/edx/pip-tools.txt → requirements/pip-tools.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ build==0.10.0
# via pip-tools
click==8.1.3
# via
# -c requirements/edx/../constraints.txt
# -c requirements/constraints.txt
# pip-tools
packaging==23.0
# via build
pip-tools==6.12.3
# via -r requirements/edx/pip-tools.in
# via -r requirements/pip-tools.in
pyproject-hooks==1.0.0
# via build
tomli==2.0.1
Expand Down
2 changes: 1 addition & 1 deletion requirements/edx/pip.in → requirements/pip.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
-c ../constraints.txt
-c constraints.txt
# Core dependencies for installing other dependencies

pip
Expand Down
16 changes: 14 additions & 2 deletions requirements/pip.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,14 @@
pip==22.1
wheel==0.37.1
#
# This file is autogenerated by pip-compile with Python 3.8
# by the following command:
#
# make upgrade
#
wheel==0.40.0
# via -r requirements/pip.in

# The following packages are considered to be unsafe in a requirements file:
pip==23.0.1
# via -r requirements/pip.in
setuptools==67.6.0
# via -r requirements/pip.in
2 changes: 1 addition & 1 deletion scripts/ci-runner.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ COPY openedx/core/lib openedx/core/lib
COPY lms lms
COPY cms cms
COPY requirements/pip.txt requirements/pip.txt
COPY requirements/edx/pip-tools.txt requirements/edx/pip-tools.txt
COPY requirements/pip-tools.txt requirements/pip-tools.txt
COPY requirements/edx/testing.txt requirements/edx/testing.txt
COPY Makefile Makefile
RUN make test-requirements
Expand Down