Skip to content

Use src-layout. #600

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.PHONY: build
build:
python3 setup.py build_ext -if
python setup.py build_ext -if

.PHONY: doc
doc:
Expand All @@ -10,12 +10,12 @@ doc:

.PHONY: clean
clean:
python3 setup.py clean
python setup.py clean
find . -name '*.pyc' -delete
find . -name '__pycache__' -delete
rm -rf build

.PHONY: check
check:
ruff .
black *.py MySQLdb
black *.py src
2 changes: 1 addition & 1 deletion codecov.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
ignore:
- "MySQLdb/constants/*"
- "src/MySQLdb/constants/*"
5 changes: 4 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@


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)


Expand Down Expand Up @@ -164,7 +164,7 @@ def get_options():
ext_modules = [
setuptools.Extension(
"MySQLdb._mysql",
sources=["MySQLdb/_mysql.c"],
sources=["src/MySQLdb/_mysql.c"],
**ext_options,
)
]
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.