Tag: python

How to rebase with pygit2?

I’m stuck trying to implement a git rebase with pygit2. Assuming this repo history, how to rebase topic on master using pygit2 ? (ie, the equivalent of git rebase master topic): A—B—C topic / D—E—F—G master According to pygit2 documentation, merge_trees can be used to this end. So far, I got: import pygit2 as git […]

execute git command in a remote machine using paramiko

I have written a code to execute git command in a remote server but i never executed Step 1: Login to remote server Step 2: change dir to git repository Step 3: execute git clean -fdx command Below is the sample code try: ssh = paramiko.SSHClient() sssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) ssh.connect(dummyipaddress, username=”john”, password=”philips”) except (paramiko.BadHostKeyException, paramiko.AuthenticationException, paramiko.SSHException) as […]

Using gitpython to diff changes from a pull request

I’m trying to write a script that will be triggered by a pull request github webhook. When this script is triggered, it needs to find out which files were modified from master to newBranch. End of day, I’ll read through those files, verify that no breaking changes were made, and then write up why it […]

boost_python3 missing from ubuntu 16.04

I am trying to install boost.numpy in y Ubuntu 16.04. I tried these commnads to install boost.numpy **git clone https://github.com/ndarray/Boost.NumPy.git cd Boost.NumPy && mkdir build && cd build cmake -DPYTHON_LIBRARY=$HOME/anaconda3/lib/libpython3.5m.so ../** After doing cmake i am facing this error: Detected architecture ‘x86_64’ — Using Python3 CMake Error at /usr/share/cmake-3.5/Modules/FindBoost.cmake:1677 (message): Unable to find the requested […]

Python, making a wheel file

I am trying to make wheel file and I want to add git repo in dependencies but I the following message appeared: error in me-pkg setup command: ‘install_requires’ must be a string or list of strings containing valid project/version requirement specifiers; Invalid requirement, parse error at “‘+ssh://g'”. The question is; How can I put git […]

Prevent pdb or pytest set_trace from being committed using a pre commit hook

I’d like to create a git pre commit hook that prevents an uncommented pytest.set_trace() or a pdb.set_trace() and other .set_trace(). This is because I debug from the command line often and sometimes forget that I left the debug statement in the code. By using a pre commit hook, I should be able to avoid this […]

Can't get Meld 1.1.5 to run correctly on headless RHEL 5.3

I desperately need to be able to run Meld on a headless RHEL 5.3 VM (ssh -X <hostname> on Linux or PuTTY + Xming on Windows—I get the exact same error—see below). I’ve had no problems with installing Meld using yum on previous versions of RHEL I had, but this is a customized corporate VM […]

Python: trying to use third party libraries in git hooks

I am trying to utilise the javalang module in my pre-commit hook but I get an error on the line where it is trying to install javalang. I don’t know why this is happening because I have installed javalang by using pip through my terminal. I have attached a screenshot of the error, can anyone […]

gitpython to check for if there are any changes in files using PYTHON

I am experimenting with gitpython and I am new to it. I am trying to detect if there are any changes staged for commit. Currently, I have a function that looks like this: def commit(dir): r = Repo(dir) r.git.add(A=True) r.git.commit(m=’commit all’) But this is just the code to commit the directory. I wanna do something […]

How do I tell pip to install from git if older than a specified version

Packages published to PYPI can be installed with something like pip install ‘foo>=3.0.0′ How how to tell pip to install unreleased version from a git url by keeping the same version condition? This is important when you need to use an unreleased version but you don’t want to force using unreleased versions all the time. […]

Git Baby is a git and github fan, let's start git clone.