From 4f2b1b2861e5825280d1374530167da4105f3655 Mon Sep 17 00:00:00 2001 From: erikvw Date: Tue, 16 May 2023 19:27:48 -0500 Subject: [PATCH] precommit, setup --- .github/workflows/build.yml | 6 ++++-- .pre-commit-config.yaml | 7 +------ VERSION | 1 - edc_consent/field_mixins/citizen_fields_mixin.py | 1 - edc_consent/field_mixins/personal_fields_mixin.py | 2 -- edc_consent/field_mixins/review_fields_mixin.py | 1 - edc_consent/field_mixins/sample_collection_fields_mixin.py | 1 - edc_consent/field_mixins/scored_review_fields_mixin.py | 1 - edc_consent/field_mixins/site_fields_mixin.py | 1 - edc_consent/field_mixins/vulnerability_fields_mixin.py | 1 - edc_consent/migrations/0001_initial.py | 1 - edc_consent/model_wrappers/consent_model_wrapper_mixin.py | 1 - edc_consent/models/edc_permissions.py | 1 - edc_consent/requires_consent.py | 1 - edc_consent/tests/models.py | 4 ---- edc_consent/tests/tests/test_consent_form.py | 1 - edc_consent/views/home_view.py | 1 - pyproject.toml | 7 +++++-- 18 files changed, 10 insertions(+), 29 deletions(-) delete mode 100644 VERSION diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 05e5069..54d8c3f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,8 +12,10 @@ jobs: fail-fast: false matrix: python-version: ['3.10', '3.11'] - django-version: ['4.1', 'dev'] - + django-version: ['4.1', '4.2', 'dev'] + exclude: + - python-version: '3.10' + django-version: 'dev' services: mysql: image: mysql:latest diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 10b3676..718de57 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -41,13 +41,8 @@ repos: - id: debug-statements - id: detect-private-key - - repo: https://github.com/rstcheck/rstcheck - rev: v6.1.2 - hooks: - - id: rstcheck - - repo: https://github.com/adrienverge/yamllint - rev: v1.30.0 + rev: v1.31.0 hooks: - id: yamllint args: diff --git a/VERSION b/VERSION deleted file mode 100644 index f9a4b5f..0000000 --- a/VERSION +++ /dev/null @@ -1 +0,0 @@ -0.3.20 diff --git a/edc_consent/field_mixins/citizen_fields_mixin.py b/edc_consent/field_mixins/citizen_fields_mixin.py index cde567a..d30cb3d 100644 --- a/edc_consent/field_mixins/citizen_fields_mixin.py +++ b/edc_consent/field_mixins/citizen_fields_mixin.py @@ -4,7 +4,6 @@ class CitizenFieldsMixin(models.Model): - citizen = models.CharField( verbose_name="Is the participant a Botswana citizen? ", max_length=3, diff --git a/edc_consent/field_mixins/personal_fields_mixin.py b/edc_consent/field_mixins/personal_fields_mixin.py index 439b045..ac5af7a 100644 --- a/edc_consent/field_mixins/personal_fields_mixin.py +++ b/edc_consent/field_mixins/personal_fields_mixin.py @@ -15,7 +15,6 @@ class BaseFieldsMixin(models.Model): - initials = EncryptedCharField( validators=[ RegexValidator( @@ -67,7 +66,6 @@ class Meta: class PersonalFieldsMixin(CryptoMixin, BaseFieldsMixin, models.Model): - first_name = FirstnameField( null=True, blank=False, diff --git a/edc_consent/field_mixins/review_fields_mixin.py b/edc_consent/field_mixins/review_fields_mixin.py index b543cf4..5317424 100644 --- a/edc_consent/field_mixins/review_fields_mixin.py +++ b/edc_consent/field_mixins/review_fields_mixin.py @@ -5,7 +5,6 @@ class ReviewFieldsMixin(models.Model): - consent_reviewed = models.CharField( verbose_name="I have reviewed the consent with the participant", max_length=3, diff --git a/edc_consent/field_mixins/sample_collection_fields_mixin.py b/edc_consent/field_mixins/sample_collection_fields_mixin.py index 9c663e7..84df5a5 100644 --- a/edc_consent/field_mixins/sample_collection_fields_mixin.py +++ b/edc_consent/field_mixins/sample_collection_fields_mixin.py @@ -3,7 +3,6 @@ class SampleCollectionFieldsMixin(models.Model): - may_store_genetic_samples = models.CharField( verbose_name=( "Does the participant agree that a portion of " diff --git a/edc_consent/field_mixins/scored_review_fields_mixin.py b/edc_consent/field_mixins/scored_review_fields_mixin.py index cb65d5a..e96a79d 100644 --- a/edc_consent/field_mixins/scored_review_fields_mixin.py +++ b/edc_consent/field_mixins/scored_review_fields_mixin.py @@ -5,7 +5,6 @@ class ScoredReviewFieldsMixin(models.Model): - consent_reviewed = models.CharField( verbose_name="I have reviewed the consent with the client", max_length=3, diff --git a/edc_consent/field_mixins/site_fields_mixin.py b/edc_consent/field_mixins/site_fields_mixin.py index 31db2b7..77c4c29 100644 --- a/edc_consent/field_mixins/site_fields_mixin.py +++ b/edc_consent/field_mixins/site_fields_mixin.py @@ -2,7 +2,6 @@ class SiteFieldsMixin(models.Model): - site_code = models.CharField( verbose_name="Site", max_length=25, diff --git a/edc_consent/field_mixins/vulnerability_fields_mixin.py b/edc_consent/field_mixins/vulnerability_fields_mixin.py index f481129..bbbb4ae 100644 --- a/edc_consent/field_mixins/vulnerability_fields_mixin.py +++ b/edc_consent/field_mixins/vulnerability_fields_mixin.py @@ -9,7 +9,6 @@ class VulnerabilityFieldsMixin(CryptoMixin, models.Model): - is_incarcerated = models.CharField( verbose_name="Is the participant under involuntary incarceration?", max_length=3, diff --git a/edc_consent/migrations/0001_initial.py b/edc_consent/migrations/0001_initial.py index b8749b9..34d4050 100644 --- a/edc_consent/migrations/0001_initial.py +++ b/edc_consent/migrations/0001_initial.py @@ -10,7 +10,6 @@ class Migration(migrations.Migration): - initial = True dependencies = [] diff --git a/edc_consent/model_wrappers/consent_model_wrapper_mixin.py b/edc_consent/model_wrappers/consent_model_wrapper_mixin.py index 665005a..84c9094 100644 --- a/edc_consent/model_wrappers/consent_model_wrapper_mixin.py +++ b/edc_consent/model_wrappers/consent_model_wrapper_mixin.py @@ -8,7 +8,6 @@ class ConsentModelWrapperMixin(ModelWrapper): - consent_model_wrapper_cls = None @property diff --git a/edc_consent/models/edc_permissions.py b/edc_consent/models/edc_permissions.py index 79c817d..8144613 100644 --- a/edc_consent/models/edc_permissions.py +++ b/edc_consent/models/edc_permissions.py @@ -3,7 +3,6 @@ class EdcPermissions(EdcPermissionsModelMixin, BaseUuidModel): - # see edc_auth for permissions attached to this model class Meta(EdcPermissionsModelMixin.Meta): diff --git a/edc_consent/requires_consent.py b/edc_consent/requires_consent.py index 9da2ab5..9007295 100644 --- a/edc_consent/requires_consent.py +++ b/edc_consent/requires_consent.py @@ -18,7 +18,6 @@ def __init__( consent_model: Optional[str] = None, consent_group: Optional[str] = None, ): - self.version = None self.model = model self.subject_identifier = subject_identifier diff --git a/edc_consent/tests/models.py b/edc_consent/tests/models.py index 4c9852d..167830d 100644 --- a/edc_consent/tests/models.py +++ b/edc_consent/tests/models.py @@ -19,7 +19,6 @@ class SubjectScreening(models.Model): - screening_identifier = models.CharField(max_length=25, unique=True) initials = models.CharField(max_length=5, default="TO") @@ -105,7 +104,6 @@ class Meta(ConsentModelMixin.Meta): class SubjectVisit(SiteModelMixin, BaseUuidModel): - subject_identifier = models.CharField(max_length=25) # appointment = models.OneToOneField(Appointment, on_delete=CASCADE) @@ -116,12 +114,10 @@ class SubjectVisit(SiteModelMixin, BaseUuidModel): class TestModel( NonUniqueSubjectIdentifierModelMixin, RequiresConsentFieldsModelMixin, BaseUuidModel ): - report_datetime = models.DateTimeField(default=get_utcnow) class CrfOne(NonUniqueSubjectIdentifierModelMixin, BaseUuidModel): - subject_visit = models.ForeignKey(SubjectVisit, on_delete=PROTECT) report_datetime = models.DateTimeField(default=get_utcnow) diff --git a/edc_consent/tests/tests/test_consent_form.py b/edc_consent/tests/tests/test_consent_form.py index e679b46..dd14f8c 100644 --- a/edc_consent/tests/tests/test_consent_form.py +++ b/edc_consent/tests/tests/test_consent_form.py @@ -31,7 +31,6 @@ class SubjectConsentFormValidator( class SubjectConsentForm(ConsentModelFormMixin, FormValidatorMixin, forms.ModelForm): - form_validator_cls = SubjectConsentFormValidator screening_identifier = forms.CharField( diff --git a/edc_consent/views/home_view.py b/edc_consent/views/home_view.py index 738865f..6da2402 100644 --- a/edc_consent/views/home_view.py +++ b/edc_consent/views/home_view.py @@ -8,7 +8,6 @@ class HomeView(EdcViewMixin, NavbarViewMixin, TemplateView): - template_name = f"edc_consent/bootstrap{get_bootstrap_version()}/home.html" navbar_name = "edc_consent" navbar_selected_item = "consent" diff --git a/pyproject.toml b/pyproject.toml index 8596807..38b88e7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -36,7 +36,8 @@ exclude_lines = [ legacy_tox_ini = """ [tox] envlist = - py{310,311}-dj{41,dev}, + py{310}-dj{41,42}, + py{311}-dj{41,42,dev}, lint isolated_build = true @@ -48,7 +49,8 @@ python = [gh-actions:env] DJANGO = - 4.1: dj41, lint + 4.1: dj41 + 4.2: dj42, lint dev: djdev [testenv] @@ -58,6 +60,7 @@ deps = -r https://raw.githubusercontent.com/clinicedc/edc/develop/requirements.tests/edc.txt -r https://raw.githubusercontent.com/clinicedc/edc/develop/requirements.tests/third_party_dev.txt dj41: Django>=4.1,<4.2 + dj42: Django>=4.2,<5.0 djdev: https://github.com/django/django/tarball/main commands =