From 2f56caa76556d46a18b7925405989c1144bc5ce2 Mon Sep 17 00:00:00 2001 From: Jawayria Date: Thu, 23 Jun 2022 19:30:51 +0500 Subject: [PATCH] fix: Install pip and pip-tools in upgrade script --- Makefile | 14 +++- requirements/base.txt | 2 +- requirements/common_constraints.txt | 25 +++++++ requirements/constraints.txt | 12 ++++ requirements/pip-tools.in | 3 + requirements/pip-tools.txt | 20 ++++++ requirements/pip.in | 6 ++ requirements/pip.txt | 16 +++++ requirements/server.txt | 18 ++--- requirements/testing.txt | 100 ++++++++++++++-------------- 10 files changed, 155 insertions(+), 61 deletions(-) create mode 100644 requirements/common_constraints.txt create mode 100644 requirements/constraints.txt create mode 100644 requirements/pip-tools.in create mode 100644 requirements/pip-tools.txt create mode 100644 requirements/pip.in create mode 100644 requirements/pip.txt diff --git a/Makefile b/Makefile index 045c727..aada4e0 100644 --- a/Makefile +++ b/Makefile @@ -15,9 +15,19 @@ clean: ## remove generated byte code, coverage reports, and build artifacts rm -fr dist/ rm -fr *.egg-info +COMMON_CONSTRAINTS_TXT=requirements/common_constraints.txt +.PHONY: $(COMMON_CONSTRAINTS_TXT) +$(COMMON_CONSTRAINTS_TXT): + wget -O "$(@)" https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt || touch "$(@)" + upgrade: export CUSTOM_COMPILE_COMMAND=make upgrade -upgrade: ## update the requirements/*.txt files with the latest packages satisfying requirements/*.in - pip install -q pip-tools +upgrade: $(COMMON_CONSTRAINTS_TXT) + ## update the requirements/*.txt files with the latest packages satisfying requirements/*.in + pip install -qr requirements/pip-tools.txt + pip-compile --upgrade --rebuild --allow-unsafe -o requirements/pip.txt requirements/pip.in + pip-compile --upgrade -o requirements/pip-tools.txt requirements/pip-tools.in + pip install -qr requirements/pip.txt + pip install -qr requirements/pip-tools.txt pip-compile --upgrade -o requirements/base.txt requirements/base.in pip-compile --upgrade -o requirements/server.txt requirements/server.in pip-compile --upgrade -o requirements/testing.txt requirements/testing.in diff --git a/requirements/base.txt b/requirements/base.txt index 7a338ac..5984c3e 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -1,5 +1,5 @@ # -# This file is autogenerated by pip-compile +# This file is autogenerated by pip-compile with python 3.8 # To update, run: # # make upgrade diff --git a/requirements/common_constraints.txt b/requirements/common_constraints.txt new file mode 100644 index 0000000..cca3ccd --- /dev/null +++ b/requirements/common_constraints.txt @@ -0,0 +1,25 @@ +# A central location for most common version constraints +# (across edx repos) for pip-installation. +# +# Similar to other constraint files this file doesn't install any packages. +# It specifies version constraints that will be applied if a package is needed. +# When pinning something here, please provide an explanation of why it is a good +# idea to pin this package across all edx repos, Ideally, link to other information +# that will help people in the future to remove the pin when possible. +# Writing an issue against the offending project and linking to it here is good. +# +# Note: Changes to this file will automatically be used by other repos, referencing +# this file from Github directly. It does not require packaging in edx-lint. + + +# using LTS django version +Django<4.0 + +# elasticsearch>=7.14.0 includes breaking changes in it which caused issues in discovery upgrade process. +# elastic search changelog: https://www.elastic.co/guide/en/enterprise-search/master/release-notes-7.14.0.html +elasticsearch<7.14.0 + +setuptools<60 + +# django-simple-history>3.0.0 adds indexing and causes a lot of migrations to be affected +django-simple-history==3.0.0 diff --git a/requirements/constraints.txt b/requirements/constraints.txt new file mode 100644 index 0000000..a51cb08 --- /dev/null +++ b/requirements/constraints.txt @@ -0,0 +1,12 @@ +# Version constraints for pip-installation. +# +# This file doesn't install any packages. It specifies version constraints +# that will be applied if a package is needed. +# +# When pinning something here, please provide an explanation of why. Ideally, +# link to other information that will help people in the future to remove the +# pin when possible. Writing an issue against the offending project and +# linking to it here is good. + +# Common constraints for edx repos +-c common_constraints.txt diff --git a/requirements/pip-tools.in b/requirements/pip-tools.in new file mode 100644 index 0000000..f99de0e --- /dev/null +++ b/requirements/pip-tools.in @@ -0,0 +1,3 @@ +-c constraints.txt + +pip-tools diff --git a/requirements/pip-tools.txt b/requirements/pip-tools.txt new file mode 100644 index 0000000..ce56f4c --- /dev/null +++ b/requirements/pip-tools.txt @@ -0,0 +1,20 @@ +# +# This file is autogenerated by pip-compile with python 3.8 +# To update, run: +# +# make upgrade +# +click==8.1.3 + # via pip-tools +pep517==0.12.0 + # via pip-tools +pip-tools==6.6.2 + # via -r requirements/pip-tools.in +tomli==2.0.1 + # via pep517 +wheel==0.37.1 + # via pip-tools + +# The following packages are considered to be unsafe in a requirements file: +# pip +# setuptools diff --git a/requirements/pip.in b/requirements/pip.in new file mode 100644 index 0000000..148828c --- /dev/null +++ b/requirements/pip.in @@ -0,0 +1,6 @@ +-c constraints.txt +#Core dependencies for installing other packages + +pip +setuptools +wheel diff --git a/requirements/pip.txt b/requirements/pip.txt new file mode 100644 index 0000000..8a667c4 --- /dev/null +++ b/requirements/pip.txt @@ -0,0 +1,16 @@ +# +# This file is autogenerated by pip-compile with python 3.8 +# To update, run: +# +# make upgrade +# +wheel==0.37.1 + # via -r requirements/pip.in + +# The following packages are considered to be unsafe in a requirements file: +pip==22.1.2 + # via -r requirements/pip.in +setuptools==59.8.0 + # via + # -c requirements/common_constraints.txt + # -r requirements/pip.in diff --git a/requirements/server.txt b/requirements/server.txt index 0c57cff..607f41d 100644 --- a/requirements/server.txt +++ b/requirements/server.txt @@ -1,30 +1,30 @@ # -# This file is autogenerated by pip-compile +# This file is autogenerated by pip-compile with python 3.8 # To update, run: # # make upgrade # -certifi==2020.12.5 +certifi==2022.6.15 # via requests -chardet==4.0.0 +charset-normalizer==2.0.12 # via requests click==7.1.2 # via flask -flask==1.1.2 +flask==1.1.4 # via -r requirements/server.in -idna==2.10 +idna==3.3 # via requests itsdangerous==1.1.0 # via flask jinja2==2.11.3 # via flask -markupsafe==1.1.1 +markupsafe==2.1.1 # via jinja2 -pyjwt==2.0.1 +pyjwt==2.4.0 # via -r requirements/server.in -requests==2.25.1 +requests==2.28.0 # via -r requirements/server.in -urllib3==1.26.3 +urllib3==1.26.9 # via requests werkzeug==1.0.1 # via flask diff --git a/requirements/testing.txt b/requirements/testing.txt index 10ee6c5..3305adb 100644 --- a/requirements/testing.txt +++ b/requirements/testing.txt @@ -1,93 +1,95 @@ # -# This file is autogenerated by pip-compile +# This file is autogenerated by pip-compile with python 3.8 # To update, run: # # make upgrade # -asgiref==3.3.1 - # via django -astroid==2.4.2 +astroid==2.11.6 # via # pylint # pylint-celery -attrs==20.3.0 +attrs==21.4.0 # via pytest -click-log==0.3.2 - # via edx-lint -click==7.1.2 +click==8.1.3 # via # click-log # code-annotations # edx-lint -code-annotations==1.1.0 +click-log==0.4.0 + # via edx-lint +code-annotations==1.3.0 # via edx-lint -coverage==5.4 +coverage[toml]==6.4.1 # via pytest-cov -django==3.1.6 - # via - # code-annotations - # edx-lint -edx-lint==3.0.2 +dill==0.3.5.1 + # via pylint +edx-lint==5.2.4 # via -r requirements/testing.in iniconfig==1.1.1 # via pytest -isort==5.7.0 +isort==5.10.1 # via pylint -jinja2==2.11.3 +jinja2==3.1.2 # via code-annotations -lazy-object-proxy==1.4.3 +lazy-object-proxy==1.7.1 # via astroid -markupsafe==1.1.1 +markupsafe==2.1.1 # via jinja2 -mccabe==0.6.1 +mccabe==0.7.0 # via pylint -packaging==20.9 +packaging==21.3 # via pytest -pbr==5.5.1 +pbr==5.9.0 # via stevedore -pluggy==0.13.1 +platformdirs==2.5.2 + # via pylint +pluggy==1.0.0 # via pytest -py==1.10.0 +py==1.11.0 # via pytest -pylint-celery==0.3 - # via edx-lint -pylint-django==2.4.2 - # via edx-lint -pylint-plugin-utils==0.6 +pylint==2.14.3 # via + # edx-lint # pylint-celery # pylint-django -pylint==2.6.0 + # pylint-plugin-utils +pylint-celery==0.3 + # via edx-lint +pylint-django==2.5.3 + # via edx-lint +pylint-plugin-utils==0.7 # via - # edx-lint # pylint-celery # pylint-django - # pylint-plugin-utils -pyparsing==2.4.7 +pyparsing==3.0.9 # via packaging -pytest-cov==2.11.1 - # via -r requirements/testing.in -pytest==6.2.2 +pytest==7.1.2 # via pytest-cov -python-slugify==4.0.1 +pytest-cov==3.0.0 + # via -r requirements/testing.in +python-slugify==6.1.2 # via code-annotations -pytz==2021.1 - # via django -pyyaml==5.4.1 +pyyaml==6.0 # via code-annotations -six==1.15.0 - # via - # astroid - # edx-lint -sqlparse==0.4.1 - # via django -stevedore==3.3.0 +six==1.16.0 + # via edx-lint +stevedore==3.5.0 # via code-annotations text-unidecode==1.3 # via python-slugify -toml==0.10.2 +tomli==2.0.1 # via + # coverage # pylint # pytest -wrapt==1.12.1 +tomlkit==0.11.0 + # via pylint +typing-extensions==4.2.0 + # via + # astroid + # pylint +wrapt==1.14.1 # via astroid + +# The following packages are considered to be unsafe in a requirements file: +# setuptools