Skip to content

Commit 8341c43

Browse files
authored
Convert project to use a src layout (#22)
1 parent f35d343 commit 8341c43

File tree

14 files changed

+18
-13
lines changed

14 files changed

+18
-13
lines changed

.mypy.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ error_summary = true
55
files =
66
packaging/,
77
tests/,
8-
propcache/
8+
src/propcache/
99

1010
# check_untyped_defs = true
1111

CHANGES/22.packaging.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Converted project to use a src layout -- by :user:`bdraco`.

Makefile

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
PYXS = $(wildcard propcache/*.pyx)
1+
PYXS = $(wildcard src/propcache/*.pyx)
22
SRC = propcache tests
33

44
all: test
@@ -15,8 +15,8 @@ all: test
1515
touch .install-cython
1616

1717

18-
propcache/%.c: propcache/%.pyx
19-
python -m cython -3 -o $@ $< -I propcache
18+
src/propcache/%.c: src/propcache/%.pyx
19+
python -m cython -3 -o $@ $< -I src/propcache
2020

2121

2222
.cythonize: .install-cython $(PYXS:.pyx=.c)
@@ -25,7 +25,7 @@ propcache/%.c: propcache/%.pyx
2525
cythonize: .cythonize
2626

2727

28-
.develop: .install-deps $(shell find propcache -type f)
28+
.develop: .install-deps $(shell find src/propcache -type f)
2929
@pip install -e .
3030
@touch .develop
3131

@@ -39,15 +39,15 @@ endif
3939
lint: fmt
4040

4141
test: lint .develop
42-
pytest ./tests ./propcache
42+
pytest ./tests
4343

4444

4545
vtest: lint .develop
46-
pytest ./tests ./propcache -v
46+
pytest -v ./tests
4747

4848

4949
cov: lint .develop
50-
pytest --cov propcache --cov-report html --cov-report term ./tests/ ./propcache/
50+
pytest --cov src/propcache --cov-report html --cov-report term ./tests
5151
@echo "open file://`pwd`/htmlcov/index.html"
5252

5353

docs/conf.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,7 @@
4040

4141

4242
_docs_path = Path(__file__).parent
43-
_version_path = _docs_path / "../propcache/__init__.py"
44-
43+
_version_path = _docs_path / "../src/propcache/__init__.py"
4544

4645
with _version_path.open() as fp:
4746
try:

docs/spelling_wordlist.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ requote
4242
requoting
4343
runtimes
4444
sdist
45+
src
4546
subclass
4647
subclasses
4748
subcomponent

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ build-backend = "pep517_backend.hooks" # wraps `setuptools.build_meta`
1212

1313
[tool.local.cythonize]
1414
# This attr can contain multiple globs
15-
src = ["propcache/*.pyx"]
15+
src = ["src/propcache/*.pyx"]
1616

1717
[tool.local.cythonize.env]
1818
# Env vars provisioned during cythonize call

pytest.ini

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,4 +85,6 @@ norecursedirs =
8585

8686
testpaths = tests/
8787

88+
pythonpath = src
89+
8890
xfail_strict = true

setup.cfg

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,11 @@ python_requires = >=3.8
5757
# Ref:
5858
# https://setuptools.pypa.io/en/latest/userguide/declarative_config.html#using-a-src-layout
5959
# (`src/` layout)
60-
# package_dir =
61-
# = src
60+
package_dir =
61+
=src
6262
packages =
6363
propcache
64+
6465
# https://setuptools.pypa.io/en/latest/deprecated/zip_safe.html
6566
zip_safe = False
6667
include_package_data = True
@@ -71,6 +72,7 @@ include_package_data = True
7172
# (see notes for the asterisk/`*` meaning)
7273
* =
7374
*.so
75+
*.pyx
7476

7577
[options.exclude_package_data]
7678
* =
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)