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 building dists from an existing setup.py. #12250

Merged
merged 2 commits into from
Jul 2, 2021

Conversation

benjyw
Copy link
Contributor

@benjyw benjyw commented Jun 27, 2021

Previously we insisted on generating the setup.py from information known to Pants.
This change allows users to build against an existing setup.py checked into the repo.

This is useful when the setup logic is unusual, or involves building native code, and so on.
Of course in this case there may be redundancy between the information known to Pants
and whatever is in the setup.py. So the author of the setup.py is responsible for ensuring that
it is correct with respect to versions, dependencies and so on.

This will make it easier to adopt Pants in an existing repo with existing setup.py files.

To use this new feature, your provides=setup_py(...) stanza should contain a setup_script key,
pointing to the setup script, and it should also contain the name and version, repeated from
the setup.py. It may contain no other keys.

[ci skip-rust]

[ci skip-build-wheels]

[ci skip-rust]

[ci skip-build-wheels]
@benjyw benjyw force-pushed the use_existing_setup_script branch from ba0761a to dd369d8 Compare June 27, 2021 01:58
@benjyw benjyw requested review from Eric-Arellano and jsirois June 27, 2021 01:59
@benjyw
Copy link
Contributor Author

benjyw commented Jun 27, 2021

Addresses #11942 .

@benjyw
Copy link
Contributor Author

benjyw commented Jun 27, 2021

@nbren12 This is a step towards solving your use case. The remaining part is how to consume the package without having to publish it.

@nbren12
Copy link

nbren12 commented Jun 28, 2021

Great! I'm glad this is being worked on. Compiling code in setup.py is quite common on the scientific python world.

Copy link
Contributor

@Eric-Arellano Eric-Arellano left a comment

Choose a reason for hiding this comment

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

Thanks, Benjy!

[ci skip-rust]

[ci skip-build-wheels]
@benjyw benjyw merged commit 4cb8c4a into pantsbuild:main Jul 2, 2021
@benjyw benjyw deleted the use_existing_setup_script branch July 2, 2021 18:35
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.

4 participants