Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pre-commit] Upgrade tooling #189

Merged
merged 6 commits into from
Oct 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8, 3.9, "3.10", "3.11", "3.12"]
python-version: [3.9, "3.10", "3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v2
- name: Python ${{ matrix.python-version }}
Expand Down
14 changes: 9 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,32 @@ ci:

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v5.0.0
hooks:
- id: check-merge-conflict
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-json
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.1.8"
rev: "v0.7.1"
hooks:
- id: ruff
args: ["--fix"]
- repo: https://github.com/tox-dev/pyproject-fmt
rev: "2.3.1"
hooks:
- id: pyproject-fmt
- repo: https://github.com/psf/black
rev: 23.12.0
rev: 24.10.0
hooks:
- id: black
args: [--line-length, "120"]
- repo: https://github.com/Pierre-Sassoulas/black-disable-checker/
rev: v1.1.3
hooks:
- id: black-disable-checker
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.1.0
- repo: https://github.com/rbubley/mirrors-prettier
rev: v3.3.3
hooks:
- id: prettier
args: [--prose-wrap=always, --print-width=88]
Expand Down
Empty file removed .pylintrc
Empty file.
38 changes: 0 additions & 38 deletions .travis.yml

This file was deleted.

1 change: 1 addition & 0 deletions example_project/example_project/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
1. Import the include() function: from django.conf.urls import url, include
2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls'))
"""

from django.conf.urls import include

try:
Expand Down
187 changes: 94 additions & 93 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,121 +1,122 @@
[build-system]
requires = ["setuptools>=67.5.1", "wheel"]
build-backend = "setuptools.build_meta"

[tool.setuptools.packages.find]
include = ["survey*"]
requires = [ "setuptools>=67.5.1", "wheel" ]

[project]
name = "django-survey-and-report"
description = "A django survey app that can export results as CSV or PDF using your native language."
version = "1.4.8"
description = "A django survey app that can export results as CSV or PDF using your native language."
readme = "README.md"
license = { text = "AGPL-3.0" }
authors = [
{email="[email protected]", name="Pierre SASSOULAS"}
{ email = "[email protected]", name = "Pierre SASSOULAS" },
]
license = {text = "AGPL-3.0"}
classifiers = [
"Development Status :: 5 - Production/Stable",
"Natural Language :: English",
"Natural Language :: Russian",
"Natural Language :: Spanish",
"Natural Language :: French",
"Natural Language :: Japanese",
"Natural Language :: Dutch",
"Natural Language :: Chinese (Traditional)",
"Natural Language :: German",
"Natural Language :: Indonesian",
"Natural Language :: Portuguese",
"Natural Language :: Polish",
"Topic :: Utilities",
"Environment :: Web Environment",
"Intended Audience :: Developers",
"License :: OSI Approved :: GNU Affero General Public License v3",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Framework :: Django"
"Development Status :: 5 - Production/Stable",
"Environment :: Web Environment",
"Framework :: Django",
"Intended Audience :: Developers",
"License :: OSI Approved :: GNU Affero General Public License v3",
"Natural Language :: Chinese (Traditional)",
"Natural Language :: Dutch",
"Natural Language :: English",
"Natural Language :: French",
"Natural Language :: German",
"Natural Language :: Indonesian",
"Natural Language :: Japanese",
"Natural Language :: Polish",
"Natural Language :: Portuguese",
"Natural Language :: Russian",
"Natural Language :: Spanish",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Utilities",
]
dependencies = [
"django>=2.2,<5",
"django-bootstrap-form>=3.4",
"django-tastypie>=0.14.2",
"django-registration>=3.0",
"pytz>=2018.9",
"ordereddict>=1.1",
"pyyaml>=4.2b1",
"django>=2.2,<5",
"django-bootstrap-form>=3.4",
"django-registration>=3",
"django-tastypie>=0.14.2",
"ordereddict>=1.1",
"pytz>=2018.9",
"pyyaml>=4.2b1",
]

[project.urls]
"Source Code" = "https://github.com/Pierre-Sassoulas/django-survey"
"Bug Tracker" = "https://github.com/Pierre-Sassoulas/django-survey/issues"

[project.optional-dependencies]
dev = [
"pySankeyBeta~=1.3.0",
"django-rosetta",
"coverage",
"python-coveralls",
"coveralls",
"colorama",
"pylint",
"pylint-django",
"pre-commit"
optional-dependencies.dev = [
"colorama",
"coverage",
"coveralls",
"django-rosetta",
"pre-commit",
"pylint>=3.3.1",
"pylint-django",
"pysankeybeta~=1.3.0",
"pytest",
"pytest-django",
"python-coveralls",
"setuptools",
]
sankey = [
"pySankeyBeta~=1.3.0",
optional-dependencies.sankey = [
"pysankeybeta~=1.3.0",
]
urls."Bug Tracker" = "https://github.com/Pierre-Sassoulas/django-survey/issues"
urls."Source Code" = "https://github.com/Pierre-Sassoulas/django-survey"

[tool.setuptools.packages.find]
include = [ "survey*" ]

[tool.ruff]

line-length = 120

select = [
"E", # pycodestyle
"F", # pyflakes
"W", # pycodestyle
"B", # bugbear
"I", # isort
"RUF", # ruff
"UP", # pyupgrade
lint.select = [
"B", # bugbear
"E", # pycodestyle
"F", # pyflakes
"I", # isort
"RUF", # ruff
"UP", # pyupgrade
"W", # pycodestyle
]

ignore = [
"RUF012", # mutable default values in class attributes
lint.ignore = [
"RUF012", # mutable default values in class attributes
]

[tool.pylint.main]
load-plugins ="pylint_django"
load-plugins = "pylint_django"

disable=[
# I0011 Warning locally suppressed using disable-msg
"I0011",
"no-member",
"missing-docstring", # We don't want docstring everywhere
"too-few-public-methods", # More harmful than beneficial in django project
"too-many-arguments",
"too-many-instance-attributes",
# TODO Fix
"unspecified-encoding",
"inconsistent-return-statements",
"consider-using-with",
"fixme",
"no-else-return",
"imported-auth-user",
"unused-argument",
"arguments-differ",
"consider-using-f-string",
"too-many-branches",
"redefined-builtin",
"superfluous-parens",
"useless-parent-delegation",
"unused-private-member",
"duplicate-code",
"attribute-defined-outside-init",
disable = [
# I0011 Warning locally suppressed using disable-msg
"I0011",
"no-member",
"missing-docstring", # We don't want docstring everywhere
"too-few-public-methods", # More harmful than beneficial in django project
"too-many-arguments",
"too-many-instance-attributes",
# TODO Fix
"too-many-positional-arguments", # Bad API
"unspecified-encoding",
"inconsistent-return-statements",
"consider-using-with",
"fixme",
"no-else-return",
"imported-auth-user",
"unused-argument",
"arguments-differ",
"consider-using-f-string",
"too-many-branches",
"redefined-builtin",
"superfluous-parens",
"useless-parent-delegation",
"unused-private-member",
"duplicate-code",
"attribute-defined-outside-init",
]
ignore="migrations"
good-names="i,j,k,ex,Run,_,f,e,maxDiff"
ignore = "migrations"
good-names = "i,j,k,ex,Run,_,f,e,maxDiff"
max-line-length = 120
Empty file removed requirements.txt
Empty file.
1 change: 0 additions & 1 deletion survey/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@


class DjangoSurveyAndReportConfig(AppConfig):

"""
See https://docs.djangoproject.com/en/2.1/ref/applications/#django.apps.AppConfig
"""
Expand Down
1 change: 0 additions & 1 deletion survey/exporter/survey2x.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@


class Survey2X:

"""Abstract class for Survey exporter."""

def __init__(self, survey=None):
Expand Down
2 changes: 1 addition & 1 deletion survey/exporter/tex/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def _init_from_file(self, filepath):
for survey_name in list(configuration.keys()):
self.check_survey_exists(survey_name)
if not configuration[survey_name]:
raise ValueError("Nothing in %s's configuration" % survey_name)
raise ValueError(f"Nothing in {survey_name}'s configuration")
return configuration

def optional_update(self, dict_, update_dict, key):
Expand Down
1 change: 0 additions & 1 deletion survey/exporter/tex/configuration_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@


class ConfigurationBuilder(Configuration):

"""
Permit to create serializable uninitialized configuration easily.
We just use the default dict for a Builder, the user will be able to
Expand Down
9 changes: 4 additions & 5 deletions survey/exporter/tex/latex_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@


class LatexFile:

"""Permit to handle the content of a LatexFile"""

def __init__(self, document_class, document_option=None, header=None, intro=None, footer=None, date=None, **kwargs):
Expand Down Expand Up @@ -36,11 +35,11 @@ def header(self):
header = "\\documentclass"
if self.document_option:
header += f"[{self.document_option}]"
header += "{%s}\n" % self.document_class
header += "\\date{%s}\n" % self.date
header += "%s\n" % self._header
header += f"{{{self.document_class}}}\n"
header += f"\\date{{{self.date}}}\n"
header += f"{self._header}\n"
header += "\\begin{document}\n"
header += "%s\n" % self.intro
header += f"{self.intro}\n"
return header

@property
Expand Down
1 change: 0 additions & 1 deletion survey/exporter/tex/question2tex.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@


class Question2Tex:

"""
This class permit to generate latex code directly from the Question
object after overriding the tex() function.
Expand Down
Loading
Loading