From a988231d3dd18cafede2bcc759fdab6b14d40733 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Fri, 7 Dec 2018 11:52:45 -0500 Subject: [PATCH 1/2] An .editorconfig file Note: this is not the current latest thing we're working on in edx-lint, but it at least gets us tabs for Makefiles....! --- .editorconfig | 68 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000000..84c59df1a6 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,68 @@ +# *************************** +# ** DO NOT EDIT THIS FILE ** +# *************************** +# +# This file was generated by edx-lint: http://github.com/edx/edx-lint +# +# If you want to change this file, you have two choices, depending on whether +# you want to make a local change that applies only to this repo, or whether +# you want to make a central change that applies to all repos using edx-lint. +# +# LOCAL CHANGE: +# +# 1. Edit the local .editorconfig_tweaks file to add changes just to this +# repo's file. +# +# 2. Run: +# +# $ edx_lint write .editorconfig +# +# 3. This will modify the local file. Submit a pull request to get it +# checked in so that others will benefit. +# +# +# CENTRAL CHANGE: +# +# 1. Edit the .editorconfig file in the edx-lint repo at +# https://github.com/edx/edx-lint/blob/master/edx_lint/files/.editorconfig +# +# 2. Make a new version of edx_lint, which involves the usual steps of +# incrementing the version number, submitting and reviewing a pull +# request, and updating the edx-lint version reference in this repo. +# +# 3. Install the newer version of edx-lint. +# +# 4. Run: +# +# $ edx_lint write .editorconfig +# +# 5. This will modify the local file. Submit a pull request to get it +# checked in so that others will benefit. +# +# +# +# +# +# STAY AWAY FROM THIS FILE! +# +# +# +# +# +# SERIOUSLY. +# +# ------------------------------ +[*] +end_of_line = lf +insert_final_newline = true +charset = utf-8 +indent_style = space +indent_size = 4 + +[{Makefile, *.mk}] +indent_style = tab + +[{*.yml, *.yaml, *.json}] +indent_size = 2 + +# e2776282f95423f221b17c09c4888883be77b437 From f90fd165230c111d4503fe82d501b97d97d9b240 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Fri, 7 Dec 2018 11:53:27 -0500 Subject: [PATCH 2/2] Use loops for the requirements files --- Makefile | 35 +++++++++++++++++------------------ 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/Makefile b/Makefile index 6a5a1709c8..e0e020571d 100644 --- a/Makefile +++ b/Makefile @@ -40,28 +40,27 @@ detect_changed_source_translations: ## check if translation files are up-to-date requirements: ## install development environment requirements pip install -qr requirements/edx/development.txt --exists-action w +# 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/paver \ + requirements/edx-sandbox/shared \ + requirements/edx-sandbox/base \ + requirements/edx/base \ + requirements/edx/testing \ + requirements/edx/development + upgrade: export CUSTOM_COMPILE_COMMAND=make upgrade upgrade: ## update the pip requirements files to use the latest releases satisfying our constraints pip install -qr requirements/edx/pip-tools.txt - # Make sure to compile files after any other files they include! - pip-compile -v --no-emit-trusted-host --no-index --upgrade -o requirements/edx/pip-tools.txt requirements/edx/pip-tools.in - pip-compile -v --no-emit-trusted-host --no-index --upgrade -o requirements/edx/coverage.txt requirements/edx/coverage.in - pip-compile -v --no-emit-trusted-host --no-index --upgrade -o requirements/edx/paver.txt requirements/edx/paver.in - pip-compile -v --no-emit-trusted-host --no-index --upgrade -o requirements/edx-sandbox/shared.txt requirements/edx-sandbox/shared.in - pip-compile -v --no-emit-trusted-host --no-index --upgrade -o requirements/edx-sandbox/base.txt requirements/edx-sandbox/base.in - pip-compile -v --no-emit-trusted-host --no-index --upgrade -o requirements/edx/base.txt requirements/edx/base.in - pip-compile -v --no-emit-trusted-host --no-index --upgrade -o requirements/edx/testing.txt requirements/edx/testing.in - pip-compile -v --no-emit-trusted-host --no-index --upgrade -o requirements/edx/development.txt requirements/edx/development.in + @for f in $(REQ_FILES); do \ + echo ; \ + echo "== $$f ===============================" ; \ + pip-compile -v --no-emit-trusted-host --no-index --upgrade -o $$f.txt $$f.in || exit 1; \ + done # Post process all of the files generated above to work around open pip-tools issues - scripts/post-pip-compile.sh \ - requirements/edx/pip-tools.txt \ - requirements/edx/coverage.txt \ - requirements/edx/paver.txt \ - requirements/edx-sandbox/shared.txt \ - requirements/edx-sandbox/base.txt \ - requirements/edx/base.txt \ - requirements/edx/testing.txt \ - requirements/edx/development.txt + scripts/post-pip-compile.sh $(REQ_FILES:=.txt) # Let tox control the Django version for tests grep "^django==" requirements/edx/base.txt > requirements/edx/django.txt sed '/^[dD]jango==/d' requirements/edx/testing.txt > requirements/edx/testing.tmp