Skip to content

Commit

Permalink
chore: enable all management commands
Browse files Browse the repository at this point in the history
  • Loading branch information
hodossy committed Jan 21, 2021
1 parent 90e29ed commit aa4fa85
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ jobs:
pip install -r test_requirements.txt
- name: Measuring unit test coverage of the code
run: |
coverage run runtests.py
coverage report --show-missing --include "**/django_nlf/**"
coverage run manage.py test
coverage report
2 changes: 1 addition & 1 deletion .github/workflows/unittest-matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ jobs:
pip install "django${{ matrix.django-version }}"
- name: Running unit test
run: |
python runtests.py
python manage.py test
2 changes: 1 addition & 1 deletion .github/workflows/weekly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ jobs:
pip install -r test_requirements.txt
- name: Running unit test
run: |
python runtests.py
python manage.py test
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# Git
*.orig
*.diff
*.patch

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
Expand Down
13 changes: 9 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@ lint:

.PHONY: format
format:
@python -m black django_nlf tests runtests.py setup.py
@python -m black django_nlf tests manage.py setup.py


.PHONY: test
test:
@python runtests.py $(tc)
@python manage.py test $(tc)


.PHONY: coverage
coverage:
@python -m coverage run runtests.py
@python -m coverage report --show-missing --include "**/django_nlf/**"
@python -m coverage run manage.py test
@python -m coverage report


.PHONY: docs
Expand All @@ -33,3 +33,8 @@ publish:
.PHONY: lang
lang:
@$(MAKE) -C ./django_nlf/antlr


# All commands that can be proxied to manage.py
.DEFAULT:
@python manage.py $@ $(PARAMS)
24 changes: 24 additions & 0 deletions manage.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys


def main():
"""Main Django management entrypoint"""
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "tests.settings")
try:
from django.core.management import (
execute_from_command_line,
) # pylint: disable=import-outside-toplevel
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and "
"available on your PYTHONPATH environment variable? Did you "
"forget to activate a virtual environment?"
) from exc
execute_from_command_line(sys.argv)


if __name__ == "__main__":
main()
4 changes: 4 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ line-length = 100
branch = true

[tool.coverage.report]
show_missing = true
include = [
"**/django_nlf/**",
]
# Regexes for lines to exclude from consideration
exclude_lines = [
# Have to re-enable the standard pragma
Expand Down

0 comments on commit aa4fa85

Please sign in to comment.