Skip to content

Commit e717afe

Browse files
committed
Initial v3 version
This version is not yet fully working (one small test to go). This is mostly based on the hard work
1 parent 536721c commit e717afe

File tree

220 files changed

+22727
-7712
lines changed

Some content is hidden

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

220 files changed

+22727
-7712
lines changed

.github/workflows/deploy.yml

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

.github/workflows/lint.yml

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

.github/workflows/tests.yml

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

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm
77
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
88

9+
.DS_Store
10+
911
# User-specific stuff
1012
.idea/**/workspace.xml
1113
.idea/**/tasks.xml

.pre-commit-config.yaml

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

.ruff.toml

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

CONTRIBUTING.md

Lines changed: 121 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,89 +1,159 @@
1-
# Contributing
1+
# Contributing to `graphql-server`
22

3-
Thanks for helping to make graphql-server awesome!
3+
First off, thanks for taking the time to contribute!
44

5-
We welcome all kinds of contributions:
5+
The following is a set of guidelines for contributing to `graphql-server` on GitHub.
6+
These are mostly guidelines, not rules. Use your best judgment, and feel free
7+
to propose changes to this document in a pull request.
68

7-
- Bug fixes
8-
- Documentation improvements
9-
- New features
10-
- Refactoring & tidying
9+
#### Table of contents
1110

11+
[How to contribute](#how-to-contribute)
1212

13-
## Getting started
13+
- [Reporting bugs](#reporting-bugs)
14+
- [Suggesting enhancements](#suggesting-enhancements)
15+
- [Contributing to code](#contributing-to-code)
1416

15-
If you have a specific contribution in mind, be sure to check the [issues](https://github.com/graphql-python/graphql-server/issues) and [pull requests](https://github.com/graphql-python/graphql-server/pulls) in progress - someone could already be working on something similar and you can help out.
17+
## How to contribute
1618

19+
### Reporting bugs
1720

18-
## Project setup
21+
This section guides you through submitting a bug report for `graphql-server`.
22+
Following these guidelines helps maintainers and the community understand your report, reproduce the behavior, and find related reports.
1923

20-
### Development with virtualenv (recommended)
24+
Before creating bug reports, please check
25+
[this list](#before-submitting-a-bug-report) to be sure that you need to create
26+
one. When you are creating a bug report, please include as many details as
27+
possible. Make sure you include the Python and `graphql-server` versions.
2128

22-
After cloning this repo, create a virtualenv:
29+
> **Note:** If you find a **Closed** issue that seems like it is the same thing
30+
> that you're experiencing, open a new issue and include a link to the original
31+
> issue in the body of your new one.
2332
24-
```console
25-
virtualenv graphql-server-dev
26-
```
33+
#### Before submitting a bug report
2734

28-
Activate the virtualenv and install dependencies by running:
35+
- Check that your issue does not already exist in the issue tracker on GitHub.
2936

30-
```console
31-
python pip install -e ".[test]"
32-
```
37+
#### How do I submit a bug report?
3338

34-
If you are using Linux or MacOS, you can make use of Makefile command `make dev-setup`, which is a shortcut for the above python command.
39+
Bugs are tracked on the issue tracker on GitHub where you can create a new one.
3540

36-
### Development on Conda
41+
Explain the problem and include additional details to help maintainers reproduce
42+
the problem:
3743

38-
You must create a new env (e.g. `graphql-sc-dev`) with the following command:
44+
- **Use a clear and descriptive title** for the issue to identify the problem.
45+
- **Describe the exact steps which reproduce the problem** in as many details as
46+
possible.
47+
- **Provide specific examples to demonstrate the steps to reproduce the issue**.
48+
Include links to files or GitHub projects, or copy-paste-able snippets, which you use in those examples.
49+
- **Describe the behavior you observed after following the steps** and point out
50+
what exactly is the problem with that behavior.
51+
- **Explain which behavior you expected to see instead and why.**
3952

40-
```sh
41-
conda create -n graphql-sc-dev python=3.8
42-
```
53+
Provide more context by answering these questions:
4354

44-
Then activate the environment with `conda activate graphql-sc-dev`.
55+
- **Did the problem start happening recently** (e.g. after updating to a new version of `graphql-server`) or was this always a problem?
56+
- If the problem started happening recently, **can you reproduce the problem in
57+
an older version of `graphql-server`?** What's the most recent version in which the problem doesn't happen?
58+
- **Can you reliably reproduce the issue?** If not, provide details about how
59+
often the problem happens and under which conditions it normally happens.
4560

46-
Proceed to install all dependencies by running:
61+
Include details about your configuration and environment:
4762

48-
```console
49-
pip install -e ".[dev]"
50-
```
63+
- **Which version of `graphql-server` are you using?**
64+
- **Which Python version `graphql-server` has been installed for?**
65+
- **What's the name and version of the OS you're using?**
5166

52-
And you ready to start development!
67+
### Suggesting enhancements
5368

54-
## Running tests
69+
This section guides you through submitting an enhancement suggestion for
70+
`graphql-server`, including completely new features and minor improvements to existing
71+
functionality. Following these guidelines helps maintainers and the community
72+
understand your suggestion and find related suggestions.
5573

56-
After developing, the full test suite can be evaluated by running:
74+
Before creating enhancement suggestions, please check
75+
[this list](#before-submitting-an-enhancement-suggestion) as you might find out
76+
that you don't need to create one. When you are creating an enhancement
77+
suggestion, please
78+
[include as many details as possible](#how-do-i-submit-an-enhancement-suggestion).
5779

58-
```sh
59-
pytest tests --cov=graphql-server -vv
60-
```
80+
#### Before submitting an enhancement suggestion
81+
82+
- Check that your issue does not already exist in the issue tracker on GitHub.
6183

62-
If you are using Linux or MacOS, you can make use of Makefile command `make tests`, which is a shortcut for the above python command.
84+
#### How do I submit an enhancement suggestion?
6385

64-
You can also test on several python environments by using tox.
86+
Enhancement suggestions are tracked on the project's issue tracker on GitHub
87+
where you can create a new one and provide the following information:
6588

66-
### Running tox on virtualenv
89+
- **Use a clear and descriptive title** for the issue to identify the
90+
suggestion.
91+
- **Provide a step-by-step description of the suggested enhancement** in as many
92+
details as possible.
93+
- **Provide specific examples to demonstrate the steps**.
94+
- **Describe the current behavior** and **explain which behavior you expected to
95+
see instead** and why.
6796

68-
Install tox:
97+
### Contributing to code
6998

70-
```console
71-
pip install tox
99+
> This section is about contributing to
100+
[`graphql-server`](https://github.com/graphql-python/`graphql-server`).
101+
102+
#### Local development
103+
104+
You will need `uv` to start contributing to `graphql-server`. Refer to the
105+
[documentation](https://docs.astral.sh/uv/) to start using `uv`.
106+
107+
You will first need to clone the repository using `git` and place yourself in
108+
its directory:
109+
110+
```shell
111+
$ git clone [email protected]:graphql-python/`graphql-server`.git
112+
$ cd `graphql-server`
72113
```
73114

74-
Run `tox` on your virtualenv (do not forget to activate it!) and that's it!
115+
Now, you will need to install the required dependencies for ``graphql-server`` and be sure
116+
that the current tests are passing on your machine:
75117

76-
### Running tox on Conda
118+
```shell
119+
$ uv sync --group integrations
120+
```
77121

78-
In order to run `tox` command on conda, install
79-
[tox-conda](https://github.com/tox-dev/tox-conda):
122+
Some tests are known to be inconsistent. (The fix is in progress.) These tests are marked with the `pytest.mark.flaky` marker.
80123

81-
```sh
82-
conda install -c conda-forge tox-conda
124+
`graphql-server` uses the [black](https://github.com/ambv/black) coding style and you
125+
must ensure that your code follows it. If not, the CI will fail and your Pull Request will not be merged.
126+
127+
To make sure that you don't accidentally commit code that does not follow the
128+
coding style, you can install a pre-commit hook that will check that everything
129+
is in order:
130+
131+
```shell
132+
$ uv run pre-commit install
83133
```
84134

85-
This install tox underneath so no need to install it before.
135+
Your code must always be accompanied by corresponding tests. If tests are not
136+
present, your code will not be merged.
137+
138+
#### Pull requests
139+
140+
- Be sure that your pull request contains tests that cover the changed or added
141+
code.
142+
- If your changes warrant a documentation change, the pull request must also
143+
update the documentation.
144+
145+
##### RELEASE.md files
86146

87-
Then uncomment the `requires = tox-conda` line on `tox.ini` file.
147+
When you submit a PR, make sure to include a RELEASE.md file. We use that to automatically do releases here on GitHub and, most importantly, to PyPI!
148+
149+
So as soon as your PR is merged, a release will be made.
150+
151+
Here's an example of RELEASE.md:
152+
153+
```text
154+
Release type: patch
155+
156+
Description of the changes, ideally with some examples, if adding a new feature.
157+
```
88158

89-
Run `tox` and you will see all the environments being created and all passing tests. :rocket:
159+
Release type can be one of patch, minor or major. We use [semver](https://semver.org/), so make sure to pick the appropriate type. If in doubt feel free to ask :)

LICENSE

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
The MIT License (MIT)
1+
MIT License
22

3-
Copyright (c) 2017-Present Syrus Akbary
3+
Copyright (c) GraphQL Contributors (GraphQL.js)
4+
Copyright (c) 2018 Patrick Arminio (Strawberry)
5+
Copyright (c) Syrus Akbary (GraphQL Server)
46

57
Permission is hereby granted, free of charge, to any person obtaining a copy
68
of this software and associated documentation files (the "Software"), to deal

0 commit comments

Comments
 (0)