Skip to content

Commit e755ed2

Browse files
committed
Use src layout to make sure we test the right thing
1 parent 11a188c commit e755ed2

20 files changed

+73
-13
lines changed

.coveragerc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[run]
22
branch = True
3-
source = graphql
3+
source = src
44

55
[report]
66
exclude_lines =

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ install:
2323
- poetry install
2424

2525
script:
26-
- tox -e $TOXENV -- --cov-report term-missing --cov=graphql
26+
- tox -e $TOXENV -- --cov-report term-missing --cov=src
2727

2828
after_success:
2929
- codecov

MANIFEST.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ include tox.ini
1313
include poetry.lock
1414
include pyproject.toml
1515

16-
graft graphql_relay
16+
graft src/graphql_relay
1717
graft tests
1818
recursive-include docs *.rst conf.py Makefile make.bat *.jpg *.png *.gif
1919
prune docs/_build

README.md

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -245,11 +245,23 @@ You can then run the complete test suite like this:
245245
poetry run pytest
246246
```
247247

248-
Use [tox](https://tox.readthedocs.io/) to run the test suite with different
249-
Python versions and perform additional testing on the code base. You need
250-
to install and run tox separately, as it uses its own virtual environments.
248+
In order to run only a part of the tests with increased verbosity,
249+
you can add pytest options, like this:
250+
251+
```sh
252+
poetry run pytest tests/node -vv
253+
```
254+
255+
In order to check the code style with flake8, use this:
256+
257+
```sh
258+
poetry run flake8
259+
```
260+
261+
Use the `tox` command to run the test suite with different
262+
Python versions and perform all additional source code checks.
251263
You can also restrict tox to an individual environment, like this:
252264

253265
```sh
254-
tox -e py37
266+
petry run tox -e py37
255267
```

poetry.lock

Lines changed: 47 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ classifiers = [
2323
"Programming Language :: Python :: 3.7"
2424
]
2525
packages = [
26-
{ include = "graphql_relay" },
26+
{ include = "graphql_relay", from = "src" },
2727
]
2828

2929
[tool.poetry.dependencies]
@@ -39,6 +39,7 @@ black = ">=19.3b0"
3939
flake8 = "^3.7"
4040
codecov = "^2"
4141
check-manifest = ">=0.39"
42+
tox = "^3.13"
4243

4344
[tool.black]
4445
target-version = ['py36', 'py37', 'py38']

setup.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from re import search
22
from setuptools import setup, find_packages
33

4-
with open('graphql_relay/version.py') as version_file:
4+
with open('src/graphql_relay/version.py') as version_file:
55
version = search('version = "(.*)"', version_file.read()).group(1)
66

77
with open('README.md') as readme_file:
@@ -29,7 +29,8 @@
2929
'Programming Language :: Python :: Implementation :: PyPy',
3030
],
3131
install_requires=['graphql-core-next>=1.0.5'],
32-
python_requires='>=3.6',
33-
packages=find_packages(include=['graphql_relay']),
32+
python_requires='>=3.6,<4',
33+
packages=find_packages('src'),
34+
package_dir={'': 'src'},
3435
zip_safe=False,
3536
)
File renamed without changes.

0 commit comments

Comments
 (0)