Skip to content

Commit

Permalink
Update assessment
Browse files Browse the repository at this point in the history
Add Makefile remove pipenv.
Remove unused User application.
Remove unused dependencies.
Update README.
Removed .envrc and direnv usage.
  • Loading branch information
feu-de-bois committed Jan 15, 2024
1 parent c42117b commit dcc9149
Show file tree
Hide file tree
Showing 76 changed files with 4,218 additions and 6,619 deletions.
2 changes: 0 additions & 2 deletions .envrc

This file was deleted.

20 changes: 0 additions & 20 deletions .readthedocs.yml

This file was deleted.

91 changes: 91 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
PIP_REPO_URL := $(shell pip3.11 config get install.find-links 2> /dev/null)

PYTHON=python3.11
ENV_DIR=.env_$(PYTHON)
PROJECT_FOLDERS=src tests
VERBOSITY ?= 1

export PYTHONPATH=.
export DJANGO_SETTINGS_MODULE=propylon_document_manager.site.settings.local

ifeq ($(OS),Windows_NT)
IN_ENV=. $(ENV_DIR)/Scripts/activate &&
else
IN_ENV=. $(ENV_DIR)/bin/activate &&
endif

# ======================
# Environment management
# ======================
$(ENV_DIR):
virtualenv -p $(PYTHON) $(ENV_DIR)
@printf "[install]\nfind-links=$(PIP_REPO_URL)\n" > $(ENV_DIR)/pip.conf

print-install-message:
@printf "Environment installed at $(ENV_DIR), run the following command to activate it: \nsource $(ENV_DIR)/bin/activate\n"

env: $(ENV_DIR) print-install-message

requirements: requirements/main.txt requirements/dev.txt build-reqs

env_update: $(ENV_DIR) requirements
$(IN_ENV) pip install -U -r requirements/dev.txt

# ======================
# Testing and Linting
# ======================
test: build plain-test

plain-test:
$(IN_ENV) py.test

# ====================
# Clean
# ====================
clean:
- @rm -rf src/*.egg-info
- @rm -rf build
- @rm -rf dist
- @rm -f .coverage
- @rm -f test_results.xml
- @rm -f coverage.xml
- @find ./src -name '*.pyc' | xargs -r rm
- @find ./ -name '__pycache__' | xargs rm -rf


env_clean: clean
- @rm -rf $(ENV_DIR)

# ====================
# Developer Utilities
# ====================
shell:
$(IN_ENV) django-admin shell

collectstatic:
$(IN_ENV) django-admin collectstatic

build-reqs: env
$(IN_ENV) pip install -r requirements/dev.txt

build: build-reqs
$(IN_ENV) pip install -e .

plain-serve:
$(IN_ENV) django-admin runserver 0.0.0.0:8001

serve: build makemigrations migrate plain-serve

# ============================
# Database & Fixture Utilities
# ============================
makemigrations:
$(IN_ENV) django-admin makemigrations

migrate:
$(IN_ENV) django-admin migrate

fixture: build makemigrations migrate plain-fixture

plain-fixture:
$(IN_ENV) django-admin load_file_fixtures
47 changes: 0 additions & 47 deletions Pipfile

This file was deleted.

Loading

0 comments on commit dcc9149

Please sign in to comment.