git

The hook `black` requires pre-commit version 2.9.2 but version 2.6.0 is installed

The hook `black` requires pre-commit version 2.9.2 but version 2.6.0 is installed Question: I am having trouble with pre-commit and black. Everything worked fine until I cleared the cache with pre-commit clean. Now I always get the error The hook black requires pre-commit version 2.9.2 but version 2.6.0 is installed. Perhaps run `pip install –upgrade …

Total answers: 2

How to get git commit hash of python project using python code?

How to get git commit hash of python project using python code? Question: I have a git repository hosting a python project. It is code for long running simulations, that takes hours-days to complete. I manage the history with git, and run the simulations on a remote server, by pulling code. I have multiple copies …

Total answers: 1

Python – Upload files directly to github using PyGithub

Python – Upload files directly to github using PyGithub Question: I have a public repo and want to upload files to that repo using python (PyGithub library). I referred the below code from SO: import base64 from github import Github from github import InputGitTreeElement user = "GithubUsername" password = "*********" g = Github(user,password) repo = …

Total answers: 3

Adding files to gitignore in Visual Studio Code

Adding files to gitignore in Visual Studio Code Question: In Visual Studio Code, with git extensions installed, how do you add files or complete folders to the .gitignore file so the files do not show up in untracked changes. Specifically, using Python projects, how do you add the pycache folder and its contents to the …

Total answers: 4

How to download those files from github?

How to download those files from github? Question: I use windows and the Anaconda distribution of Python and git bash to read .sh files. I am not able to install files here : https://github.com/TalwalkarLab/leaf/tree/master/data/femnist I cloned the leaf folder in python using git bash and the command git clone https://github.com/TalwalkarLab/leaf.git As the readme.md file in …

Total answers: 2

VS Code multi-root workspace with one top level git repo

VS Code multi-root workspace with one top level git repo Question: I am working on a project that requires multiple Google Cloud Functions. Each Cloud Function has its own virtualenv because each has its own Python dependencies. All the Cloud Functions are related so I’ve added each folder containing the Cloud Function code to a …

Total answers: 2

Permission error cloning git repository in temporary folder

Permission error cloning git repository in temporary folder Question: Code in question can explain more than I can say in text I think. I’ve simplified it massively to keep it readable but in essence this is what I’m running. def main(): with tempfile.TemporaryDirectory() as td: for repo in repos: subprocess.run(“git clone –mirror {} {}”.format(os.path.join(td, repo.path), …

Total answers: 2

How to include git branch in installing from requirements in Python?

How to include git branch in installing from requirements in Python? Question: Hi I need to install from a branch of a git repo. I want to include it on the requirements.txt so that it would install using the command pip install -r requirements.txt What I know is how to install from master branch (See …

Total answers: 1

Git (git) not found when running buildozer in ubuntu

Git (git) not found when running buildozer in ubuntu Question: when trying to compile my kivy app with buildozer into apk in virtual ubuntu machine the following error appears: Debian ‘dpkg’ package management program version 1.19.0.5 (amd64). This is free software; see the GNU General Public License version 2 or later for copying conditions. There …

Total answers: 1