From b7730885a124360aab44292b3ddabf7b54ce0bfb Mon Sep 17 00:00:00 2001 From: Alec Clowes Date: Tue, 16 Aug 2022 18:50:31 -0700 Subject: [PATCH] switch fields (#98) * switch fields * switch fields * switch fields * upgrade django * upgrade django * upgrade django * upgrade django * upgrade django * upgrade django * upgrade django --- .circleci/config.yml | 12 ++-- setup.py | 4 +- ...id_alter_queue_id_alter_run_id_and_more.py | 63 +++++++++++++++++++ yawn/settings/base.py | 4 +- yawn/workflow/models.py | 5 +- 5 files changed, 75 insertions(+), 13 deletions(-) create mode 100644 yawn/migrations/0003_alter_execution_id_alter_queue_id_alter_run_id_and_more.py diff --git a/.circleci/config.yml b/.circleci/config.yml index 0b069be..d60d03a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -2,8 +2,8 @@ version: 2 jobs: build: docker: - - image: circleci/python:3.5-jessie-node-browsers - - image: circleci/postgres:9.6 + - image: cimg/python:3.8-browsers + - image: cimg/postgres:11.13 environment: POSTGRES_USER: circleci POSTGRES_HOST_AUTH_METHOD: trust @@ -11,13 +11,13 @@ jobs: - checkout - restore_cache: keys: - - v2-{{ checksum "frontend/yarn.lock" }}-{{ checksum "setup.py" }} - - v2-{{ checksum "frontend/yarn.lock" }} - - v2 + - v3-{{ checksum "frontend/yarn.lock" }}-{{ checksum "setup.py" }} + - v3-{{ checksum "frontend/yarn.lock" }} + - v3 - run: python -m venv pyenv && source pyenv/bin/activate && pip install -e .[test] - run: cd frontend && yarn install - save_cache: - key: v2-{{ checksum "frontend/yarn.lock" }}-{{ checksum "setup.py" }} + key: v3-{{ checksum "frontend/yarn.lock" }}-{{ checksum "setup.py" }} paths: - frontend/node_modules - pyenv diff --git a/setup.py b/setup.py index 76fe706..566513a 100755 --- a/setup.py +++ b/setup.py @@ -75,8 +75,8 @@ # https://packaging.python.org/en/latest/requirements.html install_requires=[ 'psycopg2-binary>=2.7', - 'django>=2.2', - 'djangorestframework>=3.4', + 'Django>=3.1', + 'djangorestframework>=3.10', 'whitenoise>=3.0', 'gunicorn>=19', 'pyyaml>=5.1', diff --git a/yawn/migrations/0003_alter_execution_id_alter_queue_id_alter_run_id_and_more.py b/yawn/migrations/0003_alter_execution_id_alter_queue_id_alter_run_id_and_more.py new file mode 100644 index 0000000..0e31520 --- /dev/null +++ b/yawn/migrations/0003_alter_execution_id_alter_queue_id_alter_run_id_and_more.py @@ -0,0 +1,63 @@ +# Generated by Django 4.1 on 2022-08-17 01:14 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('yawn', '0002_tasks_without_workflows'), + ] + + operations = [ + migrations.AlterField( + model_name='execution', + name='id', + field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'), + ), + migrations.AlterField( + model_name='queue', + name='id', + field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'), + ), + migrations.AlterField( + model_name='run', + name='id', + field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'), + ), + migrations.AlterField( + model_name='run', + name='parameters', + field=models.JSONField(default=dict), + ), + migrations.AlterField( + model_name='task', + name='id', + field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'), + ), + migrations.AlterField( + model_name='template', + name='id', + field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'), + ), + migrations.AlterField( + model_name='worker', + name='id', + field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'), + ), + migrations.AlterField( + model_name='workflow', + name='id', + field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'), + ), + migrations.AlterField( + model_name='workflow', + name='parameters', + field=models.JSONField(default=dict), + ), + migrations.AlterField( + model_name='workflowname', + name='id', + field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'), + ), + ] diff --git a/yawn/settings/base.py b/yawn/settings/base.py index 835f1b1..f870630 100644 --- a/yawn/settings/base.py +++ b/yawn/settings/base.py @@ -23,6 +23,8 @@ } } +DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' + INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', @@ -108,8 +110,6 @@ USE_I18N = True -USE_L10N = True - USE_TZ = True # Static files (CSS, JavaScript, Images) diff --git a/yawn/workflow/models.py b/yawn/workflow/models.py index 0edab27..0011eb9 100644 --- a/yawn/workflow/models.py +++ b/yawn/workflow/models.py @@ -1,5 +1,4 @@ from django.db import models -from django.contrib.postgres import fields from django.db.models import functions from yawn.utilities import cron, database @@ -40,7 +39,7 @@ class Meta: next_run = models.DateTimeField(null=True) # parameters - parameters = fields.JSONField(default=dict) + parameters = models.JSONField(default=dict) def save(self, **kwargs): if self.schedule_active: @@ -100,7 +99,7 @@ class Run(models.Model): submitted_time = models.DateTimeField() scheduled_time = models.DateTimeField(null=True) status = models.TextField(default=RUNNING, choices=STATUS_CHOICES) - parameters = fields.JSONField(default=dict) + parameters = models.JSONField(default=dict) def update_status(self): from yawn.task.models import Task