Skip to content

Commit

Permalink
Introduce src directory (#71)
Browse files Browse the repository at this point in the history
  • Loading branch information
antonagestam authored Oct 14, 2021
1 parent 4158027 commit 3809a5e
Show file tree
Hide file tree
Showing 46 changed files with 22 additions and 8 deletions.
4 changes: 2 additions & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
include setup.py README.rst MANIFEST.in LICENSE AUTHORS

recursive-include bananas/templates *
recursive-include bananas/static *
recursive-include src/bananas/templates *
recursive-include src/bananas/static *

global-exclude *~
9 changes: 6 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ test_all:

.PHONY: test-types # runs pytest-mypy-plugins to test exported types
test-types:
# Hack to make type-tests work until we add py.typed to the published package.
touch $$(python -c 'import bananas; print(bananas.__path__[0] + "/py.typed")')
pytest --mypy-ini-file=setup.cfg tests/*.yaml
rm $$(python -c 'import bananas; print(bananas.__path__[0] + "/py.typed")')

.PHONY: coverage # combines coverage and reports it
coverage:
Expand All @@ -28,9 +31,9 @@ coverage-xml:

.PHONY: lint # runs flake8, black and isort checks
lint:
@flake8 bananas tests && echo "flake8 OK"
black --check bananas tests
isort --check bananas tests
@flake8 src tests && echo "flake8 OK"
black --check src tests
isort --check src tests

.PHONY: type-check
type-check:
Expand Down
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["setuptools>=57.0.0", "wheel"]
build-backend = "setuptools.build_meta"
10 changes: 8 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ license_file = LICENSE

[options]
packages = find:
package_dir =
=src
python_requires = >=3.6
include_package_data = True
exclude =
Expand All @@ -35,6 +37,9 @@ install_requires =
typing-extensions>=3.7.4.3
drf-yasg>=1.20.0

[options.packages.find]
where = src

[options.extras_require]
drf =
djangorestframework>=3.10
Expand Down Expand Up @@ -65,7 +70,7 @@ show-source = true
max-complexity = 10

[coverage:run]
source = bananas
source = src
branch = True
parallel = True

Expand All @@ -90,12 +95,13 @@ combine_as_imports = true
include_trailing_comma = true
force_grid_wrap = 0
skip = migrations
src_paths = src, tests

[mypy]
python_version = 3.6
show_error_codes = True
pretty = True
files = bananas,tests,runtests.py,setup.py
files = src,tests,runtests.py,setup.py

no_implicit_reexport = True
no_implicit_optional = True
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 3 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,15 @@ envlist = py36-django{ 22, 30, 32 },
py38-django{ 22, 30, 31, 32, 40 },
py39-django{ 22, 30, 31, 32, 40 }
py310-django{ 32, 40 }
isolated_build = true


[testenv]
passenv = COVERAGE_FILE
whitelist_externals = make
usedevelop = true
commands =
make test
make test {posargs}
install_command =
pip install {opts} {packages}
extras =
Expand Down

0 comments on commit 3809a5e

Please sign in to comment.