Skip to content

Commit d09d7f7

Browse files
authored
Merge pull request #4 from loft-orbital/users/thomas/update-for-v3
feat!: make graphene-federation compatible with graphene v3
2 parents e3f14d7 + aba1c77 commit d09d7f7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+10429
-4485
lines changed

.github/workflows/lint.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,16 @@ jobs:
77
runs-on: ubuntu-latest
88

99
steps:
10-
- uses: actions/checkout@v1
11-
- name: Set up Python 3.8
12-
uses: actions/setup-python@v1
10+
- uses: actions/checkout@v3
11+
- name: Set up Python 3.10
12+
uses: actions/setup-python@v4
1313
with:
14-
python-version: 3.8
14+
python-version: 3.10.5
1515
- name: Install dependencies
1616
run: |
1717
python -m pip install --upgrade pip
1818
pip install -e ".[dev]"
1919
- name: Run lint 💅
20-
run: black graphene_federation --check
20+
run: |
21+
black graphene_federation --check
22+
mypy graphene_federation

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
strategy:
99
max-parallel: 4
1010
matrix:
11-
python-version: ["3.6", "3.7", "3.8"]
11+
python-version: ["3.9", "3.10"]
1212

1313
steps:
1414
- uses: actions/checkout@v1

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
.DS_Store
2+
13
# Byte-compiled / optimized / DLL files
24
__pycache__/
35
*.py[cod]
@@ -104,4 +106,4 @@ venv.bak/
104106
.mypy_cache/
105107

106108
.idea
107-
node_modules
109+
node_modules

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM python:3.8-slim
1+
FROM python:3.10-alpine
22

33
# Disable Python buffering in order to see the logs immediatly
44
ENV PYTHONUNBUFFERED=1

Makefile

Lines changed: 31 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,45 @@
22
# Integration testing
33
# -------------------------
44

5-
.PHONY: integration-build ## Build environment for integration tests
6-
integration-build:
5+
integration-build: ## Build environment for integration tests
76
cd integration_tests && docker-compose build
7+
.PHONY: integration-build
88

9-
.PHONY: integration-test ## Run integration tests
10-
integration-test:
9+
integration-tests: ## Run integration tests
1110
cd integration_tests && docker-compose down && docker-compose run --rm tests
11+
.PHONY: integration-test
1212

1313
# -------------------------
1414
# Development and unit testing
1515
# -------------------------
1616

17-
.PHONY: dev-setup ## Install development dependencies
18-
dev-setup:
17+
dev-setup: ## Install development dependencies
1918
docker-compose up -d && docker-compose exec graphene_federation bash
19+
.PHONY: dev-setup
2020

21-
.PHONY: tests ## Run unit tests
22-
tests:
21+
tests: ## Run unit tests
2322
docker-compose run graphene_federation py.test graphene_federation --cov=graphene_federation -vv
23+
.PHONY: tests
24+
25+
check-style: ## Run linting
26+
docker-compose run graphene_federation black graphene_federation --check
27+
.PHONY: check-style
28+
29+
check-types: ## Run typing check
30+
docker-compose run graphene_federation mypy graphene_federation
31+
.PHONY: check-types
32+
33+
# -------------------------
34+
# Help
35+
# -------------------------
36+
37+
help: ## Show help
38+
@grep -E '^[0-9a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
39+
.PHONY: help
40+
41+
.DEFAULT_GOAL := help
42+
43+
.EXPORT_ALL_VARIABLES:
44+
DOCKER_BUILDKIT = 1
45+
COMPOSE_DOCKER_CLI_BUILD = 1
46+

Pipfile

Lines changed: 0 additions & 20 deletions
This file was deleted.

Pipfile.lock

Lines changed: 0 additions & 218 deletions
This file was deleted.

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ Federation support for ![Graphene Logo](http://graphene-python.org/favicon.png)
1616

1717
Based on discussion: https://github.com/graphql-python/graphene/issues/953#issuecomment-508481652
1818

19+
WARNING: This version is not compatible with graphene version below v3. If you need to use a version compatible with graphene v2 I recommend using the version 1.0.0 of graphene_federation.
20+
1921
------------------------
2022

2123
## Supported Features
@@ -180,4 +182,5 @@ The tests are automatically run on Travis CI on push to GitHub.
180182

181183
---------------------------
182184

183-
Also, you can read about how we've come to federation at Preply [here](https://medium.com/preply-engineering/apollo-federation-support-in-graphene-761a0512456d)
185+
This repository is heavily inspired by the repo it was forked from... Huge thanks to [Preply for setting up the foundations](https://medium.com/preply-engineering/apollo-federation-support-in-graphene-761a0512456d).
186+
Hopefully one day we can merge it into the original repository that doesn't seem maintained anymore.

docker-compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ version: '3.5'
33
services:
44

55
graphene_federation:
6+
container_name: graphene_federation
67
build:
78
context: .
89
volumes:

0 commit comments

Comments
 (0)