Skip to content

Commit

Permalink
Update to Python 3.11/pyproject.toml/current django versions (#180)
Browse files Browse the repository at this point in the history
* upgrade python/django versions in tox.ini
* Drop python 3.7 and add python 3.11
  • Loading branch information
johanneswilm authored Mar 7, 2023
1 parent 781a924 commit 41837bc
Show file tree
Hide file tree
Showing 47 changed files with 731 additions and 739 deletions.
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.7, 3.8, 3.9, "3.10"]
python-version: [3.8, 3.9, "3.10", "3.11"]
steps:
- uses: actions/checkout@v2
- name: Python ${{ matrix.python-version }}
Expand Down
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ survey.db
django_survey_and_report.egg-info/
survey_test/static/
venv/
.direnv/
.envrc
.idea/
.project
.pydevproject
Expand All @@ -18,11 +20,14 @@ build/
dist/
.tox/
.vscode/
csv/category-without-description.csv
csv/short-survey.csv
csv/test-management-survey.csv
csv/test-survey.csv
csv/test-survey2.csv
tex/category-without-description.tex
tex/q9_vs_q9.png
tex/q20_vs_q20.png
tex/short-survey.tex
tex/test-management-survey.tex
tex/test-survey.tex
Expand Down
16 changes: 8 additions & 8 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
rev: v4.4.0
hooks:
- id: check-merge-conflict
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-json
- repo: https://github.com/myint/autoflake
rev: v1.4
rev: v2.0.1
hooks:
- id: autoflake
args:
Expand All @@ -20,30 +20,30 @@ repos:
- --remove-duplicate-keys
- --remove-unused-variables
- repo: https://github.com/asottile/pyupgrade
rev: v2.37.3
rev: v3.3.1
hooks:
- id: pyupgrade
args: [--py36-plus]
- repo: https://github.com/psf/black
rev: 22.6.0
rev: 23.1.0
hooks:
- id: black
args: [--line-length, "120"]
- repo: https://github.com/Pierre-Sassoulas/black-disable-checker/
rev: v1.1.1
rev: v1.1.3
hooks:
- id: black-disable-checker
- repo: https://github.com/PyCQA/flake8
rev: 5.0.4
rev: 6.0.0
hooks:
- id: flake8
additional_dependencies: [flake8-bugbear, flake8-typing-imports==1.12.0]
- repo: https://github.com/PyCQA/isort
rev: 5.10.1
rev: 5.12.0
hooks:
- id: isort
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v2.7.1
rev: v3.0.0-alpha.6
hooks:
- id: prettier
args: [--prose-wrap=always, --print-width=88]
Expand Down
61 changes: 61 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
[build-system]
requires = ["setuptools>=67.5.1", "wheel"]
build-backend = "setuptools.build_meta"

[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.7"
readme = "README.md"
authors = [
{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.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Framework :: Django"
]
dynamic = ["dependencies"]

[project.urls]
repository = "https://github.com/Pierre-Sassoulas/django-survey"

[project.optional-dependencies]
dev = [
"pySankeyBeta~=1.3.0",
"django-rosetta",
"coverage",
"python-coveralls",
"coveralls",
"colorama",
"pylint",
"flake8",
"pre-commit"
]
sankey = [
"pySankeyBeta~=1.3.0",
]

[tool.setuptools.dynamic]
dependencies = {file = "requirements.txt"}
7 changes: 7 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
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
58 changes: 0 additions & 58 deletions setup.cfg

This file was deleted.

4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
from setuptools import setup
from setuptools import find_packages, setup

setup()
setup(include_package_data=True, packages=find_packages())
1 change: 0 additions & 1 deletion survey/exporter/tex/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@


class Configuration:

DEFAULT_PATH = Path(HERE, "default_conf.yaml")

def __init__(self, configuration_file=None):
Expand Down
3 changes: 2 additions & 1 deletion survey/exporter/tex/question2tex_sankey.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
warnings.warn(
"Cannot import 'sankey', please install the package using"
"the sankey extra. (pip install django-survey-and-report[sankey])"
": '{}'".format(e)
": '{}'".format(e),
stacklevel=2,
)
SANKEY = False

Expand Down
1 change: 0 additions & 1 deletion survey/exporter/tex/survey2tex.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ def __init__(self):


class Survey2Tex(Survey2X):

ANALYSIS_FUNCTION = []
PGF_PIE_STY = Path(STATIC, "survey", "sty", "pgf-pie.sty")
PGF_PLOT_STY = Path(STATIC, "survey", "sty", "pgfplots.sty")
Expand Down
1 change: 0 additions & 1 deletion survey/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@


class ResponseForm(models.ModelForm):

FIELDS = {
Question.TEXT: forms.CharField,
Question.SHORT_TEXT: forms.CharField,
Expand Down
Loading

0 comments on commit 41837bc

Please sign in to comment.