Skip to content

Commit

Permalink
Update makefile to use dotenv
Browse files Browse the repository at this point in the history
  • Loading branch information
mrchrisadams committed May 10, 2024
1 parent cf649ad commit c5090c2
Showing 1 changed file with 14 additions and 15 deletions.
29 changes: 14 additions & 15 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Create Python virtual environment if not yet created.
venv:
test -d venv || python -m venv venv
test -d .venv || python -m venv .venv

## Installing
release:
Expand All @@ -12,25 +12,25 @@ release:
dotenv -f env.prod run -- sentry-cli releases finalize $(shell sentry-cli releases propose-version)

dev.createsuperuser:
python ./manage.py createsuperuser --username admin --email admin@admin.commits --noinput
python ./manage.py set_fake_passwords
dotenv run -- python ./manage.py createsuperuser --username admin --email admin@admin.commits --noinput
dotenv run -- python ./manage.py set_fake_passwords

dev.runserver:
python manage.py runserver
dotenv run -- python manage.py runserver

# start the tailwind watcher
dev.tailwind.start:
python manage.py tailwind start
dotenv run -- python manage.py tailwind start

# install the front end dependencies
dev.tailwind.install:
python manage.py tailwind install
dev.tailwind.install:
dotenv run -- python manage.py tailwind install

dev.test:
pytest -s --create-db --looponfail --ds=greenweb.settings.testing
dotenv run -- pytest -s --create-db --looponfail --ds=greenweb.settings.testing

dev.test.only:
pytest -s --create-db --looponfail -m only -v --ds=greenweb.settings.testing
dotenv run -- pytest -s --create-db --looponfail -m only -v --ds=greenweb.settings.testing

data_analysis_repo:
if test -d data-analysis; \
Expand All @@ -41,21 +41,20 @@ data_analysis_repo:
# start a marimo notebook session
notebook.gitpod: data_analysis_repo
# set up our start notebook with django initialised ready for queries
marimo edit data-analysis/starter-notebook.py

dotenv run -- marimo edit data-analysis/starter-notebook.py


# Run a basic test(with pytest) that creates a database using the testing settings
test:
pytest -s --create-db --ds=greenweb.settings.testing
dotenv run -- pytest -s --create-db --ds=greenweb.settings.testing

test.only:
pytest -s --create-db -m only -v --ds=greenweb.settings.testing
dotenv run -- pytest -s --create-db -m only -v --ds=greenweb.settings.testing

# Build the documentation using Sphinx
docs:
sphinx-build ./docs _build/
dotenv run -- sphinx-build ./docs _build/

# Build the documentation using Sphinx and keep updating it on every change
docs.watch:
sphinx-autobuild ./docs _build/
dotenv run -- sphinx-autobuild ./docs _build/

0 comments on commit c5090c2

Please sign in to comment.