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

Update to Python 3.11/pyproject.toml/current django versions #180

Merged
merged 6 commits into from
Mar 7, 2023
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.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())
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this can also go in pyproject.toml, (or it become useless), no ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, however, I saw this listed as still "beta" in the documentation as of today, which is why I moved it back into setup.py. I did the same for my own projects 1-2 months ago. It's possible that it will just work and that we can ignore the beta note in the documentation. https://setuptools.pypa.io/en/latest/userguide/package_discovery.html

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair enough, thank you for the explanation :)

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