Skip to content

Commit 08b2957

Browse files
committed
Use src layout to make sure we test the right thing
see https://docs.pytest.org/en/latest/goodpractices.html and https://hynek.me/articles/testing-packaging/ Also, make tox a Poetry dev dependency again. tox can in fact be used from inside the virtual env.
1 parent d7fa650 commit 08b2957

File tree

123 files changed

+51
-12
lines changed

Some content is hidden

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

123 files changed

+51
-12
lines changed

.bumpversion.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ current_version = 1.1.0b0
33
commit = False
44
tag = False
55

6-
[bumpversion:file:graphql/version.py]
6+
[bumpversion:file:src/graphql/version.py]
77
search = __version__ = "{current_version}"
88
replace = __version__ = "{new_version}"
99

.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
@@ -16,7 +16,7 @@ include tox.ini
1616
include poetry.lock
1717
include pyproject.toml
1818

19-
graft graphql
19+
graft src/graphql
2020
graft tests
2121
recursive-include docs *.rst conf.py Makefile make.bat *.jpg *.png *.gif
2222
prune docs/_build

poetry.lock

Lines changed: 38 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
@@ -22,7 +22,7 @@ classifiers = [
2222
"Programming Language :: Python :: 3.7"
2323
]
2424
packages = [
25-
{ include = "graphql" },
25+
{ include = "graphql", from = "src" },
2626
]
2727

2828
[tool.poetry.dependencies]
@@ -42,6 +42,7 @@ sphinx = "^2.1"
4242
sphinx_rtd_theme = ">=0.4"
4343
check-manifest = ">=0.39"
4444
bump2version = ">=0.5"
45+
tox = "^3.13"
4546

4647
[tool.black]
4748
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/version.py") as version_file:
4+
with open("src/graphql/version.py") as version_file:
55
version = search('version = "(.*)"', version_file.read()).group(1)
66

77
with open("README.md") as readme_file:
@@ -29,8 +29,9 @@
2929
"Programming Language :: Python :: 3.7",
3030
],
3131
install_requires=[],
32-
python_requires=">=3.6",
33-
packages=find_packages(include=["graphql"]),
32+
python_requires=">=3.6,<4",
33+
packages=find_packages("src"),
34+
package_dir={"": "src"},
3435
# PEP-561: https://www.python.org/dev/peps/pep-0561/
3536
package_data={"graphql": ["py.typed"]},
3637
include_package_data=True,
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)