FADES(1)

🌈 hey bestie, it's fades(1) 🌈

welcome to the manual page for fades, straight outta the General Commands Manual. yes the title line up top says FADES(1) and the footer says it too, and we're folding all that in right here so we can get to the good part. buckle up, this one's a banger. πŸ’…


✨ NAME ✨

fades β€” a system that automagically handles the virtualenvs in the cases normally found when writing scripts and simple programs, and honestly? it even helps administer big projects too. no cap. πŸ‘‘


πŸŽ€ SYNOPSIS πŸŽ€

fades [-h][--help] [-V][--version] [-v][--verbose] [-q][--quiet]
[-i][--ipython] [-d][--dependency] [-r][--requirement] [-x][--exec] [-p
version][--python=version] [--rm=UUID] [--system-site-packages]
[--virtualenv-options=options] [--pip-options=options] [--python-
options=options] [--check-updates] [--clean-unused-
venvs=max_days_to_keep] [--get-venv-dir] [--no-precheck-availability]
[-a][--autoimport] [--freeze] [-m][--module] [--avoid-pip-upgrade]
[child_program [child_options]]

so you can run fades to execute your script directly, or you can slap it in a #! at the top of your script's beginning and let it do its thing. both slay. πŸ¦‹


πŸ’– DESCRIPTION πŸ’–

fades will automagically create a brand new virtualenv (or reuse a previous created one), install the necessary dependencies, and execute your script inside that virtualenv. the only requirement is that you execute the script with fades and also mark the required dependencies. that's it. that's the whole thing. 🫢

the first non-option parameter (if there is one) would be then the child program to execute, and any other parameters after that get passed as is to that child script.

fades can also be executed without passing a child script to execute: in this mode it will open a Python interactive interpreter inside the created/reused virtualenv (taking dependencies from the --dependency or --requirement options). and if you give it --autoimport, it will automatically import all the installed dependencies. main character energy fr fr. ✨

and okay, plot twist: if the child_program parameter is really an URL, the script will be automatically downloaded from there β€” and yes it supports the most common pastebins URLs too: pastebin.com, linkode.org, gist, etc. πŸ’€ iconic behaviour honestly.


πŸ‘‘ OPTIONS πŸ‘‘

  • -h, --help β€” show help about all the parameters and options, then quit. πŸŽ€
  • -V, --version β€” show the program version plus info about the system, then quit. πŸ‘‘
  • -v, --verbose β€” send all internal debugging lines to stderr. this is the one you want when a problem arises, it may be very useful. πŸ”
  • -q, --quiet β€” don't show anything (unless it has a real problem), so the original script stderr is not polluted at all. clean vibes only. 🧼
  • -i, --ipython β€” runs IPython shell instead of python ones. fancy. πŸ’…
  • -d, --dependency β€” specify dependencies straight through the command line. this option can be specified multiple times (once per dependency), and each time the format is repository::dependency. the dependency may have versions specifications, and the repository is optional (it will infer it). examples:
requests
pypi::requests > 2.3
requests<=3
git+https://github.com/kennethreitz/requests.git#egg=requests
vcs::git+https://github.com/kennethreitz/requests.git#egg=requests

see more examples below for real command line usage explanations. πŸ“

  • -r, --requirement β€” read the dependencies from a file. format in each line is the same as dependencies specified with --dependency. this option can be specified multiple times. πŸ“„
  • -p version, --python=version β€” select which Python version to be used; the argument can be just the number (2.7), the whole name (python2.7) or the whole path (/usr/bin/python2.7). of course, the corresponding version of Python needs to be installed in your system. πŸ’€

the dependencies can be indicated in multiple places (in the Python source file, with a comment besides the import, in a requirementsfile, and/or through command line). in case of multiple definitions of the same dependency, command line overrides everything else, and requirements file overrides what is specified in the source code. periodt. πŸ‘‘

  • -x, --exec β€” execute the child_program in the context of the virtualenv. the child_program, which in this case becomes a mandatory parameter, can be just the executable name (relative to the venv's bin directory) or an absolute path. πŸƒ
  • --rm UUID β€” remove a virtualenv by UUID. see the --get-venv-dir option to easily find out the UUID. πŸ—‘οΈ
  • --system-site-packages β€” give the virtual environment access to the system site-packages dir. 🌐
  • --virtualenv-options=VIRTUALENV_OPTION β€” extra options to be supplied to virtualenv. (this option can be used multiple times) 🧰
  • --pip-options=PIP_OPTION β€” extra options to be supplied to pip. (this option can be used multiple times) πŸ“¦
  • --python-options=PYTHON_OPTION β€” extra options to be supplied to python. (this option can be used multiple times) 🐍
  • --check-updates β€” will check for updates in PyPI to verify if there are new versions for the requested dependencies. if a new version is available for a dependency, it will use it (if the dependency was requested without version) or just inform which new version is available (if the dependency was requested with a specific version). πŸ””
  • --clean-unused-venvs=MAX_DAYS_TO_KEEP β€” will remove all virtualenvs that haven't been used for more than MAX_DAYS_TO_KEEP days. spring cleaning bestie 🧹
  • --get-venv-dir β€” show the virtualenv base directory (which includes the virtualenv UUID) and quit. πŸ“
  • --no-precheck-availability β€” don't check if the packages exists in PyPI before actually try to install them. πŸ™ˆ
  • -a, --autoimport β€” automatically import the dependencies when in interactive interpreter mode (ignored otherwise). ✨
  • --freeze FILEPATH β€” will operate exactly as without the command, but also it will dump the revisions of installed dependencies to the given filepath. 🧊
  • -m, --module β€” run library module as a script (same behaviour than Python's -m parameter). 🎬
  • --avoid-pip-upgrade β€” disable the automatic pip upgrade that happens after the virtualenv is created and before the dependencies begin to be installed. 🚫

🌸 EXAMPLES 🌸

  • fades foo.py --bar

executes foo.py under fades, passing the --bar parameter to the child program, in a virtualenv with the dependencies indicated in the source code. πŸŽ€

  • fades -v foo.py

executes foo.py under fades, showing all the fades messages (verbose mode). πŸ”Š

  • fades -d dependency1 -d dependency2>3.2 foo.py --bar

executes foo.py under fades (passing the --bar parameter to it), in a virtualenv with the dependencies indicated in the source code and also dependency1 and dependency2 (any version > 3.2). πŸ’œ

  • fades -d dependency1

executes the Python interactive interpreter in a virtualenv with dependency1 installed. 🐍

  • fades -r requirements.txt

executes the Python interactive interpreter in a virtualenv after installing there all dependencies taken from the requirements.txt file. πŸ“„

  • fades -r requirements.txt -r requirements_devel.txt

executes the Python interactive interpreter in a virtualenv after installing there all dependencies taken from files requirements.txt and requirements_devel.txt. ✨


πŸ¦‹ USING CONFIGURATION FILES πŸ¦‹

you can also configure fades using .ini config files. fades will search config files in /etc/fades/fades.ini, the path indicated by xdg for your system (for example ~/config/fades/fades.ini) and .fades.ini. so you can have different settings at system, user and project level. layering, we love to see it. πŸ’…

the config files are in .ini format. (configparser) and fades will search for a [fades] section. you have to use the same configurations that in the CLI. the only difference is with the config options with a dash β€” it has to be replaced with a underscore. πŸŽ€

check http://fades.readthedocs.org/en/latest/readme.html#setting-options-using-config-files for full examples. πŸ“š


πŸ”₯ SEE ALSO πŸ”₯

development is centralized in https://github.com/PyAr/fades πŸ‘‘

check that site for a better explanation of fades usage. go read it bestie, it's giving documentation. πŸ’–


🫢 AUTHORS 🫢

Facundo Batista, NicolΓ‘s Demarchi (see development page for contact info). legends, honestly. πŸ‘‘


πŸ’œ LICENSING πŸ’œ

this program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License version 3, as published by the Free Software Foundation. πŸŽ€


and that's the whole page bestie!! πŸ’– this was the fades(1) page from the General Commands Manual β€” that's the source/version vibe and the date-stamp of the manual, folded right in here for you. now go make some virtualenvs, you absolute icon. βœ¨πŸ’…πŸ¦‹