Skip to content

Commit

Permalink
Use src-layout. (#600)
Browse files Browse the repository at this point in the history
  • Loading branch information
methane committed May 15, 2023
1 parent abb139b commit 0220f42
Show file tree
Hide file tree
Showing 19 changed files with 11 additions and 8 deletions.
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.

0 comments on commit 0220f42

Please sign in to comment.