Skip to content

Commit

Permalink
Merge tag '1.0.0' into develop
Browse files Browse the repository at this point in the history
1.0.0
  • Loading branch information
dvdria committed Apr 23, 2024
2 parents d662fa0 + ddb02bb commit fcd4ee6
Show file tree
Hide file tree
Showing 19 changed files with 349 additions and 562 deletions.
83 changes: 83 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
default_language_version:
python: python3
fail_fast: true
repos:
- repo: https://github.com/asottile/pyupgrade
rev: v3.7.0
hooks:
- id: pyupgrade
stages: [commit]
name: "✅ Python Upgrade"
args:
- "--py38-plus"
- repo: https://github.com/adamchainz/django-upgrade
rev: 1.14.0 # replace with latest tag on GitHub
hooks:
- id: django-upgrade
stages: [commit]
name: "✅ Django Upgrade"
args: [--target-version, "4.2"]
- repo: https://github.com/psf/black
rev: 22.3.0
hooks:
- id: black
stages: [commit]
name: "✅ Black Reformatting"
exclude: ^.*\b(migrations)\b.*$
- repo: https://github.com/PyCQA/autoflake
rev: v1.4
hooks:
- id: autoflake
stages: [commit]
name: "✅ Autoflake Reformatting"
language: python
'types': [python]
require_serial: true
exclude: |
(?x)(
.*?/migrations/.*
)
entry: autoflake
args:
- "--ignore-init-module-imports"
- "--remove-all-unused-imports"
- "--in-place"
- "--remove-unused-variables"
- repo: https://github.com/PyCQA/flake8
rev: 3.8.0
hooks:
- id: flake8
stages: [commit]
name: "✅ Flake8 Validation"
- repo: https://github.com/PyCQA/isort
rev: 5.12.0
hooks:
- id: isort
stages: [commit]
name: "✅ Isort Validation"
- repo: local
hooks:
- id: mypy
stages: [commit]
name: "✅ Mypy Validation"
entry: mypy
language: python
types: [python]
args: ["--install-types", "--non-interactive", "--python-version=3.11"]
additional_dependencies: [
"mypy~=0.931"
]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1 # Use the ref you want to point at
hooks:
- id: check-merge-conflict
name: "✅ Checking Merge Conflict"
- repo: local
hooks:
- id: django-test
name: "🪲 Django Testing"
entry: python runtests.py
always_run: true
verbose: true
pass_filenames: false
language: system
65 changes: 0 additions & 65 deletions Makefile

This file was deleted.

3 changes: 1 addition & 2 deletions admin_access_log/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
__version__ = '0.1.7'
default_app_config = 'admin_access_log.apps.AdminAccessLogConfig'
__version__ = "1.0.0"
4 changes: 2 additions & 2 deletions admin_access_log/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@


class AdminAccessLogConfig(AppConfig):
name = 'admin_access_log'
name = "admin_access_log"
verbose_name = "Django Admin Access Log"

def ready(self):
from . import receivers
from . import receivers # noqa
2 changes: 1 addition & 1 deletion admin_access_log/receivers.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def user_login_failed_callback(sender, credentials, request, **kwargs):

def get_client_ip(request):
if request:
x_forwarded_for = request.META.get("HTTP_X_FORWARDED_FOR")
x_forwarded_for = request.headers.get("x-forwarded-for")
if x_forwarded_for:
ip = x_forwarded_for.split(",")[0]
else:
Expand Down
60 changes: 37 additions & 23 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
#
# complexity documentation build configuration file, created by
# sphinx-quickstart on Tue Jul 9 22:26:36 2013.
Expand All @@ -11,7 +10,8 @@
# All configuration values have a default; values that are commented out
# serve to show the default.

import sys, os
import os
import sys

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
Expand All @@ -31,23 +31,23 @@

# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.viewcode']
extensions = ["sphinx.ext.autodoc", "sphinx.ext.viewcode"]

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
templates_path = ["_templates"]

# The suffix of source filenames.
source_suffix = '.rst'
source_suffix = ".rst"

# The encoding of source files.
# source_encoding = 'utf-8-sig'

# The master toctree document.
master_doc = 'index'
master_doc = "index"

# General information about the project.
project = u'Django Admin Access Log'
copyright = u'2021, Frankhood Business Solution'
project = "Django Admin Access Log"
copyright = "2021, Frankhood Business Solution"

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
Expand All @@ -70,7 +70,7 @@

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
exclude_patterns = ['_build']
exclude_patterns = ["_build"]

# The reST default role (used for this markup: `text`) to use for all documents.
# default_role = None
Expand All @@ -87,7 +87,7 @@
# show_authors = False

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
pygments_style = "sphinx"

# A list of ignored prefixes for module index sorting.
# modindex_common_prefix = []
Expand All @@ -100,7 +100,7 @@

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
html_theme = 'default'
html_theme = "default"

# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
Expand Down Expand Up @@ -129,7 +129,7 @@
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
html_static_path = ["_static"]

# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
# using the given strftime format.
Expand Down Expand Up @@ -173,26 +173,29 @@
# html_file_suffix = None

# Output file base name for HTML help builder.
htmlhelp_basename = 'django-admin-access-logdoc'
htmlhelp_basename = "django-admin-access-logdoc"

# -- Options for LaTeX output --------------------------------------------------

latex_elements = {
latex_elements = { # type:ignore
# The paper size ('letterpaper' or 'a4paper').
# 'papersize': 'letterpaper',

# The font size ('10pt', '11pt' or '12pt').
# 'pointsize': '10pt',

# Additional stuff for the LaTeX preamble.
# 'preamble': '',
}

# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, documentclass [howto/manual]).
latex_documents = [
('index', 'django-admin-access-log.tex', u'Django Admin Access Log Documentation',
u'Frankhood Business Solution', 'manual'),
(
"index",
"django-admin-access-log.tex",
"Django Admin Access Log Documentation",
"Frankhood Business Solution",
"manual",
),
]

# The name of an image file (relative to this directory) to place at the top of
Expand Down Expand Up @@ -221,8 +224,13 @@
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
('index', 'django-admin-access-log', u'Django Admin Access Log Documentation',
[u'Frankhood Business Solution'], 1)
(
"index",
"django-admin-access-log",
"Django Admin Access Log Documentation",
["Frankhood Business Solution"],
1,
)
]

# If true, show URL addresses after external links.
Expand All @@ -235,9 +243,15 @@
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
('index', 'django-admin-access-log', u'Django Admin Access Log Documentation',
u'Frankhood Business Solution', 'django-admin-access-log', 'One line description of project.',
'Miscellaneous'),
(
"index",
"django-admin-access-log",
"Django Admin Access Log Documentation",
"Frankhood Business Solution",
"django-admin-access-log",
"One line description of project.",
"Miscellaneous",
),
]

# Documents to append as an appendix to all manuals.
Expand Down
2 changes: 0 additions & 2 deletions manage.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals

import os
import sys
Expand Down
7 changes: 0 additions & 7 deletions requirements_dev.in

This file was deleted.

Loading

0 comments on commit fcd4ee6

Please sign in to comment.