diff --git a/.mypy.ini b/.mypy.ini index 07fe9d7..a396b02 100644 --- a/.mypy.ini +++ b/.mypy.ini @@ -5,7 +5,7 @@ error_summary = true files = packaging/, tests/, - propcache/ + src/propcache/ # check_untyped_defs = true diff --git a/Makefile b/Makefile index 27e2121..a2d5360 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -PYXS = $(wildcard propcache/*.pyx) +PYXS = $(wildcard src/propcache/*.pyx) SRC = propcache tests all: test @@ -15,8 +15,8 @@ all: test touch .install-cython -propcache/%.c: propcache/%.pyx - python -m cython -3 -o $@ $< -I propcache +src/propcache/%.c: src/propcache/%.pyx + python -m cython -3 -o $@ $< -I src/propcache .cythonize: .install-cython $(PYXS:.pyx=.c) @@ -25,7 +25,7 @@ propcache/%.c: propcache/%.pyx cythonize: .cythonize -.develop: .install-deps $(shell find propcache -type f) +.develop: .install-deps $(shell find src/propcache -type f) @pip install -e . @touch .develop @@ -39,15 +39,15 @@ endif lint: fmt test: lint .develop - pytest ./tests ./propcache + pytest ./tests ./src/propcache vtest: lint .develop - pytest ./tests ./propcache -v + pytest ./tests ./src/propcache -v cov: lint .develop - pytest --cov propcache --cov-report html --cov-report term ./tests/ ./propcache/ + pytest --cov src/propcache --cov-report html --cov-report term ./tests/ ./src/propcache/ @echo "open file://`pwd`/htmlcov/index.html" diff --git a/docs/conf.py b/docs/conf.py index 841b42a..7e007ce 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -40,8 +40,7 @@ _docs_path = Path(__file__).parent -_version_path = _docs_path / "../propcache/__init__.py" - +_version_path = _docs_path / "../src/propcache/__init__.py" with _version_path.open() as fp: try: diff --git a/pyproject.toml b/pyproject.toml index a1ba466..b09b2ad 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,7 +12,7 @@ build-backend = "pep517_backend.hooks" # wraps `setuptools.build_meta` [tool.local.cythonize] # This attr can contain multiple globs -src = ["propcache/*.pyx"] +src = ["src/propcache/*.pyx"] [tool.local.cythonize.env] # Env vars provisioned during cythonize call diff --git a/pytest.ini b/pytest.ini index dc242af..4473470 100644 --- a/pytest.ini +++ b/pytest.ini @@ -85,4 +85,6 @@ norecursedirs = testpaths = tests/ +pythonpath = src + xfail_strict = true diff --git a/setup.cfg b/setup.cfg index acc06dc..85295f6 100644 --- a/setup.cfg +++ b/setup.cfg @@ -57,10 +57,11 @@ python_requires = >=3.8 # Ref: # https://setuptools.pypa.io/en/latest/userguide/declarative_config.html#using-a-src-layout # (`src/` layout) -# package_dir = -# = src +package_dir = + =src packages = propcache + # https://setuptools.pypa.io/en/latest/deprecated/zip_safe.html zip_safe = False include_package_data = True diff --git a/propcache/__init__.py b/src/propcache/__init__.py similarity index 100% rename from propcache/__init__.py rename to src/propcache/__init__.py diff --git a/propcache/_helpers.py b/src/propcache/_helpers.py similarity index 100% rename from propcache/_helpers.py rename to src/propcache/_helpers.py diff --git a/propcache/_helpers_c.pyx b/src/propcache/_helpers_c.pyx similarity index 100% rename from propcache/_helpers_c.pyx rename to src/propcache/_helpers_c.pyx diff --git a/propcache/_helpers_py.py b/src/propcache/_helpers_py.py similarity index 100% rename from propcache/_helpers_py.py rename to src/propcache/_helpers_py.py diff --git a/propcache/api.py b/src/propcache/api.py similarity index 100% rename from propcache/api.py rename to src/propcache/api.py diff --git a/propcache/py.typed b/src/propcache/py.typed similarity index 100% rename from propcache/py.typed rename to src/propcache/py.typed