Skip to content

Instantly share code, notes, and snippets.

PEP 426 (Withdrawn) - Metadata for Python Software Packages 2.0
PEP 440 - Version Identification and Dependency Specification
PEP 449 - Removal of the PyPI Mirror Auto Discovery and Naming Scheme
PEP 453 - Explicit bootstrapping of pip in Python installations
PEP 464 - Removal of the PyPI Mirror Authenticity API
PEP 470 - Removing External Hosting Support on PyPI
PEP 477 - Backport ensurepip (PEP 453) to Python 2.7
PEP 481 (Withdrawn) - Migrate CPython to Git, Github, and Phabricator
- I won the spiritual victory though, since PEP 512 by Brett Cannon moved CPython to Github
PEP 503 - Simple Repository API
name version downloads
pip 22.1.2 2896110493
pip 21.0.1 2138411315
pip 22.0.4 1595433981
pip 21.3.1 1348723894
pip 20.0.2 1030557836
requests 2.26.0 811592632
pip 20.2.2 651539904
pip 20.1 532628196
pip 21.2.4 467888698
import requests
import zlib
import struct
import json
import html5lib
import re
import pprint
_gzip_header = b"\x1f\x8b\x08\x00\x00\x00\x00\x00\x02\xff"
@dstufft
dstufft / convert.py
Last active November 24, 2021 18:02
#!/usr/bin/env python3
import argparse
import os
import os.path
import shutil
import sys
import zipfile
import tarfile
import tempfile
import gzip
SELECT
ROUND(100 * SUM(CASE WHEN REGEXP_EXTRACT(details.installer.version, r"^([^\.]+)") IN ("18", "19") THEN 1 ELSE 0 END) / COUNT(*), 1) AS supports_518,
COUNT(*) as downloads
FROM `the-psf.pypi.downloads*`
WHERE
_TABLE_SUFFIX BETWEEN FORMAT_DATE("%E4Y%m%d", DATE_SUB(CURRENT_DATE(), INTERVAL 30 DAY))
AND FORMAT_DATE("%E4Y%m%d", CURRENT_DATE())
AND details.installer.name = 'pip'
AND file.project = 'cryptography'
LIMIT 100
Month Percent Py3
201901 36.2%
201812 36.3%
201811 38.4%
201810 39.7%
201809 36.2%
201808 36.6%
201807 35.5%
201806 34.9%
from github3 import login
gh = login(token="...")
python = gh.organization("python")
for team in python.teams():
if team.slug == "python-core":
core_developers = team
break
from wsgiref.simple_server import make_server
from pyramid.config import Configurator
from pyramid_retry import RetryableException, IBeforeRetry
def on_before_retry(event):
print("A Retry!")
def hello_world(request):
# Prime the Cache
$ time python setup.py build --build-base ~v/tmp-ec63b471f919101/cache/
...
python setup.py build --build-base ~v/tmp-ec63b471f919101/cache/ 76.24s user 4.16s system 96% cpu 1:23.33 total
# Test in place rebuilds
$ time python setup.py build --build-base ~v/tmp-ec63b471f919101/cache/
...
python setup.py build --build-base ~v/tmp-ec63b471f919101/cache/ 0.81s user 0.27s system 84% cpu 1.265 total
# US-East-1 Has 5 availability zones, and we want to split our network over all
# of them. So we will do a /19 per AZ which will give us the ability to expand
# up to 8 total AZs or to add more capacity in 3/5 of the other AZs if need be.
# If for some reason this is being run in a region with less AZs, we will just
# have more left over capacity being reserved as a spare. In addition, we will
# split our allocation within each AZ up into a /20 for all of our private
# instances, a /21 for all of our public instances, and a /21 left over for
# spare capacity. This will give us the largest block of IP addresses for our
# private tier, where most of our instances will reside, while still leaving
# spare allocation for the future.