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: add common constraint and run make upgrade #26

Merged
merged 2 commits into from
Jun 12, 2021
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
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,13 @@ clean: ## delete generated byte code and coverage reports
rm -rf assets
rm -rf pii_report

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 "$(@)"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, @stvstnfrd I had a question regarding this,
what was the problem that we faced with the previous implementation of using the common_constraints file directly?
or what problem does this (downloading the constraint file to local) solve?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @mraarif

dependabot (the Github security upgrade PR creator, used across our repos) expects all requirements to be saved locally on disk and fails to fetch requirements files if they're remote.

So using -c https://... breaks the integration and dependabot stops working.

a little more text originally shared here:

upgrade: export CUSTOM_COMPILE_COMMAND=make upgrade
upgrade: ## update the requirements/*.txt files with the latest packages satisfying requirements/*.in
upgrade: $(COMMON_CONSTRAINTS_TXT) ## update the requirements/*.txt files with the latest packages satisfying requirements/*.in
pip install -r requirements/pip.txt
pip install -q -r requirements/pip_tools.txt
pip-compile --allow-unsafe --rebuild -o requirements/pip.txt requirements/pip.in
Expand Down
2 changes: 1 addition & 1 deletion requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ web-fragments==1.0.0
# xblock
webob==1.8.7
# via xblock
xblock==1.4.1
xblock==1.4.2
# via -r requirements/base.in

# The following packages are considered to be unsafe in a requirements file:
Expand Down
26 changes: 26 additions & 0 deletions requirements/common_constraints.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# 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<2.3

# docutils version 0.17 is causing docs rendering to fail
# See https://sourceforge.net/p/docutils/bugs/417/
docutils==0.16

# latest version is causing e2e failures in edx-platform.
drf-jwt<1.19.1

# Newer versions causing tests failures in multiple repos.
pyjwt[crypto]==1.7.1
3 changes: 3 additions & 0 deletions requirements/constraints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@
# 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
6 changes: 3 additions & 3 deletions requirements/test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#
attrs==21.2.0
# via pytest
coverage[toml]==5.5
coverage==5.5
# via pytest-cov
iniconfig==1.1.1
# via pytest
Expand All @@ -18,11 +18,11 @@ py==1.10.0
# via pytest
pyparsing==2.4.7
# via packaging
pytest-cov==2.12.0
pytest-cov==2.12.1
# via -r requirements/test.in
pytest==6.2.4
# via pytest-cov
toml==0.10.2
# via
# coverage
# pytest
# pytest-cov