diff --git a/CHANGELOG.md b/CHANGELOG.md index 01ff9e8..77662c2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ ## v0.2.5 - Added support for `manylinux2014` spec +- If a dependencies dependencies are specified multiple times, merge `extras` +by ommission. This led to bugs where dependencies didn't get installed when +specified both as an extras and as not +- Dependencies specifying `sys_platform == "win32"` now applies to 64-bit +Windows installations as well. This should fix cases where Windows dependencies +weren't being installed. - Fixed a dependency-installation bug triggered by symlinks inside Pypi source archives - `pyflow new` no longer creates a `LICENSE` file diff --git a/README.md b/README.md index e71f820..2d7b389 100644 --- a/README.md +++ b/README.md @@ -32,22 +32,22 @@ and [Pep 518 (pyproject.toml)](https://www.python.org/dev/peps/pep-0518/). ## Installation - **Windows** - Download and run -[this installer](https://github.com/David-OConnor/pyflow/releases/download/0.2.4/pyflow-0.2.4-x86_64.msi). +[this installer](https://github.com/David-OConnor/pyflow/releases/download/0.2.5/pyflow-0.2.5-x86_64.msi). Or, if you have [Scoop](https://scoop.sh) installed, run `scoop install pyflow`. - **Ubuntu, or another Os that uses Snap** - Run `snap install pyflow --classic`. - **Ubuntu or Debian without Snap** - Download and run -[this deb](https://github.com/David-OConnor/pyflow/releases/download/0.2.4/pyflow_0.2.4_amd64.deb). +[this deb](https://github.com/David-OConnor/pyflow/releases/download/0.2.5/pyflow_0.2.5_amd64.deb). - **Fedora, CentOs, RedHat, or older versions of SUSE** - Download and run -[this rpm](https://github.com/David-OConnor/pyflow/releases/download/0.2.4/pyflow-0.2.4.x86_64.rpm). +[this rpm](https://github.com/David-OConnor/pyflow/releases/download/0.2.5/pyflow-0.2.5.x86_64.rpm). - **A different Linux distro** - Download this -[standalone binary](https://github.com/David-OConnor/pyflow/releases/download/0.2.4/pyflow) +[standalone binary](https://github.com/David-OConnor/pyflow/releases/download/0.2.5/pyflow) and place it somewhere accessible by the PATH. For example, `/usr/bin`. -- **Mac** - Download this [zipped Mac binary](https://github.com/David-OConnor/pyflow/releases/download/0.2.4/pyflow_mac_0.2.4.zip) +- **Mac** - Download this [zipped Mac binary](https://github.com/David-OConnor/pyflow/releases/download/0.2.5/pyflow_mac_0.2.5.zip) , ance place the file in it somewhere accessible by the PATH. (Props to @russeldavis for building this) - **With Pip** - Run `pip install pyflow`. The linux install using this method is much larger than @@ -190,7 +190,7 @@ Example contents: [tool.pyflow] py_version = "3.7" name = "runcible" -version = "0.2.4" +version = "0.2.5" authors = ["John Hackworth "] @@ -373,7 +373,7 @@ In order to build and publish your project, additional info is needed in [tool.pyflow] name = "everythingkiller" py_version = "3.6" -version = "0.2.4" +version = "0.2.5" authors = ["Fraa Erasmas "] description = "Small, but packs a punch!" homepage = "https://everything.math" @@ -396,7 +396,7 @@ activate = "jeejah:activate" [tool.pyflow.dependencies] numpy = "^1.16.4" -manimlib = "0.2.4" +manimlib = "0.2.5" ipython = {version = "^7.7.0", extras=["qtconsole"]} diff --git a/snapcraft.yaml b/snapcraft.yaml index d5198c3..f96fc6b 100644 --- a/snapcraft.yaml +++ b/snapcraft.yaml @@ -1,5 +1,5 @@ name: pyflow -version: 0.2.4 +version: 0.2.5 license: MIT # todo: This appears to cause the `snapcraft` command to fail. summary: A Python installation and dependency manager. description: | diff --git a/src/dep_resolution.rs b/src/dep_resolution.rs index 196b8d2..53f8324 100644 --- a/src/dep_resolution.rs +++ b/src/dep_resolution.rs @@ -278,13 +278,19 @@ fn guess_graph( for constr in req.constraints.iter() { c.constraints.push(constr.clone()); } + // If one is specified with an extra and the other without, keep + // the version without the extra. This is probably bad specification, but + // we have to work around it. + if req.extra.is_none() && c.extra.is_some() { + c.extra = None + } + // todo: Should merge sys_platform, python_version, install_with_extras too. } } continue; } cleaned_reqs.push(req.clone()); - // todo: Should merge extra, sys_platform, python_version, install_with_extras too. } let reqs: Vec<&Req> = cleaned_reqs @@ -298,7 +304,10 @@ fn guess_graph( }) .filter(|r| match r.sys_platform { Some((rt, os_)) => match rt { - ReqType::Exact => os_ == os, + // A specified win32 req could apply to 64-bit windows too. + ReqType::Exact => { + os_ == os || (os_ == util::Os::Windows32 && os == util::Os::Windows) + } ReqType::Ne => os_ != os, _ => { util::abort("Reqtypes for Os must be == or !="); diff --git a/src/files.rs b/src/files.rs index 0fd4474..849e52c 100644 --- a/src/files.rs +++ b/src/files.rs @@ -341,11 +341,6 @@ pub fn parse_req_dot_text(cfg: &mut Config, path: &Path) { } } -fn key_re(key: &str) -> Regex { - // todo DRY from main - Regex::new(&format!(r#"^{}\s*=\s*"(.*)"$"#, key)).unwrap() -} - /// Update the config file with a new version. pub fn change_py_vers(cfg_path: &Path, specified: &Version) { let f = fs::File::open(&cfg_path) diff --git a/src/main.rs b/src/main.rs index 14f4285..4040e68 100644 --- a/src/main.rs +++ b/src/main.rs @@ -977,7 +977,7 @@ fn run_script( // todo DRY let pypackages_dir = env_path.join("__pypackages__"); let (vers_path, py_vers) = - util::find_venv_info(&cfg_vers, &pypackages_dir, pyflow_dir, dep_cache_path); + util::find_or_create_venv(&cfg_vers, &pypackages_dir, pyflow_dir, dep_cache_path); let bin_path = util::find_bin_path(&vers_path); let lib_path = vers_path.join("lib"); @@ -1421,7 +1421,7 @@ fn main() { // Check for environments. Create one if none exist. Set `vers_path`. let (vers_path, py_vers) = - util::find_venv_info(&cfg_vers, &pypackages_path, &pyflow_path, &dep_cache_path); + util::find_or_create_venv(&cfg_vers, &pypackages_path, &pyflow_path, &dep_cache_path); let paths = util::Paths { bin: util::find_bin_path(&vers_path), diff --git a/src/py_versions.rs b/src/py_versions.rs index b6bb10b..dc80c5d 100644 --- a/src/py_versions.rs +++ b/src/py_versions.rs @@ -369,6 +369,8 @@ pub fn create_venv( // todo perhaps move alias finding back into create_venv, or make a // todo create_venv_if_doesnt_exist fn. // Only search for a system Python if we don't have an internal one. + // todo: Why did we choose to prioritize portable over system? Perhaps do the + // todo other way around. if py_ver.is_none() { let aliases = find_py_aliases(cfg_v); match aliases.len() { diff --git a/src/util.rs b/src/util.rs index 87e8428..f9db9a9 100644 --- a/src/util.rs +++ b/src/util.rs @@ -95,16 +95,6 @@ pub fn print_color(message: &str, color: Color) { ); } -///// Print in a color, then reset formatting. -//pub fn print_color_bold(message: &str, color: Color) { -// println!( -// "{}{}{}", -// Colored::Fg(color), -// message, -// Colored::Fg(Color::Reset) -// ); -//} - /// Used when the program should exit from a condition that may arise normally from program use, /// like incorrect info in config files, problems with dependencies, or internet connection problems. /// We use `expect`, `panic!` etc for problems that indicate a bug in this program. @@ -481,7 +471,7 @@ pub fn unpack_tar_xz(archive_path: &Path, dest: &Path) { } /// Find venv info, creating a venv as required. -pub fn find_venv_info( +pub fn find_or_create_venv( cfg_vers: &Version, pypackages_dir: &Path, pyflow_dir: &Path,