Skip to content

Commit

Permalink
Merge branch 'main' into fix-m2m-filter-type
Browse files Browse the repository at this point in the history
  • Loading branch information
weilu authored Dec 19, 2024
2 parents c2901d6 + 2692250 commit f9eabcc
Show file tree
Hide file tree
Showing 103 changed files with 3,026 additions and 785 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,13 @@ on:
- 'v*'

jobs:
build:
lint:
uses: ./.github/workflows/lint.yml
tests:
uses: ./.github/workflows/tests.yml
release:
runs-on: ubuntu-latest
needs: [lint, tests]

steps:
- uses: actions/checkout@v3
Expand All @@ -20,7 +25,7 @@ jobs:
pip install wheel
python setup.py sdist bdist_wheel
- name: Publish a Python distribution to PyPI
uses: pypa/gh-action-pypi-publish@v1.8.6
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.pypi_password }}
6 changes: 5 additions & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: Lint

on: [push, pull_request]
on:
push:
branches: ["main"]
pull_request:
workflow_call:

jobs:
build:
Expand Down
21 changes: 14 additions & 7 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,28 @@
name: Tests

on: [push, pull_request]
on:
push:
branches: ["main"]
pull_request:
workflow_call:

jobs:
build:
runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
django: ["3.2", "4.0", "4.1"]
python-version: ["3.8", "3.9", "3.10"]
include:
django: ["3.2", "4.2", "5.0"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
exclude:
- django: "3.2"
python-version: "3.7"
- django: "4.1"
python-version: "3.11"
- django: "3.2"
python-version: "3.12"
- django: "5.0"
python-version: "3.8"
- django: "5.0"
python-version: "3.9"
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
Expand All @@ -29,4 +37,3 @@ jobs:
run: tox
env:
DJANGO: ${{ matrix.django }}
TOXENV: ${{ matrix.toxenv }}
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ __pycache__/
# Distribution / packaging
.Python
env/
.env/
venv/
.venv/
build/
develop-eggs/
dist/
Expand Down Expand Up @@ -80,3 +83,8 @@ Session.vim
tags
.tox/
.pytest_cache/

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
.python-version
19 changes: 6 additions & 13 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ default_language_version:
python: python3.11
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.5.0
hooks:
- id: check-merge-conflict
- id: check-json
Expand All @@ -15,16 +15,9 @@ repos:
- --autofix
- id: trailing-whitespace
exclude: README.md
- repo: https://github.com/asottile/pyupgrade
rev: v3.3.2
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.2
hooks:
- id: pyupgrade
args: [--py37-plus]
- repo: https://github.com/psf/black
rev: 23.3.0
hooks:
- id: black
- repo: https://github.com/PyCQA/flake8
rev: 6.0.0
hooks:
- id: flake8
- id: ruff
args: [--fix, --exit-non-zero-on-fix, --show-fixes]
- id: ruff-format
18 changes: 18 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# .readthedocs.yaml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

version: 2
build:
os: ubuntu-22.04
tools:
python: "3.12"

# Build documentation in the "docs/" directory with Sphinx
sphinx:
configuration: docs/conf.py

# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
python:
install:
- requirements: docs/requirements.txt
33 changes: 33 additions & 0 deletions .ruff.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
select = [
"E", # pycodestyle
"W", # pycodestyle
"F", # pyflake
"I", # isort
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"UP", # pyupgrade
]

ignore = [
"E501", # line-too-long
"B017", # pytest.raises(Exception) should be considered evil
"B028", # warnings.warn called without an explicit stacklevel keyword argument
"B904", # check for raise statements in exception handlers that lack a from clause
"W191", # https://docs.astral.sh/ruff/formatter/#conflicting-lint-rules
]

exclude = [
"**/docs",
]

target-version = "py38"

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

[isort]
known-first-party = ["graphene", "graphene-django"]
known-local-folder = ["cookbook"]
combine-as-imports = true
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ make tests

## Opening Pull Requests

Please fork the project and open a pull request against the master branch.
Please fork the project and open a pull request against the `main` branch.

This will trigger a series of test and lint checks.

Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ dev-setup:

.PHONY: tests ## Run unit tests
tests:
py.test graphene_django --cov=graphene_django -vv
PYTHONPATH=. pytest graphene_django --cov=graphene_django -vv

.PHONY: format ## Format code
format:
black graphene_django examples setup.py
ruff format graphene_django examples setup.py

.PHONY: lint ## Lint code
lint:
flake8 graphene_django examples
ruff graphene_django examples

.PHONY: docs ## Generate docs
docs: dev-setup
Expand Down
Loading

0 comments on commit f9eabcc

Please sign in to comment.