diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 000000000..7101f3483 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,22 @@ +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v3.2.0 + hooks: + - id: trailing-whitespace + - id: end-of-file-fixer + - id: check-yaml + - id: check-added-large-files + - id: check-case-conflict + - id: check-merge-conflict + + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.4.9 + hooks: + - id: ruff + name: ruff linter + args: [ + --fix, + --show-fixes, + ] + - id: ruff-format + name: ruff formatter diff --git a/pyproject.toml b/pyproject.toml index 14114a33e..8796d1977 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -32,7 +32,7 @@ sorl-thumbnail = "12.10.0" tabulate = "0.9.0" uwsgi = "2.0.24" Pillow = "10.3.0" - +pre-commit = "3.7.1" [tool.poetry.group.dev.dependencies] cssselect = "1.2.0" diff --git a/src/pycontw2016/pyproject.toml b/src/pycontw2016/pyproject.toml new file mode 100644 index 000000000..b4a383747 --- /dev/null +++ b/src/pycontw2016/pyproject.toml @@ -0,0 +1,82 @@ +[tool.poetry] +name = "pycontw-backend" +version = "0.1.0" +description = "The API backend and proposal system of PyCon TW website." +authors = ["PyCon TW Web Team "] +readme = "README.md" +package-mode = false + +[tool.poetry.dependencies] +python = "~3.10.0" + +Django = "3.2.25" +crispy-bootstrap3 = "2024.1" +dj-registry = "0.2.2" +django-cors-headers = "4.3.1" +django-compressor = "4.4" +django-compressor-toolkit = "0.6.0" +django-crispy-forms = "2.0" +django-environ = "0.11.2" +django-extensions = "3.2.3" +django-import-export = "3.3.8" +django-modeltranslation = "0.18.11" +django-storages = "1.14.2" +djangorestframework = "3.15.1" +google-cloud-storage = "1.44.0" +ipython = "8.23.0" +lxml = "4.9.4" +psycopg2 = "2.9.9" +pytz = "2024.1" +requests = "2.32.0" +sorl-thumbnail = "12.10.0" +tabulate = "0.9.0" +uwsgi = "2.0.24" +Pillow = "10.3.0" +pre-commit = "3.7.1" + +[tool.poetry.group.dev.dependencies] +cssselect = "1.2.0" +django-debug-toolbar = "4.3.0" +pytest = "8.1.1" +pytest-cov = "5.0.0" +pytest-django = "4.8.0" +pytest-mock = "3.14.0" +pytest-xdist = "3.5.0" +ruff = "0.3.5" +Werkzeug = "3.0.3" + + +[tool.ruff] +exclude = [".git", "__pycache__", "migrations"] +line-length = 120 + +[tool.ruff.lint] +ignore = ["E251"] +select = [ + "E", # pycodestyle error + "W", # pycodestyle warning + "F", # Pyflakes + "I001", # isort + "N", # pep8-naming + "B", # bugbear + "UP", # pyupgrade +] + +[tool.ruff.lint.isort] +known-first-party = [ + "attendee", + "ccip", + "core", + "events", + "postgres", + "proposals", + "pycontw2016", + "reviews", + "sponsors", + "users", +] + + +[build-system] +requires = ["poetry-core"] +build-backend = "poetry.core.masonry.api"