Skip to content

Instantly share code, notes, and snippets.

View henryiii's full-sized avatar
👨‍🍼
New baby

Henry Schreiner henryiii

👨‍🍼
New baby
View GitHub Profile
@henryiii
henryiii / LICENSE
Last active February 7, 2024 03:21
Download all pyproject.tomls
MIT License
Copyright (c) 2023 Françoise CONIL
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@henryiii
henryiii / git-all.bash
Last active April 29, 2023 15:13
Fast repository status for repos in git folder
#!/usr/bin/env bash
# This script should be named (or symbolically linked) as git-all so that
# it can be run as a git command (if it is in the path). The repo location should
# be set in REPOLOC. Can be relative if this script is also in a repo!
# Standard bash stuff to get the current directory
unset CDPATH
SOURCE="${BASH_SOURCE[0]}"
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
#!/usr/bin/env python3
import sys
import re
import os
testCaseRegex = re.compile(r"TEST\s*\((\w+),\s*(\w+)\)")
testFixtureRegex = re.compile(r"TEST_F\s*\((\w+),\s*(\w+)\)")
expectRegex = re.compile(r"EXPECT_(\w+)\s*\((.*)\);")
assertRegex = re.compile(r"ASSERT_(\w+)\s*\((.*)\);")
@henryiii
henryiii / cards.py
Last active October 13, 2022 01:18
base for card games
# -*- coding: utf-8 -*-
"""
Created on Sun Jul 20 17:27:33 2014
@author: henryiii
"""
# http://en.wikipedia.org/wiki/Playing_cards_in_Unicode
from __future__ import unicode_literals, division
@henryiii
henryiii / flake8_errmsg.py
Last active September 5, 2022 17:14
flake8 checker for error messages showing up unrendered in the traceback
#!/usr/bin/env python
"""
Flake8 checker for raw literals inside raises.
Requires Python 3.10. This can be run without Flake8 as well. Try:
git ls-files '*.py' | xargs python3 plugins/flake8_errmsg.py
Local use:
@henryiii
henryiii / example_all.py
Last active March 3, 2022 05:00
Example of a package builder (pyodide)
from graphlib import TopologicalSorter
import asyncio
import dataclasses
import yaml
from pathlib import Path
import functools
from typing import NoReturn
@functools.total_ordering
@henryiii
henryiii / h2048.py
Last active January 17, 2022 07:06
Pythonista 2048 clone, using ui module. Also should work in any Python console. Added jsbain's swipe implementation.
# -*- coding: utf-8 -*-
"""
Created on Sat Jul 12 09:33:29 2014
@author: henryiii
Added improvents by JonB (swipes), techteej (design), LawAbidingCactus (size)
"""
import console, random
# Run inside https://github.com/mayeut/manylinux-timeline
#
# Example nox file for those too lazy to set up a venv:
#
# import nox
#
# @nox.session(reuse_venv=True)
# def run(session):
# session.install("hist[plot]", "pandas")
# session.run("python", "make_hist.py")
@henryiii
henryiii / NextTry.py
Last active December 10, 2020 18:14
MyPy and Vectors
from __future__ import annotations # type: ignore
from typing import Protocol, TypeVar, Generic
T = TypeVar("T")
U = TypeVar("U")
V = TypeVar("V")
W = TypeVar("W")
@henryiii
henryiii / issue.md
Created June 4, 2020 01:12
pip issue description

Environment

  • pip version: latest
  • Python version: 3.5.4
  • OS: Windows

This happens when using nuget to get Python, and only on Python 3.5. Python 2.7 and 3.6-3.8 are just fine. I have only seen this problem on Windows. This is breaking cibuildwheel, which uses this setup. See pypa/cibuildwheel#358 - there you can see the logs. This may be true with any portable install, I'm not sure.

Description The surrounding environment is used when making a PEP 518 build, rather than the new one created for the build. When building with -v, it is making the environment, but it is not being used.