Skip to content

Commit cc637c1

Browse files
committed
Use reusable venvs
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
1 parent 38179ef commit cc637c1

8 files changed

Lines changed: 454 additions & 490 deletions

File tree

pyoxidizer/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ cc = "1.0"
2727
clap = "2.32"
2828
codemap = "0.1"
2929
codemap-diagnostic = "0.1"
30+
copy_dir = "0.1.2"
3031
encoding_rs = "0.8"
32+
filetime = "0.2"
3133
git2 = "0.9"
3234
glob = "0.3"
3335
goblin = "0.0"

pyoxidizer/src/app_packaging/config.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ pub enum InstallLocation {
2626
#[derive(Clone, Debug, PartialEq)]
2727
pub struct PackagingSetupPyInstall {
2828
pub path: String,
29+
pub venv_path: Option<String>,
2930
pub extra_env: HashMap<String, String>,
3031
pub extra_global_arguments: Vec<String>,
3132
pub optimize_level: i64,
@@ -87,6 +88,7 @@ pub struct PackagingPackageRoot {
8788
#[derive(Clone, Debug, PartialEq)]
8889
pub struct PackagingPipInstallSimple {
8990
pub package: String,
91+
pub venv_path: Option<String>,
9092
pub extra_env: HashMap<String, String>,
9193
pub optimize_level: i64,
9294
pub excludes: Vec<String>,
@@ -99,6 +101,7 @@ pub struct PackagingPipInstallSimple {
99101
pub struct PackagingPipRequirementsFile {
100102
// TODO resolve to a PathBuf.
101103
pub requirements_path: String,
104+
pub venv_path: Option<String>,
102105
pub extra_env: HashMap<String, String>,
103106
pub optimize_level: i64,
104107
pub include_source: bool,

0 commit comments

Comments
 (0)