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

E0d/makefile improvements #45

Merged
merged 42 commits into from
Jun 17, 2022
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
07ee3cc
fix: adding pylint support
Jun 16, 2022
21268c1
fix: standard requirements files
Jun 16, 2022
90668ce
fix: patterned on lti xb, work around pip bug
Jun 16, 2022
1571146
fix: support for standard make targets
Jun 16, 2022
458db6e
fix: modeled on lti xb, standard targets
Jun 16, 2022
8a23532
fix: adding new in files to upgrade
Jun 16, 2022
d8b3778
fix: adding standard translation targets
Jun 16, 2022
db6cdbf
fix: quality
Jun 16, 2022
50587c6
fix: unused import
Jun 16, 2022
9fe04ea
fix: irrelevant disable
Jun 16, 2022
91a32d4
fix: adding a specific req file for quality
Jun 16, 2022
77c814a
fix: adding a basic tox file
Jun 16, 2022
41f2577
fix: adding a manifest
Jun 16, 2022
9cfeaf8
fix: adding a NOTICE file
Jun 16, 2022
7ac6574
fix: also upgrade quality requirements
Jun 16, 2022
8b321d1
fix: removing Django 4 for now
Jun 16, 2022
f0b5304
fix: adding ci
Jun 16, 2022
5ac574f
fix: adding ci related requirements
Jun 16, 2022
a030e24
fix: processing new requirements
Jun 16, 2022
3d23646
fix: update requirements
Jun 16, 2022
80493ca
fix: simplified test entry
Jun 16, 2022
caa4823
fix: install pytest in the venv
Jun 16, 2022
c305ae9
fix: make upgrade
Jun 16, 2022
1b55693
fix: pointless test to exercise the harness
Jun 16, 2022
374674c
fix: making module
Jun 16, 2022
7bef3ae
fix: quality
Jun 16, 2022
414c10c
fix: adding CI badge
Jun 16, 2022
77bad16
fix: use a title
Jun 16, 2022
3dc6fdc
fix: iterate toward README standard
Jun 16, 2022
d61b419
fix: coverage config
Jun 16, 2022
389aea6
fix: unmix md and rst
Jun 16, 2022
f3ba5ec
fix: mixed up link
Jun 16, 2022
c0ba893
fix: changing to RST
Jun 16, 2022
f11125b
fix: more conversion fixes
Jun 16, 2022
7198c16
fix: more syntax
Jun 16, 2022
795416e
fix: more syntax
Jun 16, 2022
e8c10e3
fix: ffs
Jun 16, 2022
82b2cd6
fix: rst syntax
Jun 16, 2022
38945de
fix: so fiddly
Jun 16, 2022
8142660
fix: so fiddly
Jun 16, 2022
154d5b0
fix: more fiddles
Jun 16, 2022
9fb1ba0
fix: images
Jun 16, 2022
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
54 changes: 54 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
install-test:
pip install -q -r requirements/test.txt

install-dev:
pip install -q -r requirements/dev.txt

install: install-test

quality: ## Run the quality checks
pycodestyle --config=.pep8 done
pylint --rcfile=pylintrc done
python setup.py -q sdist
twine check dist/*

test: ## Run the tests
mkdir -p var
rm -rf .coverage
python -m coverage run --rcfile=.coveragerc ./test.py --noinput

covreport: ## Show the coverage results
python -m coverage report -m --skip-covered

COMMON_CONSTRAINTS_TXT=requirements/common_constraints.txt
.PHONY: $(COMMON_CONSTRAINTS_TXT)
$(COMMON_CONSTRAINTS_TXT):
Expand All @@ -6,5 +28,37 @@ $(COMMON_CONSTRAINTS_TXT):
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 -q -r requirements/pip_tools.txt
pip-compile --upgrade --allow-unsafe -o requirements/pip.txt requirements/pip.in
pip-compile --upgrade -o requirements/pip_tools.txt requirements/pip_tools.in
pip-compile --upgrade -o requirements/base.txt requirements/base.in
pip-compile --upgrade -o requirements/dev.txt requirements/dev.in
pip-compile --upgrade -o requirements/test.txt requirements/test.in

## Localization targets

WORKING_DIR := done
EXTRACT_DIR := $(WORKING_DIR)/translations/en/LC_MESSAGES
EXTRACTED_DJANGO := $(EXTRACT_DIR)/django-partial.po
EXTRACTED_DJANGOJS := $(EXTRACT_DIR)/djangojs-partial.po
EXTRACTED_TEXT := $(EXTRACT_DIR)/text.po

extract_translations: ## extract strings to be translated, outputting .po files
cd $(WORKING_DIR) && i18n_tool extract
mv $(EXTRACTED_DJANGO) $(EXTRACTED_TEXT)
tail -n +20 $(EXTRACTED_DJANGOJS) >> $(EXTRACTED_TEXT)
rm $(EXTRACTED_DJANGOJS)
sed -i'' -e 's/nplurals=INTEGER/nplurals=2/' $(EXTRACTED_TEXT)
sed -i'' -e 's/plural=EXPRESSION/plural=\(n != 1\)/' $(EXTRACTED_TEXT)

compile_translations: ## compile translation files, outputting .mo files for each supported language
cd $(WORKING_DIR) && i18n_tool generate

detect_changed_source_translations:
cd $(WORKING_DIR) && i18n_tool changed

dummy_translations: ## generate dummy translation (.po) files
cd $(WORKING_DIR) && i18n_tool dummy

build_dummy_translations: dummy_translations compile_translations ## generate and compile dummy translation files

validate_translations: build_dummy_translations detect_changed_source_translations ## validate translations
4 changes: 4 additions & 0 deletions done/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
"""
Runtime will load the XBlock class from here.
"""

from .done import DoneXBlock

__version__ = '2.0.4'
4 changes: 1 addition & 3 deletions done/done.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@

import uuid

import six

import pkg_resources
from xblock.core import XBlock
from xblock.fields import Boolean, DateTime, Float, Scope, String
Expand Down Expand Up @@ -80,7 +78,7 @@ def student_view(self, context=None): # pylint: disable=unused-argument
'align': self.align.lower()})
return frag

def studio_view(self, _context=None): # pylint: disable=unused-argument
def studio_view(self, _context=None):
'''
Minimal view with no configuration options giving some help text.
'''
Expand Down
Loading