Skip to content

Commit 0220f42

Browse files
authored
Use src-layout. (#600)
1 parent abb139b commit 0220f42

19 files changed

+11
-8
lines changed

.github/workflows/tests.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
PIP_DISABLE_PIP_VERSION_CHECK: 1
3030
run: |
3131
pip install -r requirements.txt
32-
python setup.py develop
32+
pip install .
3333
3434
- name: Run tests
3535
env:

Makefile

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.PHONY: build
22
build:
3-
python3 setup.py build_ext -if
3+
python setup.py build_ext -if
44

55
.PHONY: doc
66
doc:
@@ -10,12 +10,12 @@ doc:
1010

1111
.PHONY: clean
1212
clean:
13-
python3 setup.py clean
13+
python setup.py clean
1414
find . -name '*.pyc' -delete
1515
find . -name '__pycache__' -delete
1616
rm -rf build
1717

1818
.PHONY: check
1919
check:
2020
ruff .
21-
black *.py MySQLdb
21+
black *.py src

codecov.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
ignore:
2-
- "MySQLdb/constants/*"
2+
- "src/MySQLdb/constants/*"

pyproject.toml

+4-1
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,13 @@ Documentation = "https://mysqlclient.readthedocs.io/"
3939
requires = ["setuptools>=61"]
4040
build-backend = "setuptools.build_meta"
4141

42+
[tool.setuptools]
43+
package-dir = {"" = "src"}
44+
4245
[tool.setuptools.packages.find]
4346
namespaces = false
47+
where = ["src"]
4448
include = ["MySQLdb*"]
45-
exclude = ["tests*", "pymysql.tests*"]
4649

4750
[tool.setuptools.dynamic]
4851
version = {attr = "MySQLdb.release.__version__"}

setup.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99

1010
release_info = {}
11-
with open("MySQLdb/release.py", encoding="utf-8") as f:
11+
with open("src/MySQLdb/release.py", encoding="utf-8") as f:
1212
exec(f.read(), None, release_info)
1313

1414

@@ -164,7 +164,7 @@ def get_options():
164164
ext_modules = [
165165
setuptools.Extension(
166166
"MySQLdb._mysql",
167-
sources=["MySQLdb/_mysql.c"],
167+
sources=["src/MySQLdb/_mysql.c"],
168168
**ext_options,
169169
)
170170
]
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.

0 commit comments

Comments
 (0)