Skip to content

Commit

Permalink
Use reusable venvs
Browse files Browse the repository at this point in the history
Replace pip install --target with venvs.
As setuptools breakes out of the venv to load distutils build_ext
command, first create a copy of the Python distribution and hack
it.

This also has the benefit that the venv can be used to build
extensions outside of PyOxidizer.

Also add venv_path to PipRequirementsFile, allowing the same
venv to be incrementally populated in multiple rules,
and the venv re-used across PyOxidizer build runs.

Fixes #162
Fixes #170
Closes #194
  • Loading branch information
jayvdb committed Nov 19, 2019
1 parent 38179ef commit cc637c1
Show file tree
Hide file tree
Showing 8 changed files with 454 additions and 490 deletions.
2 changes: 2 additions & 0 deletions pyoxidizer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ cc = "1.0"
clap = "2.32"
codemap = "0.1"
codemap-diagnostic = "0.1"
copy_dir = "0.1.2"
encoding_rs = "0.8"
filetime = "0.2"
git2 = "0.9"
glob = "0.3"
goblin = "0.0"
Expand Down
3 changes: 3 additions & 0 deletions pyoxidizer/src/app_packaging/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ pub enum InstallLocation {
#[derive(Clone, Debug, PartialEq)]
pub struct PackagingSetupPyInstall {
pub path: String,
pub venv_path: Option<String>,
pub extra_env: HashMap<String, String>,
pub extra_global_arguments: Vec<String>,
pub optimize_level: i64,
Expand Down Expand Up @@ -87,6 +88,7 @@ pub struct PackagingPackageRoot {
#[derive(Clone, Debug, PartialEq)]
pub struct PackagingPipInstallSimple {
pub package: String,
pub venv_path: Option<String>,
pub extra_env: HashMap<String, String>,
pub optimize_level: i64,
pub excludes: Vec<String>,
Expand All @@ -99,6 +101,7 @@ pub struct PackagingPipInstallSimple {
pub struct PackagingPipRequirementsFile {
// TODO resolve to a PathBuf.
pub requirements_path: String,
pub venv_path: Option<String>,
pub extra_env: HashMap<String, String>,
pub optimize_level: i64,
pub include_source: bool,
Expand Down
Loading

0 comments on commit cc637c1

Please sign in to comment.