Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: graphql-python/graphql-server
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v2.0.0
Choose a base ref
...
head repository: graphql-python/graphql-server
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref

Commits on Apr 12, 2020

  1. Migration to graphql-core-v3 (#36)

    * feat: server-core compatible with graphql-core-v3
    
    - Bump dependencies
    - Refactor code to use f-strings format (3.6+)
    - Rename public data structures
    
    BREAKING CHANGE:
    - Requires graphql-core-v3
    - Drop support for Python 2 and below 3.6
    - Remove executor check as graphql-core-v3 does not have SyncExecutor
    
    * chore: drop unsupported py versions on tox and travis
    
    * tests: apply minor fixes to older tests
    
    * chore: apply black formatting
    
    * chore: fix flake8 issues
    
    * chore: remove promise package
    
    * tests: achieve 100% coverage
    
    * chore: apply compatible isort-black options
    
    * chore: solve dev tools issues
    
    * chore: remove pypy3 from tox envlist
    
    * chore: remove pypy3 from travis
    
    * tests: re-add helper tests
    
    * chore: pin graphql-core to 3.1.0
    
    * refactor: use graphql and graphql-sync functions
    
    * tests: remove Promise and use async await iterator
    
    * refactor: remove pytest-asyncio
    
    * chore: set graphql-core dependency semver
    
    Co-Authored-By: Jonathan Kim <jkimbo@gmail.com>
    
    Co-authored-by: Jonathan Kim <jkimbo@gmail.com>
    KingDarBoja and jkimbo authored Apr 12, 2020
    Copy the full SHA
    865ee9d View commit details

Commits on May 5, 2020

  1. Merge flask-graphql (#37)

    * refactor: add flask-graphql as optional feature
    
    * refactor(server): default_format_error to __all__
    
    * chore: rename dir flask-graphql to flask
    
    * chore: add extras require all key
    
    * chore: update gitignore
    
    * fix(sc): move params query check to try-except
    
    * refactor(flask): remove unused backend param
    
    * tests(flask): graphiqlview and graphqlview
    
    * styles: apply black, isort, flake8 formatting
    
    * chore: add all requires to test env
    
    * chore(flask): remove blueprint module
    
    * refactor(flask): remove py27 imports and unused test
    
    * styles: apply black, isort and flake8 formatting
    KingDarBoja authored May 5, 2020
    Copy the full SHA
    66b8a2b View commit details

Commits on May 10, 2020

  1. Copy the full SHA
    ea81704 View commit details
  2. Return 200 errors (#39)

    jkimbo authored May 10, 2020
    Copy the full SHA
    6c13ef6 View commit details

Commits on Jun 6, 2020

  1. Merge sanic-graphql (#38)

    * refactor: add sanic-graphql as optional feature
    
    * refactor: sanic tests and remove executor parameter
    
    * styles: apply black and flake8 formatting
    KingDarBoja authored Jun 6, 2020
    Copy the full SHA
    35ed87d View commit details

Commits on Jun 10, 2020

  1. Merge aiohttp-graphql (#42)

    * refactor: add aiohttp-graphql as optional feature
    
    * tests: cleanup aiohttp subpackage
    KingDarBoja authored Jun 10, 2020
    Copy the full SHA
    8e2f147 View commit details

Commits on Jul 5, 2020

  1. Merge webob-graphql (#45)

    * refactor: add webob-graphql as optional feature
    
    * fix render template on webob
    
    * fix context on webob graphqlview
    
    * fix last missing test of webob graphiqlview
    
    * styles: apply black formatting
    KingDarBoja authored Jul 5, 2020
    Copy the full SHA
    eaf75e6 View commit details

Commits on Jul 11, 2020

  1. refactor: graphiql template shared across servers (#49)

    * refactor: graphiql template shared across servers
    
    * chore: add typing-extensions to setup py
    
    * feat: add headers and should persist headers props
    
    * chore: mypy issues
    
    * fix: pass config to webob render graphiql
    
    * refactor: pass arguments instead of spread
    
    * chore: add pytest-asyncio and bump pytest dep
    KingDarBoja authored Jul 11, 2020
    Copy the full SHA
    accfef4 View commit details
  2. Copy the full SHA
    070a23d View commit details
  3. Copy the full SHA
    c749030 View commit details
  4. Copy the full SHA
    cc89b1d View commit details
  5. Copy the full SHA
    351ca7a View commit details
  6. Copy the full SHA
    db23e62 View commit details
  7. Split parsing, validation and execution (#43) (#53)

    Instead of graphql()/graphql_sync() we now call execute() directly.
    
    This also allows adding custom validation rules and limiting the number
    of reported errors.
    Cito authored Jul 11, 2020
    Copy the full SHA
    90cfb09 View commit details

Commits on Jul 22, 2020

  1. Docs about integration with each framework (#54)

    Co-authored-by: Jonathan Kim <jkimbo@gmail.com>
    KingDarBoja and jkimbo authored Jul 22, 2020
    Copy the full SHA
    51dcc22 View commit details

Commits on Jul 23, 2020

  1. docs: add graphql-server logo (#57)

    * docs: add graphql-server logo
    
    * docs: add logo to manifest
    KingDarBoja authored Jul 23, 2020
    Copy the full SHA
    0c7b59a View commit details
  2. chore: add GitHub Actions (#58)

    * chore: add GitHub Actions
    
    * chore: add deploy workflow
    
    * chore: only run actions on pull request
    KingDarBoja authored Jul 23, 2020
    Copy the full SHA
    e8f3a89 View commit details

Commits on Jul 27, 2020

  1. Add graphiql options and missing flask context (#55)

    * Add graphiql options and missing flask context
    
    * Possible custom context test fix
    
    * Provide same context tests to other integration
    KingDarBoja authored Jul 27, 2020
    Copy the full SHA
    cf6d1d4 View commit details

Commits on Jul 28, 2020

  1. Copy the full SHA
    f5e8302 View commit details

Commits on Aug 2, 2020

  1. Copy the full SHA
    482f21b View commit details

Commits on Oct 17, 2020

  1. chore: submit coverage to codecov (#63)

    * chore: submit coverage to codecov
    
    * chore: add correct package name on gh action
    
    * chore: add windows to os matrix for tests action workflow
    KingDarBoja authored Oct 17, 2020
    Copy the full SHA
    49f73c3 View commit details
  2. Fix enable_async for aiohttp and sanic if graphiql is enabled (#67)

    * Fix enable_async=True in aiohttp
    
    Apply the fix suggested by ketanbshah in
    #64
    
    * Apply the same fix to sanic
    
    * tests: add tests for graphiql enabled plus async
    
    Co-authored-by: Manuel Bojato <30560560+KingDarBoja@users.noreply.github.com>
    Co-authored-by: KingDarBoja <stevenbojato04@gmail.com>
    3 people authored Oct 17, 2020
    Copy the full SHA
    e39398a View commit details

Commits on Oct 27, 2020

  1. Copy the full SHA
    60e9171 View commit details

Commits on Oct 31, 2020

  1. Copy the full SHA
    f89d93c View commit details

Commits on Nov 1, 2020

  1. feat: Quart Server Integration (#70)

    * feat: Quart Server Integration
    
    * chore: change quart version constraint
    
    * tests: check py version for test_request_context
    
    * tests: refactor graphiqlview test suite
    
    * tests: properly match py36 quart API
    
    * fix: manually get accept mime types for py36
    KingDarBoja authored Nov 1, 2020
    Copy the full SHA
    5b7f5de View commit details

Commits on Nov 28, 2020

  1. Prevent including test directory when installing package (#75)

    * Prevent including test directory when installing package
    
    * chore: include only graphql_server package
    
    Co-authored-by: Manuel Bojato <30560560+KingDarBoja@users.noreply.github.com>
    koirikivi and KingDarBoja authored Nov 28, 2020
    Copy the full SHA
    9815d26 View commit details
  2. Copy the full SHA
    c03e1a4 View commit details

Commits on Aug 9, 2021

  1. Fix tests (#84)

    jkimbo authored Aug 9, 2021
    Copy the full SHA
    b8705c2 View commit details

Commits on Aug 10, 2021

  1. add support for validation rules (#83)

    Co-authored-by: Aryan Iyappan <69184573+aryan340@users.noreply.github.com>
    Co-authored-by: Jonathan Kim <jkimbo@gmail.com>
    3 people authored Aug 10, 2021
    Copy the full SHA
    86b7926 View commit details
  2. v3.0.0b4

    jkimbo committed Aug 10, 2021
    Copy the full SHA
    1ccebee View commit details

Commits on Dec 24, 2021

  1. Copy the full SHA
    476edf3 View commit details

Commits on Jan 17, 2022

  1. Copy the full SHA
    384ae78 View commit details
  2. Copy the full SHA
    bc74eed View commit details
  3. Update dependencies

    Cito committed Jan 17, 2022
    Copy the full SHA
    bda6a87 View commit details
  4. Support Python 3.10

    Also restrict web frameworks to supported versions
    Cito committed Jan 17, 2022
    Copy the full SHA
    ec4ed15 View commit details
  5. Make teste work with Python 3.6 again

    Note that pytest-asyncio 0.17 is not supported for Python 3.6.
    Cito committed Jan 17, 2022
    Copy the full SHA
    eec3d33 View commit details
  6. Release a new beta version

    Cito committed Jan 17, 2022
    Copy the full SHA
    8dec731 View commit details

Commits on Dec 25, 2022

  1. chore: update dependencies (#99)

    * Update dependencies
    
    * Relax flask dependency to allow flask 2
    
    * Fixes for quart >=0.15
    
    Fix quart.request.get_data signature
    
    QuartClient -> TestClientProtocol
    * Lint
    * Fix aiohttp tests
    * Update sanic to v22.6
    * Make sanic v22.9 work
    * Fix deprecation warnings
    DeprecationWarning: Use 'content=<...>' to upload raw bytes/text content.
    
    * Update graphiql to 1.4.7 for security reason
    "All versions of graphiql < 1.4.7 are vulnerable to an XSS attack."
    https://github.com/graphql/graphiql/blob/ab2b52f06213bd9bf90c905c1b460b6939f3d856/docs/security/2021-introspection-schema-xss.md
    
    * Fix webob graphiql check
    Was working by accident before
    
    * Fix quart PytestCollectionWarning
    cannot collect test class 'TestClientProtocol' because it has a __init__ constructor
    * Make Jinja2 optional
    * Add python 3.11 and remove 3.6
    * Tweak quart for python 3.7 to 3.11
    * Fix test for python 3.11
    
    Co-authored-by: Giovanni Campagna <scampa.giovanni@gmail.com>
    Co-authored-by: Choongkyu Kim <choongkyu.kim+gh@gmail.com>
    3 people authored Dec 25, 2022
    Copy the full SHA
    184ba72 View commit details

Commits on Jan 3, 2023

  1. feat: add support for execution_context_class (#100)

    Adds support for a custom execution context class as supported by graphql-core
    
    Co-authored-by: Alvin Chow <alvinchow86@gmail.com>
    kiendang and alvinchow86 authored Jan 3, 2023
    Copy the full SHA
    1972b27 View commit details

Commits on Feb 15, 2023

  1. Copy the full SHA
    8829c09 View commit details
  2. Copy the full SHA
    36bbd47 View commit details
  3. Copy the full SHA
    8b9639e View commit details

Commits on Apr 13, 2023

  1. Allow empty custom context in GraphQLView (#106)

    * Allow empty custom context in GraphQLView
    
    * chore: black
    
    ---------
    
    Co-authored-by: Kien Dang <mail@kien.ai>
    leonardwellthy and kiendang authored Apr 13, 2023
    Copy the full SHA
    d76450a View commit details

Commits on Apr 26, 2023

  1. Copy the full SHA
    6806e56 View commit details

Commits on May 1, 2023

  1. release: v3.0.0b6 (#109)

    kiendang authored May 1, 2023
    Copy the full SHA
    a95e12f View commit details

Commits on Oct 13, 2023

  1. chore: update to latest versions of framework (#120)

    * chore: update to flask 3
    
    * chore: update to sanic 23
    
    * fix: remove use of deprecated cgi module
    
    * chore: remove Python 3.7 from CI
    
    EOL since 2023-06-27
    https://devguide.python.org/versions/
    
    * chore: remove unused context
    
    * chore: update versions of dev tools
    
    * chore: make 3.11 the default python version in CI
    kiendang authored Oct 13, 2023
    Copy the full SHA
    17363af View commit details

Commits on Oct 16, 2023

  1. release: v3.0.0b7 (#122)

    kiendang authored Oct 16, 2023
    Copy the full SHA
    8af13c0 View commit details
  2. chore: use pre-commit and ruff (#116)

    * chore: use pre-commit with ruff
    
    * chore: fix warning: Invalid # noqa directive
    
    * fix: B023
    
    Function definition does not bind loop variable `ex`.
    
    * chore: add check-manifest pre-commit
    
    * chore: remove flake8 and isort config from setup.cfg
    
    * chore: remove black, flake8, ... from dependencies and tox
    
    * chore: add flake8-comprehensions
    
    * chore: remove pointless noqa
    
    * chore: keep type annotation syntax compatible with python 3.8
    kiendang authored Oct 16, 2023
    Copy the full SHA
    9180278 View commit details

Commits on Oct 17, 2023

  1. refactor!: Drop VersionInfo in favor of tuple (#124)

    * fix: fix and refactor version tests
    
    to handle release candidates correctly
    
    * fix: remove VersionInfo entirely
    
    keep graphql_server.version_info as a plain tuple
    add tests using the packaging package to make sure
    graphql_server.version and graphql_server.version_info are PEP 440–compliant and pointing to the same version
    
    * chore: update pre-commit hooks
    kiendang authored Oct 17, 2023
    Copy the full SHA
    75a1d7d View commit details

Commits on Oct 25, 2023

  1. Copy the full SHA
    536721c View commit details
Showing with 7,192 additions and 769 deletions.
  1. +26 −0 .github/workflows/deploy.yml
  2. +22 −0 .github/workflows/lint.yml
  3. +50 −0 .github/workflows/tests.yml
  4. +200 −12 .gitignore
  5. +27 −0 .pre-commit-config.yaml
  6. +34 −0 .ruff.toml
  7. +0 −29 .travis.yml
  8. +8 −12 CONTRIBUTING.md
  9. +4 −0 MANIFEST.in
  10. +30 −23 README.md
  11. +1 −1 codecov.yml
  12. +1 −0 docs/_static/graphql-server-logo.svg
  13. +74 −0 docs/aiohttp.md
  14. +77 −0 docs/flask.md
  15. +75 −0 docs/sanic.md
  16. +64 −0 docs/webob.md
  17. +169 −180 graphql_server/__init__.py
  18. +3 −0 graphql_server/aiohttp/__init__.py
  19. +271 −0 graphql_server/aiohttp/graphqlview.py
  20. +1 −1 graphql_server/error.py
  21. +3 −0 graphql_server/flask/__init__.py
  22. +194 −0 graphql_server/flask/graphqlview.py
  23. +3 −0 graphql_server/quart/__init__.py
  24. +214 −0 graphql_server/quart/graphqlview.py
  25. +311 −0 graphql_server/render_graphiql.py
  26. +3 −0 graphql_server/sanic/__init__.py
  27. +246 −0 graphql_server/sanic/graphqlview.py
  28. +25 −0 graphql_server/utils.py
  29. +15 −0 graphql_server/version.py
  30. +3 −0 graphql_server/webob/__init__.py
  31. +204 −0 graphql_server/webob/graphqlview.py
  32. +1 −7 setup.cfg
  33. +64 −27 setup.py
  34. +1 −1 tests/__init__.py
  35. +1 −0 tests/aiohttp/__init__.py
  36. +18 −0 tests/aiohttp/app.py
  37. +18 −0 tests/aiohttp/conftest.py
  38. +118 −0 tests/aiohttp/schema.py
  39. +139 −0 tests/aiohttp/test_graphiqlview.py
  40. +702 −0 tests/aiohttp/test_graphqlview.py
  41. +0 −4 tests/conftest.py
  42. 0 tests/flask/__init__.py
  43. +18 −0 tests/flask/app.py
  44. +19 −0 tests/flask/conftest.py
  45. +54 −0 tests/flask/schema.py
  46. +63 −0 tests/flask/test_graphiqlview.py
  47. +606 −0 tests/flask/test_graphqlview.py
  48. 0 tests/quart/__init__.py
  49. +18 −0 tests/quart/app.py
  50. +23 −0 tests/quart/conftest.py
  51. +102 −0 tests/quart/schema.py
  52. +87 −0 tests/quart/test_graphiqlview.py
  53. +772 −0 tests/quart/test_graphqlview.py
  54. 0 tests/sanic/__init__.py
  55. +21 −0 tests/sanic/app.py
  56. +8 −0 tests/sanic/conftest.py
  57. +102 −0 tests/sanic/schema.py
  58. +91 −0 tests/sanic/test_graphiqlview.py
  59. +622 −0 tests/sanic/test_graphqlview.py
  60. +13 −20 tests/schema.py
  61. +15 −41 tests/test_asyncio.py
  62. +25 −19 tests/test_error.py
  63. +14 −115 tests/test_helpers.py
  64. +276 −248 tests/test_query.py
  65. +50 −0 tests/test_version.py
  66. +22 −2 tests/utils.py
  67. 0 tests/webob/__init__.py
  68. +42 −0 tests/webob/app.py
  69. +13 −0 tests/webob/conftest.py
  70. +55 −0 tests/webob/schema.py
  71. +36 −0 tests/webob/test_graphiqlview.py
  72. +587 −0 tests/webob/test_graphqlview.py
  73. +18 −27 tox.ini
26 changes: 26 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: 🚀 Deploy to PyPI

on:
push:
tags:
- 'v*'

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Build wheel and source tarball
run: |
pip install wheel
python setup.py sdist
- name: Publish a Python distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.pypi_password }}
22 changes: 22 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Lint

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox
- name: Run lint and static type checks
run: tox
env:
TOXENV: pre-commit,mypy
50 changes: 50 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Tests

on: [push, pull_request]

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
max-parallel: 4
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
os: [ubuntu-latest, windows-latest]
exclude:
- os: windows-latest
python-version: "3.8"
- os: windows-latest
python-version: "3.9"
- os: windows-latest
python-version: "3.11"

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox tox-gh-actions
- name: Test with tox
run: tox

coverage:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Install test dependencies
run: |
python -m pip install --upgrade pip
pip install .[test]
- name: Test with coverage
run: pytest --cov=graphql_server --cov-report=xml tests
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
212 changes: 200 additions & 12 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,19 +1,207 @@
*.pyc
*.pyo

# Created by https://www.gitignore.io/api/python,intellij+all,visualstudiocode
# Edit at https://www.gitignore.io/?templates=python,intellij+all,visualstudiocode

### Intellij+all ###
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839

# User-specific stuff
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf

# Generated files
.idea/**/contentModel.xml

# Sensitive or high-churn files
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml

# Gradle
.idea/**/gradle.xml
.idea/**/libraries

# Gradle and Maven with auto-import
# When using Gradle or Maven with auto-import, you should exclude module files,
# since they will be recreated, and may cause churn. Uncomment if using
# auto-import.
# .idea/modules.xml
# .idea/*.iml
# .idea/modules
# *.iml
# *.ipr

# CMake
cmake-build-*/

# Mongo Explorer plugin
.idea/**/mongoSettings.xml

# File-based project format
*.iws

# IntelliJ
out/

# mpeltonen/sbt-idea plugin
.idea_modules/

# JIRA plugin
atlassian-ide-plugin.xml

# Cursive Clojure plugin
.idea/replstate.xml

# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties

# Editor-based Rest Client
.idea/httpRequests

# Android studio 3.1+ serialized cache file
.idea/caches/build_file_checksums.ser

### Intellij+all Patch ###
# Ignores the whole .idea folder and all .iml files
# See https://github.com/joeblau/gitignore.io/issues/186 and https://github.com/joeblau/gitignore.io/issues/360

.idea/

# Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-249601023

*.iml
modules.xml
.idea/misc.xml
*.ipr

# Sonarlint plugin
.idea/sonarlint

### Python ###
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
*.egg-info
MANIFEST

.cache
# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.venv/
.coverage
.idea
.mypy_cache
.pytest_cache
.tox
.venv
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# pyenv
.python-version

# Pycharm venv
venv/

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# celery beat schedule file
celerybeat-schedule

# SageMath parsed files
*.sage.py

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# Mr Developer
.mr.developer.cfg
.project
.pydevproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

### VisualStudioCode ###
.vscode

/build/
/dist/
### VisualStudioCode Patch ###
# Ignore all local history of files
.history

docs
# End of https://www.gitignore.io/api/python,intellij+all,visualstudiocode
27 changes: 27 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
default_language_version:
python: python3.11
exclude: LICENSE
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: check-merge-conflict
- id: check-json
- id: check-yaml
- id: debug-statements
- id: end-of-file-fixer
exclude: ^docs/.*$
- id: pretty-format-json
args:
- --autofix
- id: trailing-whitespace
- repo: https://github.com/mgedmin/check-manifest
rev: "0.49"
hooks:
- id: check-manifest
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.2
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix, --show-fixes]
- id: ruff-format
34 changes: 34 additions & 0 deletions .ruff.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
select = [
"E", # pycodestyle
"W", # pycodestyle
"F", # pyflake
"I", # isort
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"UP", # pyupgrade
]

ignore = [
"E501", # line-too-long
"B904", # check for raise statements in exception handlers that lack a from clause
]

exclude = [
"**/docs",
]

target-version = "py38"

[per-file-ignores]
# Ignore unused imports (F401) in these files
"__init__.py" = ["F401"]

[isort]
known-first-party = ["graphql_server"]
combine-as-imports = true

[pyupgrade]
# this keeps annotation syntaxes like Union[X, Y] instead of X | Y
# to not break Python 3.8
# https://beta.ruff.rs/docs/settings/#pyupgrade-keep-runtime-typing
keep-runtime-typing = true
Loading