From 4b9513c426cd3426573b7af83aba9ea327272750 Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Tue, 25 Oct 2022 20:27:46 -0600 Subject: [PATCH 1/5] chore: import CloneModel from models module --- model_clone/__init__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/model_clone/__init__.py b/model_clone/__init__.py index e77d48b6..02c773da 100644 --- a/model_clone/__init__.py +++ b/model_clone/__init__.py @@ -6,10 +6,12 @@ from model_clone.admin import CloneModelAdmin, CloneModelAdminMixin from model_clone.mixin import CloneMixin +from model_clone.models import CloneModel from model_clone.utils import create_copy_of_instance __all__ = [ "CloneMixin", + "CloneModel", "CloneModelAdmin", "CloneModelAdminMixin", "create_copy_of_instance", From 23b6283bb80eabaca8364e03b74b7ff81cc1b33e Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Fri, 28 Oct 2022 09:30:06 -0600 Subject: [PATCH 2/5] Delete lint.yml --- .github/workflows/lint.yml | 41 -------------------------------------- 1 file changed, 41 deletions(-) delete mode 100644 .github/workflows/lint.yml diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml deleted file mode 100644 index ee5ec191..00000000 --- a/.github/workflows/lint.yml +++ /dev/null @@ -1,41 +0,0 @@ -name: Run linters -on: - pull_request: - branches: - - main - -jobs: - lint: - runs-on: ubuntu-latest - if: github.actor != 'dependabot[bot]' && github.actor != 'dependabot' && github.event.pull_request.head.repo.owner.login == github.repository_owner - strategy: - matrix: - python-version: [3.6, 3.7, 3.8, 3.9] - - steps: - - uses: actions/checkout@v3.1.0 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - - uses: actions/cache@v3.0.11 - id: pip-cache - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('requirements.txt') }} - restore-keys: | - ${{ runner.os }}-pip-${{ matrix.python-version }}- - - name: Install dependencies - run: | - pip install -U pip - pip install flake8==3.8.4 - - name: Install black - run: pip install black - - name: Run Lint - uses: wearerequired/lint-action@v2.1.0 - with: - github_token: ${{ secrets.github_token }} - black: true - flake8: true - git_email: "github-action[bot]@github.com" - auto_fix: true From 89a7034fa90db947688095b33d594f7ff13f41e4 Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Fri, 28 Oct 2022 09:30:38 -0600 Subject: [PATCH 3/5] Update .pre-commit-config.yaml --- .pre-commit-config.yaml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e5d85c5e..deff4ce7 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/PyCQA/autoflake - rev: v1.6.1 + rev: v1.7.7 hooks: - id: autoflake args: ['--in-place', '--remove-all-unused-imports', '--remove-unused-variable'] @@ -20,7 +20,18 @@ repos: exclude: ^docs/.*|.*.md - repo: https://github.com/psf/black - rev: 22.8.0 + rev: 22.10.0 hooks: - id: black language_version: python3 + + - repo: https://github.com/adrienverge/yamllint.git + rev: v1.17.0 + hooks: + - id: yamllint + args: ["-d", "relaxed"] + + - repo: https://github.com/pycqa/flake8 + rev: 5.0.4 + hooks: + - id: flake8 From fba826e9ec89f5e5becda3bc5630bce949649d2c Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Fri, 28 Oct 2022 09:41:41 -0600 Subject: [PATCH 4/5] Update __init__.py --- model_clone/__init__.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/model_clone/__init__.py b/model_clone/__init__.py index 02c773da..e77d48b6 100644 --- a/model_clone/__init__.py +++ b/model_clone/__init__.py @@ -6,12 +6,10 @@ from model_clone.admin import CloneModelAdmin, CloneModelAdminMixin from model_clone.mixin import CloneMixin -from model_clone.models import CloneModel from model_clone.utils import create_copy_of_instance __all__ = [ "CloneMixin", - "CloneModel", "CloneModelAdmin", "CloneModelAdminMixin", "create_copy_of_instance", From d19e758e7ca9929e71f326d7c3c5cb7a9bc44e94 Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Fri, 28 Oct 2022 09:43:17 -0600 Subject: [PATCH 5/5] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 68a8a55c..4a63c9ed 100644 --- a/README.md +++ b/README.md @@ -68,7 +68,7 @@ class MyModel(models.Model): ```python from django.db import models -from model_clone import CloneModel +from model_clone.models import CloneModel class MyModel(CloneModel): title = models.CharField(max_length=200) @@ -79,7 +79,7 @@ class MyModel(CloneModel): ```python from django.db import models from django.utils.translation import gettext_lazy as _ -from model_clone import CloneModel +from model_clone.models import CloneModel class TestModel(CloneModel): title = models.CharField(max_length=200)