This file contains 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
FROM ubuntu:noble | |
RUN apt update | |
RUN apt upgrade -y | |
RUN apt install -y software-properties-common | |
RUN apt-add-repository -y ppa:deadsnakes | |
RUN apt update | |
RUN apt install -y wget libarchive-tools | |
# Install Pythons |
This file contains 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 configparser | |
import pathlib | |
files = list(pathlib.Path().glob('*.desktop')) | |
assert files | |
def main(): | |
parser = configparser.ConfigParser(interpolation=None) | |
for shortcut in files: | |
parser.clear() |
This file contains 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
.pkg: _optional_hooks> python '/Users/jaraco/Library/Application Support/pipx/venvs/tox/lib/python3.14t/site-packages/pyproject_api/_backend.py' True setuptools.build_meta | |
.pkg: get_requires_for_build_editable> python '/Users/jaraco/Library/Application Support/pipx/venvs/tox/lib/python3.14t/site-packages/pyproject_api/_backend.py' True setuptools.build_meta | |
.pkg: build_editable> python '/Users/jaraco/Library/Application Support/pipx/venvs/tox/lib/python3.14t/site-packages/pyproject_api/_backend.py' True setuptools.build_meta | |
py: install_package> python -I -m pip install --force-reinstall --no-deps /Users/jaraco/code/jaraco/path/.tox/.tmp/package/49/path-17.0.1.dev26+g692a66e-0.editable-py3-none-any.whl | |
py: commands[0]> pytest -v | |
============================= test session starts ============================== | |
platform darwin -- Python 3.14.0a2+, pytest-8.3.4, pluggy-1.5.0 -- /Users/jaraco/code/jaraco/path/.tox/py/bin/python | |
cachedir: .tox/py/.pytest_cache | |
rootdir: /Users/jaraco/code/jaraco/path | |
configfile: pyt |
This file contains 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
Quick code examples demonstrating Python unpacking | |
Example 1.A - Multiple assignment using a list | |
>>> a, b, c = [1, 2, 3] | |
>>> a | |
1 | |
>>> b | |
2 |
This file contains 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
diff --git a/Lib/zipfile.py b/Lib/zipfile.py | |
index 9b66a9f054d..b21889694da 100644 | |
--- a/Lib/zipfile.py | |
+++ b/Lib/zipfile.py | |
@@ -2188,10 +2188,33 @@ def _difference(minuend, subtrahend): | |
return itertools.filterfalse(set(subtrahend).__contains__, minuend) | |
-class CompleteDirs(ZipFile): | |
+class InitializedState: |
This file contains 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
{"boto3": ["boto3"]} | |
{"urllib3": ["urllib3"]} | |
{"botocore": ["botocore"]} | |
{"requests": ["requests"]} | |
{"certifi": ["certifi"]} | |
{"typing-extensions": ["typing_extensions"]} | |
{"idna": ["idna"]} | |
{"charset-normalizer": ["charset_normalizer"]} | |
{"python-dateutil": ["dateutil"]} | |
{"setuptools": ["_distutils_hack", "pkg_resources", "setuptools"]} |
This file contains 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
from typing import Iterable | |
def unique(items): | |
return list(dict.fromkeys(items)) | |
class Tree: | |
def __init__(self, paths, at=""): | |
self.paths = tuple(paths) |
This file contains 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
🐚 pip install --disable-pip-version-check --quiet --ignore-installed --dry-run --report - coherent.build | jq '.install | .[].metad | |
ata| {name,version}' | |
{ | |
"name": "coherent.build", | |
"version": "0.19.3" | |
} | |
{ | |
"name": "jaraco.compat", | |
"version": "4.2.1" | |
} |
This file contains 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
distutils main @ git rebase -i 55982565e --rebase-merges | |
[detached HEAD 491cd2473] Merge pull request pypa/distutils#245 from DimitriPapadopoulos/FURB | |
Date: Sat Apr 13 09:32:32 2024 -0400 | |
[detached HEAD b3406caf9] Merge pull request pypa/distutils#247 from pypa/hotfix/246-linker-args-list | |
Date: Sat Apr 13 16:40:32 2024 -0400 | |
[detached HEAD 20a372ef0] Merge pull request pypa/distutils#239 from DimitriPapadopoulos/extra_pairs_of_quotes | |
Date: Sat Apr 13 20:16:59 2024 -0400 | |
Auto-merging pyproject.toml | |
CONFLICT (content): Merge conflict in pyproject.toml | |
Recorded preimage for 'pyproject.toml' |
This file contains 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
When rebasing a merge in git, is there a way to re-use an existing conflict resolution? | |
Show drafts | |
Yes, there are a few ways to reuse existing conflict resolutions when rebasing a merge in Git: | |
1. Rerere (Reuse Recorded Resolution): | |
Git has a built-in mechanism called "rerere" (reuse recorded resolution) that can automatically reuse previously resolved conflicts. | |
Enable it with git config --global rerere.enabled true. | |
When you encounter a conflict that you've already resolved before, Git will attempt to apply the same resolution. |
NewerOlder