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

feat: SDist builds #1096

Merged
merged 9 commits into from Apr 29, 2022
Merged

feat: SDist builds #1096

merged 9 commits into from Apr 29, 2022

Conversation

henryiii
Copy link
Contributor

@henryiii henryiii commented Apr 27, 2022

This is a followup to both close #1072 and close #1020 to attempt to build from SDists. This avoids a new entry point, works better with pipx and GitHub Actions, and should be the same as #1072 conceptually but with a single entry point.

I am not adding {project} to --config-file, since it was not supported before (and {package} continues to work properly). It could be added later if desired (for both modes).

when calling like 'python -m cibuildwheel', we get errors like

usage: __main__.py [-h] [--platform {auto,linux,macos,windows}] [--archs ARCHS] [--output-dir OUTPUT_DIR] [--config-file CONFIG_FILE]
                   [--print-build-identifiers] [--allow-empty] [--prerelease-pythons]
                   [package_dir]
__main__.py: error: unrecognized arguments: --sad

With this change, we get error outputs like:

usage: cibuildwheel [-h] [--platform {auto,linux,macos,windows}] [--archs ARCHS] [--output-dir OUTPUT_DIR] [--config-file CONFIG_FILE]
                    [--print-build-identifiers] [--allow-empty] [--prerelease-pythons]
                    [package_dir]
cibuildwheel: error: unrecognized arguments: --asda
@henryiii henryiii force-pushed the henryiii/feat/sdist branch 2 times, most recently from 9f07f8a to f6e4420 Compare April 27, 2022 05:58
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
@henryiii henryiii force-pushed the henryiii/feat/sdist branch 2 times, most recently from dd9c23f to 68dd0d0 Compare April 27, 2022 17:29
Copy link
Contributor

@joerick joerick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right! This approach is much cleaner than the extra entrypoint. Let's hope it passes the tests. I've a few minor comments, too.

cibuildwheel/options.py Outdated Show resolved Hide resolved
cibuildwheel/__main__.py Outdated Show resolved Hide resolved
unit_test/utils.py Outdated Show resolved Hide resolved
cibuildwheel/options.py Outdated Show resolved Hide resolved
test/test_from_sdist.py Outdated Show resolved Hide resolved
cibuildwheel/__main__.py Show resolved Hide resolved
cibuildwheel/__main__.py Outdated Show resolved Hide resolved
@henryiii henryiii marked this pull request as ready for review April 28, 2022 00:42
@henryiii henryiii linked an issue Apr 28, 2022 that may be closed by this pull request
@henryiii henryiii changed the title feat: SDist builds (attempt 3) feat: SDist builds Apr 28, 2022
# This are always relative to the base directory, even in SDist builds
args.output_dir = args.output_dir.resolve()

# Standard builds if a directory or non-existent path is given
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoiding making a new directory if this ends with .tar.gz

@joerick joerick merged commit f324c9a into pypa:main Apr 29, 2022
@nsoranzo
Copy link
Contributor

Thanks @henryiii , at a first test this seems to work great!

@nsoranzo
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Idea: build from SDists
3 participants