From 20edda49365aeaf91aa05893328461ceb38621b7 Mon Sep 17 00:00:00 2001 From: Jaap Joris Vens Date: Tue, 21 Feb 2023 00:21:13 +0100 Subject: [PATCH] Upgrade pre-commit hooks and reformat code --- .pre-commit-config.yaml | 25 ++++++++++--------------- cms/__main__.py | 2 +- cms/templatetags/cms.py | 3 +-- pyproject.toml | 5 +++-- setup.cfg | 7 +++++-- setup.py | 9 +++++---- 6 files changed, 25 insertions(+), 26 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b1cf2b2..ea6f03e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,24 +1,11 @@ repos: - - - repo: https://github.com/rtts/djhtml - rev: v1.5.2 - hooks: - - id: djhtml - - - repo: https://github.com/myint/autoflake - rev: v2.0.0 - hooks: - - id: autoflake - args: ['--in-place', '--remove-all-unused-imports'] - - repo: https://github.com/pycqa/isort - rev: 5.11.4 + rev: 5.12.0 hooks: - id: isort - args: ['--resolve-all-configs', '--line-length', '88'] - repo: https://github.com/psf/black - rev: 22.12.0 + rev: 23.1.0 hooks: - id: black @@ -26,3 +13,11 @@ repos: rev: 6.0.0 hooks: - id: flake8 + + - repo: https://github.com/rtts/djhtml + rev: 3.0.0 + hooks: + - id: djhtml + - id: djcss + types: [scss] + - id: djjs diff --git a/cms/__main__.py b/cms/__main__.py index 4388cc1..128e004 100644 --- a/cms/__main__.py +++ b/cms/__main__.py @@ -3,9 +3,9 @@ import os import re import shutil +import cms from pip._internal.operations import freeze as pip -import cms import example diff --git a/cms/templatetags/cms.py b/cms/templatetags/cms.py index 708f7ea..353d3a1 100644 --- a/cms/templatetags/cms.py +++ b/cms/templatetags/cms.py @@ -1,10 +1,9 @@ +from cms import registry from django import template from django.shortcuts import reverse from django.utils.safestring import mark_safe from markdown import markdown as md -from cms import registry - MARKDOWN_EXTENSIONS = ["extra", "smarty"] register = template.Library() diff --git a/pyproject.toml b/pyproject.toml index 5d7bf33..fed528d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,2 +1,3 @@ -[tool.isort] -profile = "black" +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" diff --git a/setup.cfg b/setup.cfg index 6f094a9..7c067ea 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,4 +1,7 @@ [flake8] max-line-length = 88 -select = C,E,F,W,B,B950 -extend-ignore = E203, E501 +extend-ignore = E203 + +[isort] +profile = black +known_third_party = cms diff --git a/setup.py b/setup.py index 0c61a19..e43562e 100755 --- a/setup.py +++ b/setup.py @@ -1,7 +1,6 @@ #!/usr/bin/env python -from setuptools import find_packages, setup - import cms +from setuptools import find_packages, setup with open("README.md", "r") as fh: long_description = fh.read() @@ -22,7 +21,10 @@ setup( include_package_data=True, classifiers=[ "Programming Language :: Python :: 3", - "License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)", + ( + "License :: OSI Approved :: GNU Affero General Public License v3 or later" + " (AGPLv3+)" + ), "Operating System :: OS Independent", ], python_requires=">=3.8", @@ -34,7 +36,6 @@ setup( "easy-thumbnails", "libsass", "markdown", - "pre-commit", "psycopg2", "pylibmc", ],