Skip to content

Commit

Permalink
Update flake8 settings (#45)
Browse files Browse the repository at this point in the history
* Update flake8 settings

* Update localstack to new version 1.0.0 and have confirm_action in init file
  • Loading branch information
TrangPham committed Feb 6, 2023
1 parent 5add8ef commit 76e96c3
Show file tree
Hide file tree
Showing 9 changed files with 33 additions and 21 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Expand Up @@ -30,15 +30,15 @@ jobs:
AWS_ACCESS_KEY_ID: test
AWS_SECRET_ACCESS_KEY: test
# enable persistance
DATA_DIR: /tmp/localstack/data
PERSISTENCE: 1
LAMBDA_EXECUTOR: local
DOCKER_HOST: unix:///var/run/docker.sock
DEBUG: true
volumes:
# It doesn't seem like the scripts in entrypoint are being ran... or they are not copied over since
# the checkout action happens after init services on Github Actions
# - "${{ github.workspace }}/docker-entrypoint-initaws.d:/docker-entrypoint-initaws.d"
- "${{ github.workspace }}/tmp/localstack:/tmp/localstack"
- "${{ github.workspace }}/volume:/var/lib/localstack"
- "/var/run/docker.sock:/var/run/docker.sock"
ports:
- 4566:4566
Expand All @@ -63,7 +63,7 @@ jobs:
- name: Update Permissions
run: |
sudo chown -R $USER:$USER ${{ github.workspace }}
# required because actions/checkout@2 wants to delete the /tmp/localstack folder
# required because actions/checkout@2 wants to delete the localstack folder
- uses: actions/checkout@v2
- name: Build Docker for Python 3.6
if: ${{ matrix.python-version == 3.6 }}
Expand Down
2 changes: 2 additions & 0 deletions Dockerfile
Expand Up @@ -4,6 +4,8 @@ ENV PYTHONUNBUFFERED=1
ENV USE_DOCKER=true
WORKDIR /code
COPY . /code/
RUN echo "Use legency resolver for pip. It does not use the feature back-tracking. Thus is easier to debug imcompatible dependencies."
RUN pip install --upgrade pip --use-deprecated=legacy-resolver
ARG DJANGO_VERSION="3.1.7"
RUN echo "Installing Django Version: ${DJANGO_VERSION}"
RUN pip install django==${DJANGO_VERSION}
Expand Down
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -110,7 +110,7 @@ Note: `confirmation_fields` apply to both add/change confirmations.
**Confirm Action:**

```py
from admin_confirm.admin import AdminConfirmMixin, confirm_action
from admin_confirm import AdminConfirmMixin, confirm_action

class MyModelAdmin(AdminConfirmMixin, ModelAdmin):
actions = ["action1", "action2"]
Expand Down
3 changes: 2 additions & 1 deletion admin_confirm/__init__.py
@@ -1,2 +1,3 @@
__all__ = ["admin"]
__all__ = ["admin", "confirm_action"]
from .admin import AdminConfirmMixin # noqa
from .admin import confirm_action # noqa
4 changes: 2 additions & 2 deletions docker-compose.dev.yml
Expand Up @@ -46,11 +46,11 @@ services:
- SERVICES=s3
- DEBUG=true
# enable persistance
- DATA_DIR=/tmp/localstack/data
- PERSISTENCE=1
- LAMBDA_EXECUTOR=docker
- DOCKER_HOST=unix:///var/run/docker.sock
- HOSTNAME_EXTERNAL=localstack
volumes:
- "./docker-entrypoint-initaws.d:/docker-entrypoint-initaws.d"
- "./tmp/localstack:/tmp/localstack"
- "${LOCALSTACK_VOLUME_DIR:-./volume}:/var/lib/localstack"
- "/var/run/docker.sock:/var/run/docker.sock"
4 changes: 2 additions & 2 deletions requirements.txt
Expand Up @@ -19,7 +19,7 @@ selenium~=4.0.0.a5
### END SELENIUM ###

### S3 ###
localstack~=0.12.9.1 # For testing with S3
localstack~=1.0.0 # For testing with S3
django-storages~=1.11.1
boto3~=1.17.47
boto3>=1.20.0
### END S3 ###
29 changes: 19 additions & 10 deletions setup.cfg
Expand Up @@ -6,17 +6,26 @@ exclude =
admin_confirm/tests/*
tests/*
ignore =
D107 # Missing docstring in init
D400 # Doc-string: First line should end with a period
C812 # missing trailing comma
I001 # isort found an import in the wrong position
I004 # sisort found an unexpected blank line in imports
Q000 # Remove bad quotes
WPS110 # Seems to require no one word variable names
WPS305 # Found f string
WPS336 # Explicit string concatination
# Missing docstring in init
D107
# Doc-string: First line should end with a period
D400
# missing trailing comma
C812
# isort found an import in the wrong position
I001
# isort found an unexpected blank line in imports
I004
# Remove bad quotes
Q000
# Seems to require no one word variable names
WPS110
# Found f string
WPS305
# Explicit string concatination
WPS336
per-file-ignores =
admin_confirm/tests/*: D102, WPS118, WPS204
admin_confirm/tests/*: D102, WPS118, WPS204
[coverage:run]
relative_files = True
omit = admin_confirm/tests/*
Expand Down
2 changes: 1 addition & 1 deletion tests/market/admin/checkout_admin.py
@@ -1,5 +1,5 @@
from django.core.exceptions import ValidationError
from admin_confirm.admin import AdminConfirmMixin
from admin_confirm import AdminConfirmMixin

from django.contrib.admin import ModelAdmin
from django.forms import ModelForm
Expand Down
2 changes: 1 addition & 1 deletion tests/market/admin/shop_admin.py
@@ -1,5 +1,5 @@
from django.contrib.admin import ModelAdmin
from admin_confirm.admin import AdminConfirmMixin, confirm_action
from admin_confirm import AdminConfirmMixin, confirm_action


class ShopAdmin(AdminConfirmMixin, ModelAdmin):
Expand Down

0 comments on commit 76e96c3

Please sign in to comment.