From 4d8692b096921f07aeda33258d6d08ca4d87b1d4 Mon Sep 17 00:00:00 2001 From: krmax44 Date: Mon, 2 Sep 2024 16:12:25 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20upgrade=20tooling,=20use=20pypro?= =?UTF-8?q?ject.toml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .pre-commit-config.yaml | 40 +++++++++++------------------ MANIFEST.in | 3 ++- pyproject.toml | 26 +++++++++++++++++++ setup.cfg | 18 ------------- setup.py | 56 ----------------------------------------- 5 files changed, 43 insertions(+), 100 deletions(-) create mode 100644 pyproject.toml delete mode 100644 setup.cfg delete mode 100644 setup.py diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9655864..64ef9b0 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,34 +1,24 @@ repos: - - repo: https://github.com/pycqa/isort - rev: 5.11.5 + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.6.3 hooks: - - id: isort - args: ['--profile', 'black', '--filter-files'] - - repo: https://github.com/psf/black - rev: '23.3.0' # Replace by any tag/version: https://github.com/psf/black/tags + - id: ruff + args: [--fix] + - id: ruff-format + + - repo: https://github.com/Riverside-Healthcare/djLint + rev: v1.35.2 hooks: - - id: black - language_version: python3 # Should be a command that runs python3.6+ - - repo: https://github.com/pycqa/flake8 - rev: '6.0.0' # pick a git hash / tag to point to - hooks: - - id: flake8 - additional_dependencies: [flake8-bugbear==23.5.9] + - id: djlint-reformat-django + - id: djlint-django + - repo: https://github.com/pre-commit/mirrors-eslint - rev: v8.45.0 + rev: v9.9.1 hooks: - id: eslint files: \.(js|ts|vue)?$ types: [file] + args: [--no-warn-ignored] + entry: npx eslint additional_dependencies: - - eslint@8.45.0 - - eslint-config-standard-with-typescript - - eslint-plugin-html - - eslint-plugin-import - - eslint-plugin-n - - eslint-plugin-promise - - eslint-plugin-vue - - prettier - - eslint-plugin-prettier - - eslint-config-standard -exclude: ^.*/migrations/.*$|eslintrc.js + - okfde/eslint-config-froide diff --git a/MANIFEST.in b/MANIFEST.in index e5705f0..18e0d5d 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,5 +1,6 @@ -include README.md LICENSE +include README.md LICENSE package.json recursive-include froide_campaign/templates * recursive-include froide_campaign/static * recursive-include froide_campaign/locale *.po recursive-include froide_campaign/locale *.mo +recursive-include frontend * \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..0da8b17 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,26 @@ +[project] +name = "froide_campaign" +readme = "README.md" +description = "Froide campaign app" +license = { file = "LICENSE" } +requires-python = ">=3.10" +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Framework :: Django", + "Intended Audience :: Developers", + "License :: OSI Approved :: MIT License", + "Operating System :: OS Independent", + "Programming Language :: Python", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.12", + "Topic :: Utilities", +] +dynamic = ["version"] +dependencies = ["froide"] + +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" + +[tool.setuptools] +packages = ["froide_campaign"] \ No newline at end of file diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index a2f0906..0000000 --- a/setup.cfg +++ /dev/null @@ -1,18 +0,0 @@ -[wheel] -universal = 1 - -[flake8] -extend-ignore = E203,E501,C901,W503,B950 -max-line-length = 88 -select = C,E,F,W,B -exclude = .git,__pycache__,docs/source/conf.py,old,build,dist,migrations -max-complexity = 10 - -[isort] -profile = black -src_paths = froide -default_section = THIRDPARTY -known_first_party = froide_campaign -known_froide = froide -known_django = django -sections = FUTURE,STDLIB,DJANGO,THIRDPARTY,FROIDE,FIRSTPARTY,LOCALFOLDER diff --git a/setup.py b/setup.py deleted file mode 100644 index 1cf3944..0000000 --- a/setup.py +++ /dev/null @@ -1,56 +0,0 @@ -#!/usr/bin/env python - -from __future__ import print_function - -import codecs -import os -import re - -from setuptools import find_packages, setup - - -def read(*parts): - filename = os.path.join(os.path.dirname(__file__), *parts) - with codecs.open(filename, encoding="utf-8") as fp: - return fp.read() - - -def find_version(*file_paths): - version_file = read(*file_paths) - version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]", version_file, re.M) - if version_match: - return version_match.group(1) - raise RuntimeError("Unable to find version string.") - - -setup( - name="froide_campaign", - version=find_version("froide_campaign", "__init__.py"), - url="https://github.com/okfde/froide-campaign", - license="MIT", - description="Froide campaign app", - long_description=read("README.md"), - author="Stefan Wehrmeyer", - author_email="mail@stefanwehrmeyer.com", - packages=find_packages(), - install_requires=[ - "froide", - "django-filter", - "django-admin-sortable2", - "djangorestframework", - ], - include_package_data=True, - classifiers=[ - "Development Status :: 5 - Production/Stable", - "Framework :: Django", - "Intended Audience :: Developers", - "License :: OSI Approved :: MIT License", - "Operating System :: OS Independent", - "Programming Language :: Python", - "Programming Language :: Python :: 2.6", - "Programming Language :: Python :: 2.7", - "Programming Language :: Python :: 3.3", - "Topic :: Utilities", - ], - zip_safe=False, -)