Skip to content

Commit

Permalink
Warn about Binding.Exec with script=True deprecation
Browse files Browse the repository at this point in the history
  • Loading branch information
messense committed Jun 24, 2022
1 parent 87096ac commit d9e5cf1
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@
### Packaging
- Increase minimum `setuptools` version to 62.4. [#222](https://github.com/PyO3/setuptools-rust/pull/246)

### Changed
- `Exec` binding `RustExtension` with `script=True` is deprecated in favor of `RustBin`. [#248](https://github.com/PyO3/setuptools-rust/pull/248)

### Added
- Add `RustBin` for packaging binaries in scripts data directory. [#248](https://github.com/PyO3/setuptools-rust/pull/248)

### Fixed
- If the sysconfig for `BLDSHARED` has no flags, `setuptools-rust` won't crash anymore. [#241](https://github.com/PyO3/setuptools-rust/pull/241)

Expand Down
7 changes: 7 additions & 0 deletions setuptools_rust/extension.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import json
import os
import re
import warnings
import subprocess
from distutils.errors import DistutilsSetupError
from enum import IntEnum, auto
Expand Down Expand Up @@ -152,6 +153,12 @@ def __init__(

self._cargo_metadata: Optional[_CargoMetadata] = None

if binding == Binding.Exec and script:
warnings.warn(
"'Binding.Exec' with 'script=True' is deprecated, use 'RustBin' instead.",
DeprecationWarning,
)

def get_lib_name(self) -> str:
"""Parse Cargo.toml to get the name of the shared library."""
metadata = self._metadata()
Expand Down

0 comments on commit d9e5cf1

Please sign in to comment.