Skip to content

Instantly share code, notes, and snippets.

View shaib's full-sized avatar

Shai Berger shaib

View GitHub Profile
@shaib
shaib / console.log
Created July 3, 2022 15:02
poetry add fails to update constraint for packages with a capitalized name
$ poetry add -vvv django=~4.0.0
Using virtualenv: /home/slate/.cache/pypoetry/virtualenvs/demo-hKjNfXom-py3.10
PyPI: No release information found for django-1.0.1, skipping
PyPI: No release information found for django-1.0.2, skipping
PyPI: No release information found for django-1.0.3, skipping
PyPI: No release information found for django-1.0.4, skipping
PyPI: No release information found for django-1.1, skipping
PyPI: No release information found for django-1.1.1, skipping
PyPI: No release information found for django-1.1.2, skipping
PyPI: 6 packages found for django >=4.0.0,<4.1.0
@shaib
shaib / console.log
Created May 4, 2022 13:14
Session with Poetry issue
$ poetry init
This command will guide you through creating your pyproject.toml config.
Package name [test2]:
Version [0.1.0]:
Description []:
Author [Shai Berger <[email protected]>, n to skip]:
License []:
Compatible Python versions [^3.10]:
@shaib
shaib / py3_fix_super_calls.md
Last active January 13, 2021 15:44 — forked from agmond/py3_fix_super_calls.py
Fix `super()` calls after migration to Python3

The following script fixes super() calls after migration from Python 2 to Python 3. The script edits the code automatically. Upon completion, the following steps are recommended:

  • Search for the regex super\([^\)] and fix manually those places (if needed)
  • Search for the regex super\(\s[^\)] and fix manually those places (if needed)
  • Run Flake8 and manually fix styling problems
@shaib
shaib / orphan.py
Last active April 18, 2020 12:27
Generating single-frame stacktraces
import time as time_module
import pprint
import collections
import traceback as traceback_module
import itertools
import threading
import sys
import inspect
@shaib
shaib / kmaildir_mbox_sub.py
Created October 14, 2017 17:55 — forked from scrinzi/kmaildir_mbox_sub.py
Migrate from KMail to ThunderBird
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Armin Scrinzi, August 4, 2012
Frédéric Grosshans, 19 January 2012
Nathan R. Yergler, 6 June 2010
This file does not contain sufficient creative expression to invoke
assertion of copyright. No warranty is expressed or implied; use at
your own risk.