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

Add support for selecting packages and modules. #2181

Merged
merged 2 commits into from
Jul 23, 2023

Conversation

jsirois
Copy link
Member

@jsirois jsirois commented Jul 21, 2023

This complements the existing -D / --sources-directory support for
adding local sources and resources with finer-grained control over
what files are included in the PEX file. Notably, this allows cleanly
packaging projects with no setup.py / pyproject.toml based build
when the projects have their Python code at the top level mixed with
other files that should not be included in the PEX (e.g.: build scripts,
CI configuration, documentation, etc.).

Fixes #2134

This complements the existing `-D` / `--sources-directory` support for
adding local sources and resources with finer-grained control over
what files are included in the PEX file. Notably, this allows cleanly
packaging projects with no `setup.py` / `pyproject.toml` based build
when the projects have their Python code at the top level mixed with
other files that should not be included in the PEX (e.g.: build scripts,
CI configuration, documentation, etc.).

Fixes pex-tool#2134
@jsirois
Copy link
Member Author

jsirois commented Jul 21, 2023

N.B.: I wanted to convert this Pex PEX packaging to dogfood via -P pex replacing pex_requirement below (it makes the Pex PEX build a good bit faster!):
https://github.com/pantsbuild/pex/blob/de7e6eccd2614d2be50be1db5e3e9b5cb753775b/scripts/package.py#L28-L56

Tests caught the fact that folks rely on the pex3 console script though (Pants for one via PEX_SCRIPT=pex3 ./pex.pex ...) and console scripts ~require a build (setup.py / pyproject.toml).

@jsirois
Copy link
Member Author

jsirois commented Jul 21, 2023

@lordmauve / @khaledh, if either of you is available to take a look, I'd be grateful.

@jsirois jsirois merged commit cd2e590 into pex-tool:main Jul 23, 2023
30 checks passed
@jsirois jsirois deleted the issues/2134 branch July 23, 2023 15:00
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.

Add option to include a Python package/module in the Pex
2 participants