<commit_before># only random once obviously ;)
python=venv/bin/python
pip=venv/bin/pip
pycodestyle=venv/bin/pycodestyle
pyresttest=venv/bin/pyresttest
mypy=venv/bin/mypy
manage=$(python) $(CURDIR)/manage.py

lint:
	$(pycodestyle) $(CURDIR)/nextcloudappstore --exclude=migrations
	$(mypy) --disallow-untyped-defs $(CURDIR)/nextcloudappstore/core/api/v1/release

test: lint
	$(manage) test
	# assume that the testserver is running on port 8001

resetup:
	rm -f db.sqlite3
	rm -f $(CURDIR)/nextcloudappstore/**/migrations/0*.py
	$(manage) makemigrations
	$(manage) migrate
	@echo "from django.contrib.auth.models import User; User.objects.create_superuser('admin', '<EMAIL>', '<PASSWORD>')" | $(manage) shell
	$(manage) loaddata $(CURDIR)/nextcloudappstore/**/fixtures/*.json

# Only for local setup, do not use in production
dev-setup:
	pyvenv venv
	@echo "DEBUG = True" > $(CURDIR)/nextcloudappstore/local_settings.py
	@echo "SECRET_KEY = 'secret'" >> $(CURDIR)/nextcloudappstore/local_settings.py
	@echo "RECAPTCHA_PUBLIC_KEY = 'PUBLIC_KEY'" >> $(CURDIR)/nextcloudappstore/local_settings.py
	@echo "RECAPTCHA_PRIVATE_KEY = 'PRIVATE_KEY'" >> $(CURDIR)/nextcloudappstore/local_settings.py
	@echo "EMAIL_HOST = 'localhost'" >> $(CURDIR)/nextcloudappstore/local_settings.py
	@echo "DEFAULT_FROM_EMAIL = 'dev@localhost'" >> $(CURDIR)/nextcloudappstore/local_settings.py

	$(pip) install -r $(CURDIR)/requirements/development.txt
	$(pip) install -r $(CURDIR)/requirements/base.txt
	$(manage) migrate<commit_msg>also validate admin user when running resetup target<commit_after># only random once obviously ;)
python=venv/bin/python
pip=venv/bin/pip
pycodestyle=venv/bin/pycodestyle
pyresttest=venv/bin/pyresttest
mypy=venv/bin/mypy
manage=$(python) $(CURDIR)/manage.py

lint:
	$(pycodestyle) $(CURDIR)/nextcloudappstore --exclude=migrations
	$(mypy) --disallow-untyped-defs $(CURDIR)/nextcloudappstore/core/api/v1/release

test: lint
	$(manage) test
	# assume that the testserver is running on port 8001

resetup:
	rm -f db.sqlite3
	rm -f $(CURDIR)/nextcloudappstore/**/migrations/0*.py
	$(manage) makemigrations
	$(manage) migrate
	@echo "from django.contrib.auth.models import User; User.objects.create_superuser('admin', '<EMAIL>', '<PASSWORD>')" | $(manage) shell
	@echo "from django.contrib.auth.models import User; from allauth.account.models import EmailAddress; EmailAddress.objects.create(user=User.objects.get(username='admin'), email='<EMAIL>', verified=True, primary=True)" | $(manage) shell
	$(manage) loaddata $(CURDIR)/nextcloudappstore/**/fixtures/*.json

# Only for local setup, do not use in production
dev-setup:
	pyvenv venv
	@echo "DEBUG = True" > $(CURDIR)/nextcloudappstore/local_settings.py
	@echo "SECRET_KEY = 'secret'" >> $(CURDIR)/nextcloudappstore/local_settings.py
	@echo "RECAPTCHA_PUBLIC_KEY = 'PUBLIC_KEY'" >> $(CURDIR)/nextcloudappstore/local_settings.py
	@echo "RECAPTCHA_PRIVATE_KEY = 'PRIVATE_KEY'" >> $(CURDIR)/nextcloudappstore/local_settings.py
	@echo "EMAIL_HOST = 'localhost'" >> $(CURDIR)/nextcloudappstore/local_settings.py
	@echo "DEFAULT_FROM_EMAIL = 'dev@localhost'" >> $(CURDIR)/nextcloudappstore/local_settings.py

	$(pip) install -r $(CURDIR)/requirements/development.txt
	$(pip) install -r $(CURDIR)/requirements/base.txt
	$(manage) migrate
{'fraction_non_alphanumeric': 0.15220700152207, 'fraction_numerical': 0.00426179604261796, 'mean_word_length': 6.206140350877193, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 30, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2505963', 'n_tokens_mistral': 1197, 'n_tokens_neox': 1142, 'n_words': 225}