An installation and dependency system for Python

Related tags

pyflow
Overview

crates.io version Build Status

Pyflow

Simple is better than complex - The Zen of Python

Pyflow streamlines working with Python projects and files. It's an easy-to-use CLI app with a minimalist API. Never worry about having the right version of Python or dependencies.

Example use, including setting up a project and switching Py versions: Demonstration

If your project's already configured, the only command you need is pyflow, or pyflow myscript.py; setting up Python and its dependencies are automatic.

Goals: Make using and publishing Python projects as simple as possible. Actively managing Python environments shouldn't be required to use dependencies safely. We're attempting to fix each stumbling block in the Python workflow, so that it's as elegant as the language itself.

You don't need Python or any other tools installed to use Pyflow.

It runs standalone scripts in their own environments with no config, and project functions directly from the CLI.

It implements PEP 582 -- Python local packages directory and Pep 518 (pyproject.toml).

Installation

  • Windows - Download and run this installer. Or, if you have Scoop 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.

  • Fedora, CentOs, RedHat, or older versions of SUSE - Download and run this rpm.

  • A different Linux distro - Download this standalone binary and place it somewhere accessible by the PATH. For example, /usr/bin.

  • Mac - Download this zipped Mac binary , 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 with the above ones, and it doesn't yet work with Mac. This method will likely not work with Red Hat, CentOs, or Fedora.

  • If you have Rust installed - Run cargo install pyflow.

Quickstart

  • (Optional) Run pyflow init in an existing project folder, or pyflow new projname to create a new project folder. init imports data from requirements.txt or Pipfile; new creates a folder with the basics.
  • Run pyflow install requests etc to install packages. Alternatively, edit pyproject.toml directly.
  • Run pyflow or pyflow myfile.py to run Python.

Quick-and-dirty start for quick-and-dirty scripts

  • Add the line __requires__ = ['numpy', 'requests'] somewhere in your script, where numpy and requests are dependencies. Run pyflow script myscript.py, where myscript.py is the name of your script. This will set up an isolated environment for this script, and install dependencies as required. This is a safe way to run one-off Python files that aren't attached to a project, but have dependencies.

Why add another Python manager?

Pipenv, Poetry, and Pyenv address parts of Pyflow's raison d'être, but expose stumbling blocks that may frustrate new users, both when installing and using. Some reasons why this is different:

  • It behaves consistently regardless of how your system and Python installations are configured.

  • It automatically manages Python installations and environments. You specify a Python version in pyproject.toml (if omitted, it asks), and it ensures that version is used. If the version's not installed, Pyflow downloads a binary, and uses that. If multiple installations are found for that version, it asks which to use. Pyenv can be used to install Python, but only if your system is configured in a certain way: I don’t think expecting a user’s computer to compile Python is reasonable.

  • By not using Python to install or run, it remains environment-agnostic. This is important for making setup and use as simple and decision-free as possible. It's common for Python-based CLI tools to not run properly when installed from pip due to the PATH or user directories not being configured in the expected way.

  • Its dependency resolution and locking is faster due to using a cached database of dependencies, vice downloading and checking each package, or relying on the incomplete data available on the pypi warehouse. Pipenv’s resolution in particular may be prohibitively-slow on weak internet connections.

  • It keeps dependencies in the project directory, in __pypackages__. This is subtle, but reinforces the idea that there's no hidden state.

  • It will always use the specified version of Python. This is a notable limitation in Poetry; Poetry may pick the wrong installation (eg Python2 vice Python3), with no obvious way to change it. Poetry allows projects to specify version, but neither selects, nor provides a way to select the right one. If it chooses the wrong one, it will install the wrong environment, and produce a confusing error message. This can be worked around using Pyenv, but this solution isn't documented, and adds friction to the workflow. It may confuse new users, as it occurs by default on popular linux distros like Ubuntu. Additionally, Pyenv's docs are confusing: It's not obvious how to install it, what operating systems it's compatible with, or what additional dependencies are required.

  • Multiple versions of a dependency can be installed, allowing resolution of conflicting sub-dependencies. (ie: Your package requires Dep A>=1.0 and Dep B. Dep B requires Dep A==0.9) There are many cases where Poetry and Pipenv will fail to resolve dependencies. Try it for yourself with a few random dependencies from pypi; there's a good chance you'll hit this problem using Poetry or Pipenv. Limitations: This will not work for some compiled dependencies, and attempting to package something using this will trigger an error.

Perhaps the biggest philosophical difference is that Pyflow abstracts over environments, rather than expecting users to manage them.

My OS comes with Python, and Virtual environments are easy. What's the point of this?

Hopefully we're not replacing one problem with another.

Some people like the virtual-environment workflow - it requires only tools included with Python, and uses few console commands to create, and activate and environments. However, it may be tedious depending on workflow: The commands may be long depending on the path of virtual envs and projects, and it requires modifying the state of the terminal for each project, each time you use it, which you may find inconvenient or inelegant.

I think we can do better. This is especially relevant for new Python users who don't understand venvs, or are unaware of the hazards of working with a system Python.

Pipenv improves the workflow by automating environment use, and allowing reproducible dependency graphs. Poetry improves upon Pipenv's API, speed, and dependency resolution, as well as improving the packaging and distributing process by using a consolidating project config. Both are sensitive to the environment they run in, and won't work correctly if it's not as expected.

Conda addresses these problems elegantly, but maintains a separate repository of binaries from PyPi. If all packages you need are available on Conda, it may be the best solution. If not, it requires falling back to Pip, which means using two separate package managers.

When building and deploying packages, a set of overlapping files are traditionally used: setup.py, setup.cfg, requirements.txt and MANIFEST.in. We use pyproject.toml as the single-source of project info required to build and publish.

A thoroughly biased feature table

These tools have different scopes and purposes:

Name Pip + venv Pipenv Poetry pyenv pythonloc Conda this
Manages dependencies
Resolves/locks deps
Manages Python installations
Py-environment-agnostic
Included with Python
Stores deps with project
Requires changing session state
Clean build/publish flow
Supports old Python versions with virtualenv
Isolated envs for scripts
Runs project fns from CLI

Use

  • Optionally, create a pyproject.toml file in your project directory. Otherwise, this file will be created automatically. You may wish to use pyflow new to create a basic project folder (With a .gitignore, source directory etc), or pyflow init to populate info from requirements.txt or Pipfile. See PEP 518 for details.

Example contents:

[tool.pyflow]
py_version = "3.7"
name = "runcible"
version = "0.2.9"
authors = ["John Hackworth <[email protected]>"]

[tool.pyflow.dependencies]
numpy = "^1.16.4"
diffeqpy = "1.1.0"

The [tool.pyflow] section is used for metadata. The only required item in it is py_version, unless building and distributing a package. The [tool.pyflow.dependencies] section contains all dependencies, and is an analog to requirements.txt. You can specify developer dependencies in the [tool.pyflow.dev-dependencies] section. These won't be packed or published, but will be installed locally. You can install these from the cli using the --dev flag. Eg: pyflow install black --dev

You can specify extra dependencies, which will only be installed when passing explicit flags to pyflow install, or when included in another project with the appropriate flag enabled. Ie packages requiring this one can enable with pip install -e etc.

[tool.pyflow.extras]
test = ["pytest", "nose"]
secure = ["crypto"]

If you'd like to an install a dependency with extras, use syntax like this:

[tool.pyflow.dependencies]
ipython = { version = "^7.7.0", extras = ["qtconsole"] }

To install from a local path instead of pypi, use syntax like this:

[tool.pyflow.dependencies]
# packagename = { path = "path-to-package"}
numpy = { path = "../numpy" }

To install from a git repo, use syntax like this:

[tool.pyflow.dependencies]
saturn = { git = "https://github.com/david-oconnor/saturn.git" }  # The trailing `.git` here is optional.

gitdependencies are currently experimental. If you run into problems with them, please submit an issue.

To install a package that includes a . in its name, enclose the name in quotes.

For details on how to specify dependencies in this Cargo.toml-inspired semver format, reference this guide.

We also attempt to parse metadata and dependencies from tool.poetry sections of pyproject.toml, so there's no need to modify the format if you're using that.

You can specify direct entry points to parts of your program using something like this in pyproject.toml:

[tool.pyflow.scripts]
name = "module:function"

Where you replace name, function, and module with the name to call your script with, the function you wish to run, and the module it's in respectively. This is similar to specifying scripts in setup.py for built packages. The key difference is that functions specified here can be run at any time, without having to build the package. Run with pyflow name to do this.

If you run pyflow package on on a package using this, the result will work like normal script entry points for someone using the package, regardless of if they're using this tool.

What you can do

Managing dependencies:

  • pyflow install - Install all packages in pyproject.toml, and remove ones not (recursively) specified. If an environment isn't already set up for the version specified in pyproject.toml, sets one up. Note that this command isn't required to sync dependencies; any relevant pyflow command will do so automatically.
  • pyflow install requests - If you specify one or more packages after install, those packages will be added to pyproject.toml and installed. You can use the --dev flag to install dev dependencies. eg: pyflow install black --dev.
  • pyflow install numpy==1.16.4 matplotlib>=3.1 - Example with multiple dependencies, and specified versions
  • pyflow uninstall requests - Remove one or more dependencies

Running REPL and Python files in the environment:

  • pyflow - Run a Python REPL
  • pyflow main.py - Run a python file
  • pyflow ipython, pyflow black etc - Run a CLI tool like ipython, or a project function For the former, this must have been installed by a dependency; for the latter, it's specfied under [tool.pyflow], scripts
  • pyflow script myscript.py - Run a one-off script, outside a project directory, with per-file package management

Building and publishing:

  • pyflow package - Package for distribution (uses setuptools internally, and builds both source and wheel.)
  • pyflow package --extras "test all" - Package for distribution with extra features enabled, as defined in pyproject.toml
  • pyflow publish - Upload to PyPi (Repo specified in pyproject.toml. Uses Twine internally.)

Misc:

  • pyflow list - Display all installed packages and console scripts
  • pyflow new projname - Create a directory containing the basics for a project: a readme, pyproject.toml, .gitignore, and directory for code
  • pyflow init - Create a pyproject.toml file in an existing project directory. Pull info from requirements.text and Pipfile as required.
  • pyflow reset - Remove the environment, and uninstall all packages
  • pyflow clear - Clear the cache, of downloaded dependencies, Python installations, or script- environments; it will ask you which ones you'd like to clear.
  • pyflow -V - Get the current version of this tool
  • pyflow help Get help, including a list of available commands

How installation and locking work

Running pyflow install syncs the project's installed dependencies with those specified in pyproject.toml. It generates pyflow.lock, which on subsequent runs, keeps dependencies each package a fixed version, as long as it continues to meet the constraints specified in pyproject.toml. Adding a package name via the CLI, eg pyflow install matplotlib simply adds that requirement before proceeding. pyflow.lock isn't meant to be edited directly.

Each dependency listed in pyproject.toml is checked for a compatible match in pyflow.lock If a constraint is met by something in the lock file, the version we'll sync will match that listed in the lock file. If not met, a new entry is added to the lock file, containing the highest version allowed by pyproject.toml. Once complete, packages are installed and removed in order to exactly meet those listed in the updated lock file.

This tool downloads and unpacks wheels from pypi, or builds wheels from source if none are available. It verifies the integrity of the downloaded file against that listed on pypi using SHA256, and the exact versions used are stored in a lock file.

When a dependency is removed from pyproject.toml, it, and its subdependencies not also required by other packages are removed from the __pypackages__ folder.

How dependencies are resolved

Compatible versions of dependencies are determined using info from the PyPi Warehouse (available versions, and hash info), and the pydeps database. We use pydeps, which is built specifically for this project, due to inconsistent dependency information stored on pypi. A dependency graph is built using this cached database. We attempt to use the newest compatible version of each package.

If all packages are either only specified once, or specified multiple times with the same newest-compatible version, we're done resolving, and ready to install and sync.

If a package is included more than once with different newest-compatible versions, but one of those newest-compatible is compatible with all requirements, we install that one. If not, we search all versions to find one that's compatible.

If still unable to find a version of a package that satisfies all requirements, we install multiple versions of it as-required, store them in separate directories, and modify their parents' imports as required.

Note that it may be possible to resolve dependencies in cases not listed above, instead of installing multiple versions. Ie we could try different combinations of top-level packages, check for resolutions, then vary children as-required down the hierarchy. We don't do this because it's slow, has no guarantee of success, and involves installing older versions of packages.

Not-yet-implemented

  • Installing global CLI tools
  • The lock file is missing some info like hashes
  • Adding a dependency via the CLI with a specific version constraint, or extras.
  • Install packages from a local wheel directly. In the meanwhile, you can use a path dependency of the unpacked wheel.
  • Dealing with multiple-installed-versions of a dependency that uses importlib or dynamic imports
  • Install Python on Mac

Building and uploading your project to PyPi

In order to build and publish your project, additional info is needed in pyproject.toml, that mimics what would be in setup.py. Example:

[tool.pyflow]
name = "everythingkiller"
py_version = "3.6"
version = "0.2.9"
authors = ["Fraa Erasmas <[email protected]>"]
description = "Small, but packs a punch!"
homepage = "https://everything.math"
repository = "https://github.com/raz/everythingkiller"
license = "MIT"
keywords = ["nanotech", "weapons"]
classifiers = [
    "Topic :: System :: Hardware",
    "Topic :: Scientific/Engineering :: Human Machine Interfaces",
]
python_requires = ">=3.6"
# If not included, will default to `test.pypi.org`
package_url = "https://upload.pypi.org/legacy/"


[tool.pyflow.scripts]
# name = "module:function"
activate = "jeejah:activate"


[tool.pyflow.dependencies]
numpy = "^1.16.4"
manimlib = "0.2.9"
ipython = {version = "^7.7.0", extras=["qtconsole"]}


[tool.pyflow.dev-dependencies]
black = "^18.0"

package_url is used to determine which package repository to upload to. If omitted, Pypi test is used (https://test.pypi.org/legacy/).

Other items you can specify in [tool.pyflow]:

  • readme: The readme filename, use this if it's named something other than README.md.
  • build: A python script to execute building non-python extensions when running pyflow package.

Building this from source

If you’d like to build from source, download and install Rust, clone the repo, and in the repo directory, run cargo build --release.

Ie on linux or Mac:

curl https://sh.rustup.rs -sSf | sh
git clone https://github.com/david-oconnor/pyflow.git
cd pyflow
cargo build --release

Updating

  • If installed via Scoop, run scoop update pyflow.
  • If installed via Snap, run snap refresh pyflow.
  • If installed via Cargo, run cargo install pyflow --force.
  • If installed via Pip, run pip install --upgrade pyflow.
  • If using an installer or deb, run the new version's installer or deb. If manually calling a binary, replace it.

Uninstalling

  • If installed via Scoop, run scoop uninstall pyflow.
  • If installed via Snap, run snap remove pyflow.
  • If installed via Cargo, run cargo uninstall pyflow.
  • If installed via Pip, run pip uninstall pyflow.
  • If installed via Windows installer, run the Installer again and select Remove when asked, or use Apps & features.
  • If installed via a deb, useg the Software Center.
  • If manually calling a binary, remove it.

Contributing

If you notice unexpected behavior or missing features, please post an issue, or submit a PR. If you see unexpected behavior, it's probably a bug! Post an issue listing the dependencies that did not install correctly.

Why not to use this

  • It's adding another tool to an already complex field.
  • Most of the features here are already provided by a range of existing packages, like the ones in the table above.
  • The field of contributors is expected to be small, since it's written in a different language.
  • Dependency managers like Pipenv and Poetry work well enough for many cases, have dedicated dev teams, and large userbases.
  • Conda in particular handles many things this does quite well.

Dependency cache repo:

  • Github Example API calls: https://pydeps.herokuapp.com/requests, https://pydeps.herokuapp.com/requests/2.21.0. This pulls all top-level dependencies for the requests package, and the dependencies for version 2.21.0 respectively. There is also a POST API for pulling info on specified versions. The first time this command is run for a package/version combo, it may be slow. Subsequent calls, by anyone, should be fast. This is due to having to download and install each package on the server to properly determine dependencies, due to unreliable information on the pypi warehouse.

Python binary sources:

Repo binaries are downloaded from

  • Windows: Python official Visual Studio package, by Steve Dower.
  • Newer linux distros: Built on Ubuntu 18.04, using standard procedures.
  • Older linux distros: Built on CentOS 7, using standard procedures.

Gotchas

  • Make sure __pypackages__ is in your .gitignore file.
  • You may need to set up IDEs to find packages in __pypackages__. If using PyCharm: SettingsProjectProject InterpreterShow All... → (Select the interpreter, ie (projname)/__pypackages__/3.x/.venv/bin/python on Linux/Mac, or (projname)/__pypackages__/3.x/Scripts/python on Windows) → Click the folder-tree icon at the bottom of the pop-out window → Click the + icon at the bottom of the new pop-out window → Navigate to and select (projname)/__pypackages__/3.x/lib
  • If using VsCode: Settings → search python extra pathsEdit in settings.json → Add or modify the line: "python.autoComplete.extraPaths": ["(projname)/__pypackages__/3.7/lib"]

References

Issues
  • Incomplete package install

    Incomplete package install

    1. Create a new project
    2. Run pyflow install ufolib2
    $ pyflow install ufolib2
    Found lockfile
    ⬇ Installing ufolib2 0.5.1 ...
    ⬇ Installing attrs 19.3.0 ...
    Installation complete
    

    It should also install fonttools, see https://github.com/fonttools/ufoLib2/blob/master/setup.cfg. Not sure what's going on there.

    bug 
    opened by madig 15
  • Fails to run on mac

    Fails to run on mac

    I installed with cargo from the master branch. When I run pyflow install numpy after entering a directory created with pyflow new projectname, I get (with RUST_BACTRACE=full):

    🐍Setting up Python environment...
    thread 'main' panicked at 'Problem creating lib directory: Os { code: 2, kind: NotFound, message: "No such file or directory" }', src/libcore/result.rs:1165:5
    stack backtrace:
       0:        0x10d0ff995 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h458d13cb63d0c050
       1:        0x10d1259e0 - core::fmt::write::h53670af22ec3875f
       2:        0x10d0fa08b - std::io::Write::write_fmt::haf3d8737b9e851a5
       3:        0x10d101c8a - std::panicking::default_hook::{{closure}}::h3fbc052481cb023f
       4:        0x10d101995 - std::panicking::default_hook::h47b52fdc388b3b91
       5:        0x10d102357 - std::panicking::rust_panic_with_hook::he9c773346a268707
       6:        0x10d101ecd - std::panicking::continue_panic_fmt::h6ce88923515447fe
       7:        0x10d101e29 - rust_begin_unwind
       8:        0x10d13b59f - core::panicking::panic_fmt::h374d7a5fcdeaf2cf
       9:        0x10d13b679 - core::result::unwrap_failed::hdf38bf4ba53b175b
      10:        0x10cd74fb4 - pyflow::install::download_and_install_package::h962f28ab57bd4aee
      11:        0x10cd69612 - pyflow::py_versions::create_venv::hcb44ecfaa27a005d
      12:        0x10cd05525 - pyflow::util::find_venv_info::hb763c03c66689fc0
      13:        0x10cd45d58 - pyflow::main::hdf0794e46e104969
      14:        0x10cd29536 - std::rt::lang_start::{{closure}}::h26547f149e205262
      15:        0x10d101da8 - std::panicking::try::do_call::h1875c1f8f5700dda
      16:        0x10d10aaef - __rust_maybe_catch_panic
      17:        0x10d1027be - std::rt::lang_start_internal::h5206fcf99580d1b5
      18:        0x10cd4c699 - main
    
    
    bug 
    opened by alok 14
  • Dependency to source only package cause error

    Dependency to source only package cause error

    When dependency is a source only distribution, I got error. Here is a procedure to reproduce it. pyflow 0.2.3 OS: Linux Mint 19.2

    ~/tmp$ pyflow new proj
    Please enter the Python version for this project: (eg: 3.8)
    3.8
    Created a new Python project named proj
    ~/tmp$ cd proj
    ~/tmp/proj (master #)$ RUST_BACKTRACE=full pyflow install ifaddr
    ⬇ Installing ifaddr 0.1.6 ...
    thread 'main' panicked at 'Problem running setup.py bdist_wheel: Os { code: 2, kind: NotFound, message: "No such file or directory" }', src/libcore/result.rs:1165:5
    stack backtrace:
       0:     0x55d79b1daba4 - <unknown>
       1:     0x55d79b20342c - core::fmt::write::h01edf6dd68a42c9c
       2:     0x55d79b1d50c7 - <unknown>
       3:     0x55d79b1dd745 - <unknown>
       4:     0x55d79b1dd436 - <unknown>
       5:     0x55d79b1dde45 - std::panicking::rust_panic_with_hook::h825f041245da8739
       6:     0x55d79b1dd9e2 - <unknown>
       7:     0x55d79b1dd8d6 - rust_begin_unwind
       8:     0x55d79b1ffe9a - core::panicking::panic_fmt::h527855ce0bc891f6
       9:     0x55d79b1fff97 - core::result::unwrap_failed::ha8b77e6004f0ba38
      10:     0x55d79ae69812 - <unknown>
      11:     0x55d79ae422f1 - <unknown>
      12:     0x55d79ae4d248 - <unknown>
      13:     0x55d79ae7dd53 - <unknown>
      14:     0x55d79b1dd873 - <unknown>
      15:     0x55d79b1e7c3a - __rust_maybe_catch_panic
      16:     0x55d79b1de33d - std::rt::lang_start_internal::h409d4f2fe51133b0
      17:     0x55d79ae519c2 - <unknown>
      18:     0x7f5767267b97 - __libc_start_main
      19:     0x55d79ad76dc9 - <unknown>
      20:                0x0 - <unknown>
    ~/tmp/proj (master #)$ 
    
    bug 
    opened by miurahr 14
  • Installation on macos fails

    Installation on macos fails

    I'm hoping to use pyflow to distribute an app I'm developing, so I'm also using it to run the tests on TravisCI. However, the MacOS test is proving to be tricky, as the installation of pyflow via Rust fails with this error.:

    error[E0308]: mismatched types
       --> /Users/travis/.cargo/registry/src/github.com-1ecc6299db9ec823/pyflow-0.2.7/src/install.rs:405:29
        |
    405 |                 util::abort(error);
        |                             ^^^^^
        |                             |
        |                             expected `&str`, found struct `std::string::String`
        |                             help: consider borrowing here: `&error`
    error: aborting due to previous error
    For more information about this error, try `rustc --explain E0308`.
    error: failed to compile `pyflow v0.2.7`, intermediate artifacts can be found at `/var/folders/nz/vv4_9tw56nv9k3tkvyszvwg80000gn/T/cargo-installNfr0yT`
    
    

    Additionally, the mac binary linked in the readme only returns "not found" :(

    opened by MxFlix 11
  • `pyflow switch` does nothing

    `pyflow switch` does nothing

    1. git clone https://github.com/daltonmaag/statmake
    2. pyflow install
    3. pyflow -- should display some 3.6.x version
    4. pyflow switch 3.8 -- or something else you have lying around
    5. pyflow -- still displays 3.6.x :(
    bug 
    opened by madig 10
  • Cannot `pyflow install black`

    Cannot `pyflow install black`

    Giving pyflow a spin for the first time and this came up:

    $ RUST_BACKTRACE=full pyflow install black
    Found lockfile
    ⬇ Installing appdirs 1.4.4 ...
    ⬇ Installing regex 2020.6.8 ...
    ⬇ Installing attrs 19.3.0 ...
    ⬇ Installing click 7.1.2 ...
    ⬇ Installing toml 0.10.1 ...
    ⬇ Installing black 19.10.0b0 ...
    EX PAR: "__pypackages__/3.8/lib/black-19.10b0" bin: "__pypackages__/3.8/.venv/bin"
    thread 'main' panicked at 'Problem running setup.py bdist_wheel: Os { code: 2, kind: NotFound, message: "No such file or directory" }', src/libcore/result.rs:1165:5
    stack backtrace:
       0:     0x55da42d39e14 - backtrace::backtrace::libunwind::trace::h65597d255cb1398b
                                   at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.40/src/backtrace/libunwind.rs:88
       1:     0x55da42d39e14 - backtrace::backtrace::trace_unsynchronized::hd4f479d7150ec4a0
                                   at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.40/src/backtrace/mod.rs:66
       2:     0x55da42d39e14 - std::sys_common::backtrace::_print_fmt::h015072984a2b172c
                                   at src/libstd/sys_common/backtrace.rs:77
       3:     0x55da42d39e14 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h6df05d3335f32194
                                   at src/libstd/sys_common/backtrace.rs:61
       4:     0x55da42d629bc - core::fmt::write::h1f444f4312eb6c27
                                   at src/libcore/fmt/mod.rs:1028
       5:     0x55da42d34387 - std::io::Write::write_fmt::h8d147888220078ef
                                   at src/libstd/io/mod.rs:1412
       6:     0x55da42d3c9be - std::sys_common::backtrace::_print::h8a6df0fa81d6af62
                                   at src/libstd/sys_common/backtrace.rs:65
       7:     0x55da42d3c9be - std::sys_common::backtrace::print::h6f05b4733407e509
                                   at src/libstd/sys_common/backtrace.rs:50
       8:     0x55da42d3c9be - std::panicking::default_hook::{{closure}}::h0d0a23bd02315dd8
                                   at src/libstd/panicking.rs:188
       9:     0x55da42d3c6b1 - std::panicking::default_hook::h8d15a9aecb4efac6
                                   at src/libstd/panicking.rs:205
      10:     0x55da42d3d0bb - std::panicking::rust_panic_with_hook::hbe174577402a475d
                                   at src/libstd/panicking.rs:464
      11:     0x55da42d3cc5e - std::panicking::continue_panic_fmt::h4d855dad868accf3
                                   at src/libstd/panicking.rs:373
      12:     0x55da42d3cb46 - rust_begin_unwind
                                   at src/libstd/panicking.rs:302
      13:     0x55da42d5f58e - core::panicking::panic_fmt::hdeb7979ab6591473
                                   at src/libcore/panicking.rs:139
      14:     0x55da42d5f687 - core::result::unwrap_failed::h054dd680e6fcd38b
                                   at src/libcore/result.rs:1165
      15:     0x55da429d0a2c - pyflow::install::download_and_install_package::h8e64a7e68ee71a6a
      16:     0x55da429ac1b5 - pyflow::sync::h2ff987914ed32726
      17:     0x55da429b6ced - pyflow::main::hfa569966dc82e778
      18:     0x55da428f4543 - std::rt::lang_start::{{closure}}::h29371ddbe7fb2bd0
      19:     0x55da42d3cae3 - std::rt::lang_start_internal::{{closure}}::h6ea535ec5c50fc3e
                                   at src/libstd/rt.rs:48
      20:     0x55da42d3cae3 - std::panicking::try::do_call::h631c6408dfccc6f5
                                   at src/libstd/panicking.rs:287
      21:     0x55da42d4715a - __rust_maybe_catch_panic
                                   at src/libpanic_unwind/lib.rs:78
      22:     0x55da42d3d59d - std::panicking::try::hab539b2d1255d635
                                   at src/libstd/panicking.rs:265
      23:     0x55da42d3d59d - std::panic::catch_unwind::hd5e0a26424bd7f34
                                   at src/libstd/panic.rs:396
      24:     0x55da42d3d59d - std::rt::lang_start_internal::h3bdc4c7d98181bf9
                                   at src/libstd/rt.rs:47
      25:     0x55da429bb492 - main
      26:     0x7f671ea21b97 - __libc_start_main
      27:     0x55da428e029a - _start
      28:                0x0 - <unknown>
    

    Installing other packages such as requests worked without a hitch.

    bug 
    opened by braincore 10
  • Suggestion: When current folder does not contain pyproject.toml, search parent directories

    Suggestion: When current folder does not contain pyproject.toml, search parent directories

    I suppose this is primarily an issue when you start to have nesting directories and cd around for some reason. Git and Poetry deal with this correctly. Feel free to close this if it is outside the scope for now or would introduce unwanted complexities about directory traversal.

    enhancement 
    opened by madig 10
  • After failing to build a wheel, installing anything becomes impossible

    After failing to build a wheel, installing anything becomes impossible

    Doing this:

     pyflow install cheat
    Found lockfile
    Installing termcolor 1.1.0 ...
    Installing cheat 2.5.1 ...
    Problem building cheat from source. This may occur if a package that requires compiling has no wheels available for Windows, and the system is missing dependencies required to compile it, or if on WSL and installing to a mounted directory.
    

    If you try to install any other packages, it tries to reinstall cheat and fail every time:

    λ pyflow install tldr
    Installing cheat 2.5.1 ...
    Problem building cheat from source. This may occur if a package that requires compiling has no wheels available for Windows, and the system is missing dependencies required to compile it, or if on WSL and installing to a mounted directory.
    
    bug High priority 
    opened by ksamuel 10
  • Mac binary

    Mac binary

    There are currently no Mac binaries or installers available. There should be no reason this doesn't work on Mac, but it's untested, and requires building from source, or installing via Cargo for now.

    opened by David-OConnor 9
  • Create a `brew` formula

    Create a `brew` formula

    It would be great to add brew formula for Mac users.

    enhancement 
    opened by orreksu 8
  • Small Feature suggestion: Add 'shell' command to activate the venv for the currently selected Python version

    Small Feature suggestion: Add 'shell' command to activate the venv for the currently selected Python version

    Just thought it might be a nice little feature to have a pyflow shell command which activates the current python version's venv. Users can obviously easily do this themselves. However, this is similar to how pyenv, Poetry and pipenv do it and I believe it's valid to include it as a feature rather than for users seeking this function to do it themselves.

    Considering the simplified nature of having all python installments and their venv in the folder __pypackages__, the solution seems simple. Simply put, pyflow shell does:

    # Mac
    source __pypackages__/[current_python_version]/.venv/Scripts/activate
    
    # Windows (powershell)
    .\__pypackages__\[current_python_version]\.venv\Scripts\activate
    

    Again, this is something many users might know how to do themselves, but a user always needs to:

    1. Find the .venv folder (First time use)
    2. Realize what version is current (If more than one version is installed)
    3. Write this whole thing out, because it cannot be easily generalized in an alias

    Compared to pyflow shell the steps are: 1) Type pyflow shell 😄

    opened by Haffi921 0
  • GitHub Action to lint Python code

    GitHub Action to lint Python code

    Test results: https://github.com/cclauss/pyflow-1/actions

    opened by cclauss 0
  • PEP 621

    PEP 621

    I learned about this project recently while reading up on PEP 621 and PEP 665(draft).

    Since there's an official way to represent most of the info in the [tool.pyflow] sections, will this project support that method? Currently I'm using Poetry and it seems that there is a ton of push-back on the new format for some reason.

    I'd be happy to contribute the support if it's welcome but just not planned.

    opened by dbanty 1
  • Is there support for --no-binary?

    Is there support for --no-binary?

    Hi,

    I often depend on Cartopy which can only be installed when using the --no-binary flag with pip (or via Conda; shapely is the underlying trouble maker, see for example https://scitools.org.uk/cartopy/docs/latest/installing.html; also note that there are no plans to change this).

    So I was wondering if Pyflow supports --no-binary already? I couldn't tell from the docs.

    opened by Eisbrenner 0
  • Packages in sub-directory src/ or equivalent of setuptools find_packages(where=

    Packages in sub-directory src/ or equivalent of setuptools find_packages(where="src")

    If I put my package dir under src/ sub-directory, not in directory next to pyproject.toml, how do I tell pyflow about that? In poetry, it's defined as:-

    [tool.poetry]
    ...
    packages = [
        { include = "testflow", from = "src" },
    ]
    
    opened by k4ml 1
  • rpm link broken

    rpm link broken

    It says:

    Fedora, CentOs, RedHat, or older versions of SUSE - Download and run this rpm.

    But the release asset is not there https://github.com/David-OConnor/pyflow/releases/tag/0.3.1 (404 at https://github.com/David-OConnor/pyflow/releases/download/0.3.1/pyflow-0.3.1.x86_64.rpm)

    When attempting to use the built executable instead (RHEL 7.7), I get the same error as in #50

    $ pyflow --help
    pyflow: /lib64/libc.so.6: version `GLIBC_2.18' not found (required by pyflow)
    
    opened by wimglenn 2
  • pyflow install pyinfra - charset-normalizer version issue

    pyflow install pyinfra - charset-normalizer version issue

    Hello, I installed pyflow 0.3.1 via .deb then tried to install pyinfra, but having an issue.

    Similarly to #139 there is a problem with charset-normalizer. What is different is the traceback, so I decided to open this issue as well.

    $ RUST_BACKTRACE=full pyflow install pyinfra --dev
    thread 'main' panicked at 'Can't find a valid version for charset-normalizer', src/dep_resolution.rs:396:40
    
    stack backtrace:
       0:     0x55694419acd0 - <unknown>
       1:     0x5569441c237c - core::fmt::write::h7aa6cd0067dca82a
       2:     0x556944193bd5 - <unknown>
       3:     0x55694419d1eb - <unknown>
       4:     0x55694419ccc1 - <unknown>
       5:     0x55694419d891 - std::panicking::rust_panic_with_hook::hde05f051c0c95c4a
       6:     0x55694419d397 - <unknown>
       7:     0x55694419b1cc - <unknown>
       8:     0x55694419d2f9 - rust_begin_unwind
       9:     0x556943d9c26b - std::panicking::begin_panic_fmt::hf6913515f24c4986
      10:     0x556943e5cc68 - <unknown>
      11:     0x556943e5ca82 - <unknown>
      12:     0x556943e5d8a4 - <unknown>
      13:     0x556943e0bf71 - <unknown>
      14:     0x556943e0ce9a - <unknown>
      15:     0x556943e0ce9a - <unknown>
      16:     0x556943e0ce9a - <unknown>
      17:     0x556943e0ce9a - <unknown>
      18:     0x556943e5fc72 - <unknown>
      19:     0x556943e44c50 - <unknown>
      20:     0x556943e4dc6a - <unknown>
      21:     0x556943e6eaf3 - <unknown>
      22:     0x556943e6eb09 - <unknown>
      23:     0x55694419dd89 - std::rt::lang_start_internal::h0be9e1ee5c908dcd
      24:     0x556943e544a2 - <unknown>
      25:     0x7f0daa9c609b - __libc_start_main
      26:     0x556943d9d7d9 - <unknown>
      27:                0x0 - <unknown>
    
    opened by paolodina 1
  • Running a python file within a project from different directory

    Running a python file within a project from different directory

    I want to delegate isolation of python app to pyflow. For that I would want to run a python app while PATH is set to an arbitrary value, not necessarily a root project path. However, I cannot do that with pyflow, since it requires the cwd to be set to the root project path. Am I doing something wrong?

    For example:

    cd ~/data
    pyflow ~/apps/myapp/app.py appdata.csv
    

    returns

    To get started, run `pyflow new projname` to create a project folder, or `pyflow init` to start a project in this folder. For a list of what you can do, run `pyflow help`.
    
    opened by mnowotnik 0
  • Failure to resolve requests

    Failure to resolve requests

    Pyflow is unable to resolve the dependencies for the recently-released [email protected]:

    $ cat << EOF >pyproject.toml
    [tool.pyflow]
    name = ""
    py_version = "3.9"
    version = "0.1.0"
    
    [tool.pyflow.dependencies]
    requests = "2.26.0"
    
    [tool.pyflow.dev-dependencies]
    EOF
    
    $ pyflow install
    thread 'main' panicked at 'Can't find a valid version for charset-normalizer', src/dep_resolution.rs:396:40
    

    The constraint is charset_normalizer~=2.0.0; python_version >= "3" (which is new and why this issue is absent with <2.26.0.

    Stacktrace thread 'main' panicked at 'Can't find a valid version for charset-normalizer', src/dep_resolution.rs:396:40 stack backtrace:
       0:        0x1050eb46e - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h7dac4b58aa11870a
       1:        0x10512795e - core::fmt::write::h53badd02f711efbe
       2:        0x1050e6cea - std::io::Write::write_fmt::hd02c4bbaf6463567
       3:        0x105104eff - std::panicking::default_hook::{{closure}}::ha7d22468d4529f02
       4:        0x105104a8a - std::panicking::default_hook::hc6c5fb91e7ed228a
       5:        0x105105470 - std::panicking::rust_panic_with_hook::h94fd567d38cd4da7
       6:        0x1050eb7e5 - std::panicking::begin_panic_handler::{{closure}}::h953a8f32e4882703
       7:        0x1050eb5e8 - std::sys_common::backtrace::__rust_end_short_backtrace::h8472811b9ff0c597
       8:        0x105105003 - _rust_begin_unwind
       9:        0x10514423b - std::panicking::begin_panic_fmt::h9c97df342e1c7161
      10:        0x104da5ad2 - pyflow::dep_resolution::res::get_version_info::{{closure}}::hb545d75cbdd8ee35
      11:        0x104da5927 - pyflow::dep_resolution::res::get_version_info::h164e61570e4fbf22
      12:        0x104da667e - pyflow::dep_resolution::res::fetch_req_data::he1e3ae54a315fe0b
      13:        0x104d5324b - pyflow::dep_resolution::guess_graph::h629ca7b25eeb402b
      14:        0x104d53ea7 - pyflow::dep_resolution::guess_graph::h629ca7b25eeb402b
      15:        0x104da85c7 - pyflow::dep_resolution::res::resolve::ha8d660d5714f8d77
      16:        0x104d8b63d - pyflow::sync::hb14bfa7e6e96198f
      17:        0x104d947a4 - pyflow::main::hb5af5a8dc99f5ad6
      18:        0x104dbbd6a - std::sys_common::backtrace::__rust_begin_short_backtrace::h00b61639f172e865
      19:        0x104dbd52c - std::rt::lang_start::{{closure}}::h4ff407d06b350d61
      20:        0x10510e61a - std::rt::lang_start_internal::h43b407d2a4fa0408
      21:        0x104d9b089 - _main
    
    bug 
    opened by branchvincent 2
  • Improving support for macOS

    Improving support for macOS

    It seems pyflow support for macOS is a bit lagging compared to Linux and Windows. I tried running a script and got the following message:

    $ pyflow script script.py
    Please enter the Python version for this project: (eg: 3.8)
    Default [2.7.16]:3.8
    Automatic installation of Python 3.8 on Mac is currently unsupported. If you'd like to use this version of Python, please install it.
    

    I would be happy to try and improve Mac support, but it would be helpful to know the general steps required to get this (or any other blocking Mac-specific issues) resolved.

    opened by matteosantama 3
Releases(0.3.1)
Owner
David O'Connor
David O'Connor
Python dependency management and packaging made easy.

Poetry: Dependency Management for Python Poetry helps you declare, manage and install dependencies of Python projects, ensuring you have the right sta

Poetry 16.8k Oct 22, 2021
pip-run - dynamic dependency loader for Python

pip-run provides on-demand temporary package installation for a single interpreter run. It replaces this series of commands (or their Windows equivale

Jason R. Coombs 61 Oct 2, 2021
Python Development Workflow for Humans.

Pipenv: Python Development Workflow for Humans [ ~ Dependency Scanning by PyUp.io ~ ] Pipenv is a tool that aims to bring the best of all packaging wo

Python Packaging Authority 22.4k Oct 24, 2021
:package: :fire: Python project management. Manage packages: convert between formats, lock, install, resolve, isolate, test, build graph, show outdated, audit. Manage venvs, build package, bump version.

THE PROJECT IS ARCHIVED Forks: https://github.com/orsinium/forks DepHell -- project management for Python. Why it is better than all other tools: Form

DepHell 1.7k Oct 22, 2021
Solaris IPS: Image Packaging System

Solaris Image Packaging System Introduction The image packaging system (IPS) is a software delivery system with interaction with a network repository

Oracle 47 Sep 17, 2021
A set of tools to keep your pinned Python dependencies fresh.

pip-tools = pip-compile + pip-sync A set of command line tools to help you keep your pip-based packages fresh, even when you've pinned them. You do pi

Jazzband 5.3k Oct 22, 2021
A Poetry plugin for dynamically extracting the package version.

Poetry Version Plugin A Poetry plugin for dynamically extracting the package version. It can read the version from a file __init__.py with: # __init__

Sebastián Ramírez 148 Oct 9, 2021
Install and Run Python Applications in Isolated Environments

pipx — Install and Run Python Applications in Isolated Environments Documentation: https://pipxproject.github.io/pipx/ Source Code: https://github.com

null 4.2k Oct 22, 2021
Conan - The open-source C/C++ package manager

Conan Decentralized, open-source (MIT), C/C++ package manager. Homepage: https://conan.io/ Github: https://github.com/conan-io/conan Docs: https://doc

Conan.io 5.3k Oct 22, 2021
The Fast Cross-Platform Package Manager

The Fast Cross-Platform Package Manager part of mamba-org Package Manager mamba Package Server quetz Package Builder boa mamba Mamba is a reimplementa

Mamba 2.3k Oct 24, 2021
Simple Library Management made with Python

Installation pip install mysql-connector-python NOTE: You must make a database (library) & and table (books, student) to hold all data. Languange and

SonLyte 8 Oct 13, 2021
The Python package installer

pip - The Python Package Installer pip is the package installer for Python. You can use pip to install packages from the Python Package Index and othe

Python Packaging Authority 7.5k Oct 23, 2021
For when Poetry just doesn't work.

Ballad For when Poetry just doesn't work. Have you tried setting up Poetry, but something doesn't work? Maybe you're... Trying to implement Github Act

BD103 4 Sep 22, 2021
OS-agnostic, system-level binary package manager and ecosystem

Conda is a cross-platform, language-agnostic binary package manager. It is the package manager used by Anaconda installations, but it may be used for

Conda 4.3k Oct 23, 2021
OS-agnostic, system-level binary package manager and ecosystem

Conda is a cross-platform, language-agnostic binary package manager. It is the package manager used by Anaconda installations, but it may be used for

Conda 4.3k Oct 16, 2021
A PyPI mirror client according to PEP 381 http://www.python.org/dev/peps/pep-0381/

This is a PyPI mirror client according to PEP 381 + PEP 503 http://www.python.org/dev/peps/pep-0381/. bandersnatch >=4.0 supports Linux, MacOSX + Wind

Python Packaging Authority 263 Oct 17, 2021
A PyPI mirror client according to PEP 381 http://www.python.org/dev/peps/pep-0381/

This is a PyPI mirror client according to PEP 381 + PEP 503 http://www.python.org/dev/peps/pep-0381/. bandersnatch >=4.0 supports Linux, MacOSX + Wind

Python Packaging Authority 262 Oct 11, 2021
Python PyPi staging server and packaging, testing, release tool

devpi: PyPI server and packaging/testing/release tool This repository contains three packages comprising the core devpi system on the server and clien

null 500 Oct 23, 2021
[DEPRECATED] YUM package manager

⛔ This project is deprecated. Please use DNF, the successor of YUM. YUM Yum is an automatic updater and installer for rpm-based systems. Included prog

null 94 Aug 5, 2021