This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/python | |
""" | |
A dead-simple script to perform bulk operations in all python virtualenvs installed | |
""" | |
import argparse | |
import os | |
import subprocess | |
import glob |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import sys | |
import shutil | |
import subprocess | |
import argparse | |
# Set up command-line argument parser | |
parser = argparse.ArgumentParser(description='Set up a virtual environment.') | |
parser.add_argument('--env-dir', '-d', type=str, required=True, | |
help='Directory where the virtual environment should be set up.') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
""" | |
Bootstrap script for prepare environ for project | |
""" | |
import os | |
import subprocess | |
import optparse | |
import sys |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import shlex | |
import subprocess | |
from subprocess import Popen | |
from pathlib import Path | |
class VirtualEnv(object): | |
""" | |
Create a VirtualEnv context manager. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### GIT | |
source ~/.bash/gitprompt.sh | |
if [ -f ~/.git-completion.bash ]; then | |
. ~/.git-completion.bash | |
fi | |
alias gss="git status --short" | |
alias gl="git log --pretty=format:'%Cred%h%Creset - %C(green) %an %C(reset) - %C(yellow)%d%Creset %s %Cgreen(%cr) %Creset'" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import subprocess | |
import shutil | |
import os | |
import sys | |
import tarfile | |
def get_version(project_root): | |
process = subprocess.Popen( | |
['git', 'describe'], | |
stdout=subprocess.PIPE, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# symlink a system package or module into the current virtual env | |
import logging | |
import optparse | |
import os | |
import sys | |
import shutil | |
import subprocess | |
import pickle |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
# | |
# | |
# To generate DEB package from Python Package: | |
# sudo pip3 install stdeb | |
# python3 setup.py --verbose --command-packages=stdeb.command bdist_deb | |
# | |
# | |
# To generate RPM package from Python Package: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# | |
# uvs: A stand-in for the yet-to-exist `uv shell` subcommand | |
# | |
# Copyright 2024 Rob Gilton | |
# | |
# Redistribution and use in source and binary forms, with or without | |
# modification, are permitted provided that the following conditions | |
# are met: | |
# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
This script creates a virtual environment and updates its dependencies. | |
The following features are supported. | |
- The script checks if the venv exists. If it does it will not recreate it. | |
- The script checks if the requirements.txt has changed. If it has, packages of the venv will be updated. | |
- The script checks if itself has changed. If it has, the venv will be recreated. | |
""" | |
import os |