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

fix: Install pip and pip-tools in upgrade script #36

Merged
merged 1 commit into from
Jun 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
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
14 changes: 12 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion requirements/base.txt
Original file line number Diff line number Diff line change
@@ -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
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
12 changes: 12 additions & 0 deletions requirements/constraints.txt
Original file line number Diff line number Diff line change
@@ -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
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
6 changes: 6 additions & 0 deletions requirements/pip.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
-c constraints.txt
#Core dependencies for installing other packages

pip
setuptools
wheel
16 changes: 16 additions & 0 deletions requirements/pip.txt
Original file line number Diff line number Diff line change
@@ -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
18 changes: 9 additions & 9 deletions requirements/server.txt
Original file line number Diff line number Diff line change
@@ -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
100 changes: 51 additions & 49 deletions requirements/testing.txt
Original file line number Diff line number Diff line change
@@ -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