Skip to content
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

Specify build backend via pyproject.toml #7190

Closed
wants to merge 12 commits into from
4 changes: 2 additions & 2 deletions .github/workflows/test-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ jobs:
- name: Print build system information
run: python3 .github/workflows/system-info.py

- name: python3 -m pip install setuptools wheel pytest pytest-cov pytest-timeout defusedxml
run: python3 -m pip install setuptools wheel pytest pytest-cov pytest-timeout defusedxml
- name: python3 -m pip install wheel pytest pytest-cov pytest-timeout defusedxml
run: python3 -m pip install wheel pytest pytest-cov pytest-timeout defusedxml
hugovk marked this conversation as resolved.
Show resolved Hide resolved

- name: Install dependencies
id: install
Expand Down
11 changes: 11 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,24 @@ repos:
hooks:
- id: check-merge-conflict
- id: check-json
- id: check-toml
- id: check-yaml

- repo: https://github.com/sphinx-contrib/sphinx-lint
rev: v0.6.7
hooks:
- id: sphinx-lint

- repo: https://github.com/tox-dev/pyproject-fmt
rev: 0.11.2
hooks:
- id: pyproject-fmt

- repo: https://github.com/abravalheri/validate-pyproject
rev: v0.13
hooks:
- id: validate-pyproject

- repo: https://github.com/tox-dev/tox-ini-fmt
rev: 1.3.0
hooks:
Expand Down
5 changes: 5 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[build-system]
build-backend = "setuptools.build_meta"
requires = [
"setuptools>=67.8",
]
9 changes: 1 addition & 8 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -847,14 +847,7 @@ def build_extensions(self):
if struct.unpack("h", b"\0\1")[0] == 1:
defs.append(("WORDS_BIGENDIAN", None))

if (
sys.platform == "win32"
and sys.version_info < (3, 9)
and not (PLATFORM_PYPY or PLATFORM_MINGW)
):
defs.append(("PILLOW_VERSION", f'"\\"{PILLOW_VERSION}\\""'))
else:
defs.append(("PILLOW_VERSION", f'"{PILLOW_VERSION}"'))
defs.append(("PILLOW_VERSION", f'"{PILLOW_VERSION}"'))

self._update_extension("PIL._imaging", libs, defs)

Expand Down
6 changes: 5 additions & 1 deletion winbuild/build_prepare.py
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,11 @@ def build_pillow():
*prefs["header"],
cmd_set("DISTUTILS_USE_SDK", "1"), # use same compiler to build Pillow
cmd_set("py_vcruntime_redist", "true"), # always use /MD, never /MT
r'"{python_dir}\{python_exe}" setup.py build_ext --vendor-raqm --vendor-fribidi %*', # noqa: E501
r'"{python_dir}\{python_exe}" -m pip install --upgrade pip',
hugovk marked this conversation as resolved.
Show resolved Hide resolved
r'"{python_dir}\{python_exe}" -m pip install . '
r'--global-option="--vendor-raqm" '
r'--global-option="--vendor-fribidi" '
r'--global-option="%*"',
hugovk marked this conversation as resolved.
Show resolved Hide resolved
]

write_script("build_pillow.cmd", lines)
Expand Down