mirror of
https://github.com/PyMySQL/mysqlclient.git
synced 2025-08-14 18:12:35 +08:00
Use src-layout. (#600)
This commit is contained in:
2
.github/workflows/tests.yaml
vendored
2
.github/workflows/tests.yaml
vendored
@ -29,7 +29,7 @@ jobs:
|
||||
PIP_DISABLE_PIP_VERSION_CHECK: 1
|
||||
run: |
|
||||
pip install -r requirements.txt
|
||||
python setup.py develop
|
||||
pip install .
|
||||
|
||||
- name: Run tests
|
||||
env:
|
||||
|
6
Makefile
6
Makefile
@ -1,6 +1,6 @@
|
||||
.PHONY: build
|
||||
build:
|
||||
python3 setup.py build_ext -if
|
||||
python setup.py build_ext -if
|
||||
|
||||
.PHONY: doc
|
||||
doc:
|
||||
@ -10,7 +10,7 @@ doc:
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
python3 setup.py clean
|
||||
python setup.py clean
|
||||
find . -name '*.pyc' -delete
|
||||
find . -name '__pycache__' -delete
|
||||
rm -rf build
|
||||
@ -18,4 +18,4 @@ clean:
|
||||
.PHONY: check
|
||||
check:
|
||||
ruff .
|
||||
black *.py MySQLdb
|
||||
black *.py src
|
||||
|
@ -1,2 +1,2 @@
|
||||
ignore:
|
||||
- "MySQLdb/constants/*"
|
||||
- "src/MySQLdb/constants/*"
|
||||
|
@ -39,10 +39,13 @@ Documentation = "https://mysqlclient.readthedocs.io/"
|
||||
requires = ["setuptools>=61"]
|
||||
build-backend = "setuptools.build_meta"
|
||||
|
||||
[tool.setuptools]
|
||||
package-dir = {"" = "src"}
|
||||
|
||||
[tool.setuptools.packages.find]
|
||||
namespaces = false
|
||||
where = ["src"]
|
||||
include = ["MySQLdb*"]
|
||||
exclude = ["tests*", "pymysql.tests*"]
|
||||
|
||||
[tool.setuptools.dynamic]
|
||||
version = {attr = "MySQLdb.release.__version__"}
|
||||
|
4
setup.py
4
setup.py
@ -8,7 +8,7 @@ from configparser import ConfigParser
|
||||
|
||||
|
||||
release_info = {}
|
||||
with open("MySQLdb/release.py", encoding="utf-8") as f:
|
||||
with open("src/MySQLdb/release.py", encoding="utf-8") as f:
|
||||
exec(f.read(), None, release_info)
|
||||
|
||||
|
||||
@ -164,7 +164,7 @@ for k, v in ext_options.items():
|
||||
ext_modules = [
|
||||
setuptools.Extension(
|
||||
"MySQLdb._mysql",
|
||||
sources=["MySQLdb/_mysql.c"],
|
||||
sources=["src/MySQLdb/_mysql.c"],
|
||||
**ext_options,
|
||||
)
|
||||
]
|
||||
|
Reference in New Issue
Block a user