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 / 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
# 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")
#!/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 / 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.

@henryiii
henryiii / 04_runge_kutta.ipynb
Created January 23, 2020 06:09
RungeKutta Example
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#!/usr/bin/env python3
from argparse import ArgumentParser
from pathlib import Path
from textwrap import indent
import curses
import unicodedata
FOLDER_OPEN = unicodedata.lookup('Open File Folder')
FOLDER_CLOSED = unicodedata.lookup('File Folder')
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.