Skip to main content

fencepy

Development Status Latest Version Downloads/month Supported Python versions Wheel Status

Standardized fencing off of python virtual environments on a per-project basis. The idea is to take a directory as an input and create and manage a python virtual environment in a known location.

Master on Linux

Travis-ci build status Coveralls coverage (from travis)

Master on Windows

Appveyor build status This has proven to be an unstable build environment. Keeping it here for ease of checking up on the status manually.

How does it work?

fencepy is fairly simple. After parsing arguments, it calls out to the correct copy of virtualenv (based on the location of the running python interpreter) with a pre-generated base directory. Upon successful creation of the virtual environment, it applies various modifications based on the contents of the directory from which it was run.

Opinionated hooks

The goal is to make this framework attractive to users of other compatible products. For instance, as a user of git and sublime text, I added functionality related to those.

git

If the directory provided as input (defaults to cwd) is part of a git repository, the virtual environment created will be relative to the root of that repository.

sublime text

The sublime linter plugin is very easy to configure. Pointing it to a particular installation of python is as simple as putting some json into a configuration file. If there is a .sublime-project file in the input directory, then it will be configured to respect the virtual environment that is being created.

requirements.txt

As a helpful shortcut, if there is a requirements.txt file in the input directory, then those requirements will be installed upon virtualenv creation.

oh-my-zsh

If you use oh-my-zsh, when you set up your first fencepy environment, it will configure some shortcuts for you:

fpadd -> fencepy create
fpnew -> fencepy create
fpsrc -> . `fencepy activate`
fpup  -> fencepy update
fpdel -> fencepy erase

Usage

fencepy create: Create a new virtual environment

. `fencepy activate`: Activate the virtual environment in a bash-like shell

source (fencepy activate): Activate the virtual environment in fish shell

. $(fencepy activate): Activate the virtual environment in windows powershell

fencepy update: Re-run all plugins on an existing fencepy

fencepy erase: Remove the virtual environment

fencepy nuke: Remove all of fencepy’s virtual environments (for the obsessive cleaners out there)

fencepy genconfig: Create a config file with defaults in fencepy’s root directory

fencepy help: Get help on these and other optional arguments

Additional notes

Python versions

Both python 2 and 3 are supported. Additionally, both can be used for one project, as they will be stored in separate directories.

Cross-platform support

Both Windows and UNIX shells are supported! I have not yet figured out how to activate in one command from within CMD.exe. If anyone knows the solution, please let me know!

Extending fencepy

Additional functionality should be very easy to implement. Each of the hooks mentioned above is implemented as a “plugin” that takes the full dict of parsed arguments as input. Additionally, inverse cleanup methods are planned for the future.

Alternatives

Metadata

Release files for fencepy 0.7.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fencepy 0.7.2
File Size Uploaded Provenance Actions
fencepy-0.7.2.tar.gz 10.0 kB Without provenance Details for fencepy-0.7.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for fencepy 0.7.2
File Interpreter ABI Platform Actions
fencepy-0.7.2-py2.py3-none-any.whl Python 2, Python 3 none any Details for fencepy-0.7.2-py2.py3-none-any.whl

Total release size: 21.4 kB

Release files / fencepy-0.7.2.tar.gz

Download URL fencepy-0.7.2.tar.gz
Size 10.0 kB
Tags Source
SHA-256 checksum
How to use checksums
598c019ff0c61e3534dfd55a5f980076d33752f5dee2387f37fa7636858222fd
BLAKE2b-256 checksum
How to use checksums
72aa79415001ca8b16b98142719c382970dacacd385034c59a37e51a3d72c7ee
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / fencepy-0.7.2-py2.py3-none-any.whl

Download URL fencepy-0.7.2-py2.py3-none-any.whl
Size 11.3 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
4f77bf24185772b9512664a8bd07d8c449614cb0d268142656ab464329315bfc
BLAKE2b-256 checksum
How to use checksums
c574cd142f567004bb077f3d778f275bdf56e7076cb5487e2516b4864fe3eb82
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for fencepy 0.7.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page