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

Support projects without setup.py (pyproject.toml and setup.cfg are also valid) #360

Merged
merged 18 commits into from
Jun 2, 2020
Merged
Changes from 2 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
25 changes: 24 additions & 1 deletion cibuildwheel/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ def main() -> None:
# This needs to be passed on to the docker container in linux.py
os.environ['CIBUILDWHEEL'] = '1'

if not os.path.exists(os.path.join(package_dir, 'setup.py')):
if not detect_setup_pyproject_existence(package_dir):
heitorlessa marked this conversation as resolved.
Show resolved Hide resolved
print('cibuildwheel: Could not find setup.py at root of package', file=sys.stderr)
exit(2)

Expand Down Expand Up @@ -309,5 +309,28 @@ def detect_warnings(platform: str, build_options: BuildOptions) -> List[str]:
return warnings


def detect_setup_pyproject_existence(package_dir: str) -> bool:
"""Detects whether setup.py, or pyproject.toml is at package dir

Parameters
----------
package_dir : str
Package directory path

Returns
-------
bool
Whether setup.py, or pyproject.toml exists
heitorlessa marked this conversation as resolved.
Show resolved Hide resolved
"""
exists = False
if os.path.exists(os.path.join(package_dir, 'setup.py')):
heitorlessa marked this conversation as resolved.
Show resolved Hide resolved
exists = True

if os.path.exists(os.path.join(package_dir, 'pyproject.toml')):
exists = True

return exists


if __name__ == '__main__':
main()