Skip to content

Commit ec1c7af

Browse files
Merge branch 'graphql-python:master' into master
2 parents b9a1f24 + 807ae70 commit ec1c7af

File tree

7 files changed

+129
-89
lines changed

7 files changed

+129
-89
lines changed

.github/workflows/ci.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# This workflow will install Python dependencies, run tests and lint with a single version of Python
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
3+
4+
name: Test Package
5+
6+
on:
7+
push:
8+
branches: [ "master" ]
9+
pull_request:
10+
branches: [ "master" ]
11+
12+
permissions:
13+
contents: read
14+
15+
jobs:
16+
build:
17+
strategy:
18+
matrix:
19+
os: [ubuntu-latest, macos-latest, windows-latest]
20+
python: ["3.7", "3.8", "3.9", "3.10", "3.11"]
21+
runs-on: ${{ matrix.os }}
22+
steps:
23+
- uses: actions/checkout@v3
24+
- name: Set up Python ${{ matrix.python }}
25+
uses: actions/setup-python@v3
26+
with:
27+
python-version: ${{ matrix.python }}
28+
- name: Lint with flake8
29+
run: |
30+
python -m pip install flake8
31+
make lint
32+
- name: Install dependencies
33+
run: |
34+
python -m pip install poetry
35+
poetry config virtualenvs.create false
36+
poetry install --with dev
37+
- name: Run Tests
38+
run: make test
39+
- name: Build Package
40+
run: |
41+
poetry build

.github/workflows/lint.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# This workflow will install Python dependencies, run tests and lint with a single version of Python
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
3+
4+
name: Lint
5+
6+
on: [push, pull_request]
7+
permissions:
8+
contents: read
9+
10+
jobs:
11+
build:
12+
strategy:
13+
matrix:
14+
python: ["3.11"]
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v3
18+
- name: Set up Python
19+
uses: actions/setup-python@v3
20+
with:
21+
python-version: ${{ matrix.python }}
22+
- name: Install dependencies
23+
run: |
24+
python -m pip install --upgrade pip
25+
pip install flake8
26+
- name: Lint with flake8
27+
run: make lint

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ clean:
1111
@find . -name "__pycache__" -delete
1212

1313
lint:
14-
@flake8 graphene_mongo
14+
@flake8 graphene_mongo --count --show-source --statistics
1515

16-
test: clean lint
16+
test: clean
1717
pytest graphene_mongo/tests --cov=graphene_mongo --cov-report=html --cov-report=term
1818

1919
register-pypitest:

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
[![Build Status](https://travis-ci.org/graphql-python/graphene-mongo.svg?branch=master)](https://travis-ci.org/graphql-python/graphene-mongo) [![Coverage Status](https://coveralls.io/repos/github/graphql-python/graphene-mongo/badge.svg?branch=master)](https://coveralls.io/github/graphql-python/graphene-mongo?branch=master) [![Documentation Status](https://readthedocs.org/projects/graphene-mongo/badge/?version=latest)](http://graphene-mongo.readthedocs.io/en/latest/?badge=latest) [![PyPI version](https://badge.fury.io/py/graphene-mongo.svg)](https://badge.fury.io/py/graphene-mongo) [![PyPI pyversions](https://img.shields.io/pypi/pyversions/graphene-mongo.svg)](https://pypi.python.org/pypi/graphene-mongo/) [![Downloads](https://pepy.tech/badge/graphene-mongo)](https://pepy.tech/project/graphene-mongo)
22

3+
[![Lint](https://github.com/graphql-python/graphene-mongo/actions/workflows/lint.yml/badge.svg?branch=master)](https://github.com/graphql-python/graphene-mongo/actions/workflows/lint.yml) [![Test Package](https://github.com/graphql-python/graphene-mongo/actions/workflows/ci.yml/badge.svg)](https://github.com/graphql-python/graphene-mongo/actions/workflows/ci.yml)
4+
35
# Graphene-Mongo
46

57
A [Mongoengine](https://mongoengine-odm.readthedocs.io/) integration for [Graphene](http://graphene-python.org/).

graphene_mongo/fields.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ def default_resolver(self, _root, info, required_fields=None, resolved=None, **a
400400
args_copy[key] = args_copy[key].value
401401

402402
if PYMONGO_VERSION >= (3, 7):
403-
if hasattr(self.model,'_meta') and 'db_alias' in self.model._meta:
403+
if hasattr(self.model, '_meta') and 'db_alias' in self.model._meta:
404404
count = (mongoengine.get_db(self.model._meta['db_alias'])[self.model._get_collection_name()]).count_documents(args_copy)
405405
else:
406406
count = (mongoengine.get_db()[self.model._get_collection_name()]).count_documents(args_copy)

0 commit comments

Comments
 (0)