Skip to content

Commit

Permalink
fix: Install pip and pip-tools in upgrade script
Browse files Browse the repository at this point in the history
  • Loading branch information
Jawayria committed Jun 23, 2022
1 parent 2efb432 commit a6939da
Show file tree
Hide file tree
Showing 13 changed files with 81 additions and 58 deletions.
16 changes: 13 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,19 @@ clean: ## remove generated byte code, coverage reports, and build artifacts
rm -fr dist/
rm -fr *.egg-info

upgrade: ## update the requirements/*.txt files with the latest packages satisfying requirements/*.in
pip install -q pip-tools
pip-compile --allow-unsafe --rebuild -o requirements/pip.txt requirements/pip.in
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: $(COMMON_CONSTRAINTS_TXT)
## update the requirements/*.txt files with the latest packages satisfying requirements/*.in
pip install -qr requirements/pip-tools.txt
pip-compile --allow-unsafe --upgrade --rebuild -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/dev.txt requirements/dev.in requirements/quality.in
pip-compile --upgrade -o requirements/doc.txt requirements/base.in requirements/doc.in
Expand Down
2 changes: 1 addition & 1 deletion requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
# This file is autogenerated by pip-compile with python 3.8
# To update, run:
#
# pip-compile --output-file=requirements/base.txt requirements/base.in
# make upgrade
#
2 changes: 1 addition & 1 deletion requirements/ci.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# This file is autogenerated by pip-compile with python 3.8
# To update, run:
#
# pip-compile --output-file=requirements/ci.txt requirements/ci.in
# make upgrade
#
certifi==2022.6.15
# via requests
Expand Down
25 changes: 25 additions & 0 deletions requirements/common_constraints.txt
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion requirements/constraints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
# linking to it here is good.

# This file contains all common constraints for edx-repos
-c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt
-c common_constraints.txt
1 change: 0 additions & 1 deletion requirements/dev.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

diff-cover # Changeset diff test coverage
edx-i18n-tools # For i18n_tool dummy
pip-tools # Requirements file management
pluggy
tox
tox-battery
Expand Down
34 changes: 6 additions & 28 deletions requirements/dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# This file is autogenerated by pip-compile with python 3.8
# To update, run:
#
# pip-compile --output-file=requirements/dev.txt requirements/dev.in requirements/quality.in
# make upgrade
#
asgiref==3.5.2
# via django
Expand All @@ -14,8 +14,6 @@ bleach==5.0.0
# via readme-renderer
certifi==2022.6.15
# via requests
cffi==1.15.0
# via cryptography
chardet==4.0.0
# via diff-cover
charset-normalizer==2.0.12
Expand All @@ -25,24 +23,21 @@ click==8.1.3
# click-log
# code-annotations
# edx-lint
# pip-tools
click-log==0.4.0
# via edx-lint
code-annotations==1.3.0
# via edx-lint
commonmark==0.9.1
# via rich
cryptography==37.0.2
# via secretstorage
diff-cover==6.5.0
diff-cover==6.5.1
# via -r requirements/dev.in
dill==0.3.5.1
# via pylint
distlib==0.3.4
# via virtualenv
django==3.2.13
# via
# -c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt
# -c requirements/common_constraints.txt
# -r requirements/quality.in
# edx-i18n-tools
docutils==0.18.1
Expand All @@ -65,10 +60,6 @@ isort==5.10.1
# via
# -r requirements/quality.in
# pylint
jeepney==0.8.0
# via
# keyring
# secretstorage
jinja2==3.1.2
# via
# code-annotations
Expand All @@ -87,10 +78,6 @@ path==16.4.0
# via edx-i18n-tools
pbr==5.9.0
# via stevedore
pep517==0.12.0
# via pip-tools
pip-tools==6.6.2
# via -r requirements/dev.in
pkginfo==1.8.3
# via twine
platformdirs==2.5.2
Expand All @@ -108,16 +95,14 @@ py==1.11.0
# via tox
pycodestyle==2.8.0
# via -r requirements/quality.in
pycparser==2.21
# via cffi
pydocstyle==6.1.1
# via -r requirements/quality.in
pygments==2.12.0
# via
# diff-cover
# readme-renderer
# rich
pylint==2.14.2
pylint==2.14.3
# via
# edx-lint
# pylint-celery
Expand Down Expand Up @@ -153,8 +138,6 @@ rfc3986==2.0.0
# via twine
rich==12.4.4
# via twine
secretstorage==3.3.2
# via keyring
six==1.16.0
# via
# bleach
Expand All @@ -172,9 +155,7 @@ text-unidecode==1.3
toml==0.10.2
# via tox
tomli==2.0.1
# via
# pep517
# pylint
# via pylint
tomlkit==0.11.0
# via pylint
tox==3.25.0
Expand All @@ -201,14 +182,11 @@ virtualenv==20.14.1
webencodings==0.5.1
# via bleach
wheel==0.37.1
# via
# -r requirements/dev.in
# pip-tools
# via -r requirements/dev.in
wrapt==1.14.1
# via astroid
zipp==3.8.0
# via importlib-metadata

# The following packages are considered to be unsafe in a requirements file:
# pip
# setuptools
16 changes: 2 additions & 14 deletions requirements/doc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# This file is autogenerated by pip-compile with python 3.8
# To update, run:
#
# pip-compile --output-file=requirements/doc.txt requirements/base.in requirements/doc.in
# make upgrade
#
alabaster==0.7.12
# via sphinx
Expand All @@ -14,17 +14,13 @@ bleach==5.0.0
# via readme-renderer
certifi==2022.6.15
# via requests
cffi==1.15.0
# via cryptography
charset-normalizer==2.0.12
# via requests
commonmark==0.9.1
# via rich
cryptography==37.0.2
# via secretstorage
django==3.2.13
# via
# -c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt
# -c requirements/common_constraints.txt
# -r requirements/doc.in
doc8==0.11.2
# via -r requirements/doc.in
Expand All @@ -45,10 +41,6 @@ importlib-metadata==4.11.4
# keyring
# sphinx
# twine
jeepney==0.8.0
# via
# keyring
# secretstorage
jinja2==3.1.2
# via sphinx
keyring==23.6.0
Expand All @@ -63,8 +55,6 @@ pkginfo==1.8.3
# via twine
pockets==0.9.1
# via sphinxcontrib-napoleon
pycparser==2.21
# via cffi
pygments==2.12.0
# via
# doc8
Expand Down Expand Up @@ -94,8 +84,6 @@ rfc3986==2.0.0
# via twine
rich==12.4.4
# via twine
secretstorage==3.3.2
# via keyring
six==1.16.0
# via
# bleach
Expand Down
3 changes: 3 additions & 0 deletions requirements/pip-tools.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
-c constraints.txt

pip-tools
20 changes: 20 additions & 0 deletions requirements/pip-tools.txt
Original file line number Diff line number Diff line change
@@ -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
10 changes: 5 additions & 5 deletions requirements/pip.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
# This file is autogenerated by pip-compile with python 3.8
# To update, run:
#
# pip-compile --allow-unsafe --output-file=requirements/pip.txt requirements/pip.in
# make upgrade
#
wheel==0.35.1
wheel==0.37.1
# via -r requirements/pip.in

# The following packages are considered to be unsafe in a requirements file:
pip==20.3
pip==22.1.2
# via -r requirements/pip.in
setuptools==50.3.2
setuptools==59.8.0
# via
# -c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt
# -c requirements/common_constraints.txt
# -r requirements/pip.in
6 changes: 3 additions & 3 deletions requirements/quality.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# This file is autogenerated by pip-compile with python 3.8
# To update, run:
#
# pip-compile --output-file=requirements/quality.txt requirements/quality.in
# make upgrade
#
asgiref==3.5.2
# via django
Expand All @@ -23,7 +23,7 @@ dill==0.3.5.1
# via pylint
django==3.2.13
# via
# -c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt
# -c requirements/common_constraints.txt
# -r requirements/quality.in
edx-lint==5.2.4
# via -r requirements/quality.in
Expand All @@ -47,7 +47,7 @@ pycodestyle==2.8.0
# via -r requirements/quality.in
pydocstyle==6.1.1
# via -r requirements/quality.in
pylint==2.14.2
pylint==2.14.3
# via
# edx-lint
# pylint-celery
Expand Down
2 changes: 1 addition & 1 deletion requirements/test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# This file is autogenerated by pip-compile with python 3.8
# To update, run:
#
# pip-compile --output-file=requirements/test.txt requirements/base.in requirements/test.in
# make upgrade
#
attrs==21.4.0
# via pytest
Expand Down

0 comments on commit a6939da

Please sign in to comment.