Skip to content

Commit 5c6cf02

Browse files
committed
clean up typeshed & freshen rdflib hints
1 parent 26751fc commit 5c6cf02

35 files changed

+158
-131
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
build/
77
dist/
88
ruamel
9-
typeshed/2and3/ruamel/yaml
9+
typeshed/ruamel/yaml
1010
# virtualenv
1111
venv/
1212
.cache/

Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -168,16 +168,16 @@ mypy3: mypy
168168
mypy: ${PYSOURCES}
169169
if ! test -f $(shell python3 -c 'import ruamel.yaml; import os.path; print(os.path.dirname(ruamel.yaml.__file__))')/py.typed ; \
170170
then \
171-
rm -Rf typeshed/2and3/ruamel/yaml ; \
171+
rm -Rf typeshed/ruamel/yaml ; \
172172
ln -s $(shell python3 -c 'import ruamel.yaml; import os.path; print(os.path.dirname(ruamel.yaml.__file__))') \
173-
typeshed/2and3/ruamel/ ; \
173+
typeshed/ruamel/ ; \
174174
fi # if minimally required ruamel.yaml version is 0.15.99 or greater, than the above can be removed
175-
MYPYPATH=$$MYPYPATH:typeshed/3:typeshed/2and3 mypy --disallow-untyped-calls \
175+
MYPYPATH=$$MYPYPATH:typeshed mypy --disallow-untyped-calls \
176176
--warn-redundant-casts \
177177
schema_salad
178178

179179
mypyc: ${PYSOURCES}
180-
MYPYPATH=typeshed/2and3/:typeshed/3 SCHEMA_SALAD_USE_MYPYC=1 python setup.py test
180+
MYPYPATH=typeshed SCHEMA_SALAD_USE_MYPYC=1 python setup.py test
181181

182182
pyupgrade: $(filter-out schema_salad/metaschema.py,${PYSOURCES})
183183
pyupgrade --exit-zero-even-if-changed --py36-plus $^

docs/typeshed.rst

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@ directory.
88

99
::
1010

11-
mkdir out
12-
stubgen module_name
13-
mv out/module_name/* typeshed/3/
11+
stubgen -o typeshed module_name
1412
make mypy
1513

1614
Note: the module name is not always the name of the PyPI package

schema_salad/jsonld_context.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import logging
2+
import unicodedata
23
from typing import (
34
Any,
45
Dict,
@@ -159,10 +160,7 @@ def process_type(
159160
raise
160161
split_start = rdflib.namespace.SPLIT_START_CATEGORIES
161162
for j in range(-1 - colon_index, len(uri)):
162-
if (
163-
rdflib.namespace.category(uri[j]) in split_start
164-
or uri[j] == "_"
165-
):
163+
if unicodedata.category(uri[j]) in split_start or uri[j] == "_":
166164
# _ prevents early split, roundtrip not generate
167165
ns = uri[:j]
168166
if not ns:

typeshed/2and3/rdflib/__init__.pyi

Lines changed: 0 additions & 17 deletions
This file was deleted.

typeshed/2and3/rdflib/namespace.pyi

Lines changed: 0 additions & 60 deletions
This file was deleted.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)