[med-svn] [Git][python-team/packages/python-schema-salad][upstream] New upstream version 8.4.20230213094415
Michael R. Crusoe (@crusoe)
gitlab at salsa.debian.org
Mon Feb 20 12:55:13 GMT 2023
Michael R. Crusoe pushed to branch upstream at Debian Python Team / packages / python-schema-salad
Commits:
b89824e6 by Michael R. Crusoe at 2023-02-20T13:24:26+01:00
New upstream version 8.4.20230213094415
- - - - -
18 changed files:
- .github/workflows/ci-tests.yml
- Makefile
- PKG-INFO
- dev-requirements.txt
- mypy-requirements.txt
- pyproject.toml
- schema_salad.egg-info/PKG-INFO
- schema_salad.egg-info/SOURCES.txt
- schema_salad/_version.py
- schema_salad/metaschema.py
- schema_salad/metaschema/metaschema_base.yml
- schema_salad/python_codegen.py
- schema_salad/ref_resolver.py
- + schema_salad/tests/memory-leak-check.py
- schema_salad/tests/metaschema-pre.yml
- schema_salad/tests/test_makedoc.py
- setup.py
- tox.ini
Changes:
=====================================
.github/workflows/ci-tests.yml
=====================================
@@ -21,11 +21,14 @@ jobs:
matrix:
py-ver-major: [3]
py-ver-minor: [6, 7, 8, 9, 10, 11]
- step: [lint, bandit, unit, mypy]
+ step: [lint, bandit, unit, mypy, memleak]
exclude:
- py-ver-major: 3
py-ver-minor: 6
step: mypy
+ - py-ver-major: 3
+ py-ver-minor: 6
+ step: memleak
- py-ver-major: 3
py-ver-minor: 6
step: lint
@@ -120,7 +123,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python at v4
with:
- python-version: "3.10" # quoted, otherwise that turns into the number 3.1
+ python-version: "3.11"
- name: Cache for pip
uses: actions/cache at v3
=====================================
Makefile
=====================================
@@ -185,7 +185,7 @@ mypyc: $(PYSOURCES)
MYPYPATH=mypy-stubs SCHEMA_SALAD_USE_MYPYC=1 python setup.py test --addopts "${PYTEST_EXTRA}"
mypyi:
- MYPYPATH=mypy-stubs SCHEMA_SALAD_USE_MYPYC=1 python setup.py install
+ MYPYPATH=mypy-stubs SCHEMA_SALAD_USE_MYPYC=1 pip install .${EXTRAS}
check-metaschema-diff:
docker run \
=====================================
PKG-INFO
=====================================
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: schema-salad
-Version: 8.4.20230201194352
+Version: 8.4.20230213094415
Summary: Schema Annotations for Linked Avro Data (SALAD)
Home-page: https://github.com/common-workflow-language/schema_salad
Download-URL: https://github.com/common-workflow-language/schema_salad/releases
=====================================
dev-requirements.txt
=====================================
@@ -1,5 +1,5 @@
diff_cover < 7.5
-pylint < 2.16
+pylint < 2.17
pydocstyle < 6.4
flake8 > 4
flake8-bugbear < 23.2
=====================================
mypy-requirements.txt
=====================================
@@ -1,5 +1,7 @@
-mypy==0.991
+mypy==1.0.0
black>=19.10b0
types-pkg_resources
types-requests
types-dataclasses
+cwl-utils
+objgraph
=====================================
pyproject.toml
=====================================
@@ -3,7 +3,7 @@ requires = [
"setuptools>=45",
"setuptools_scm[toml]>=6.2",
'mypy==0.971; python_version == "3.6"', # last version for Python 3.6
- 'mypy==0.991; python_version >= "3.7"',
+ 'mypy==1.0.0; python_version >= "3.7"',
"black>=19.10b0",
"types-pkg_resources",
"types-requests",
=====================================
schema_salad.egg-info/PKG-INFO
=====================================
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: schema-salad
-Version: 8.4.20230201194352
+Version: 8.4.20230213094415
Summary: Schema Annotations for Linked Avro Data (SALAD)
Home-page: https://github.com/common-workflow-language/schema_salad
Download-URL: https://github.com/common-workflow-language/schema_salad/releases
=====================================
schema_salad.egg-info/SOURCES.txt
=====================================
@@ -274,6 +274,7 @@ schema_salad/tests/inject-id2.yml
schema_salad/tests/inject-id3.yml
schema_salad/tests/list.json
schema_salad/tests/matcher.py
+schema_salad/tests/memory-leak-check.py
schema_salad/tests/metaschema-pre.yml
schema_salad/tests/missing_step_name.cwl
schema_salad/tests/mixin.yml
=====================================
schema_salad/_version.py
=====================================
@@ -1,4 +1,4 @@
# file generated by setuptools_scm
# don't change, don't track in version control
-__version__ = version = '8.4.20230201194352'
-__version_tuple__ = version_tuple = (8, 4, 20230201194352)
+__version__ = version = '8.4.20230213094415'
+__version_tuple__ = version_tuple = (8, 4, 20230213094415)
=====================================
schema_salad/metaschema.py
=====================================
@@ -3517,7 +3517,24 @@ PrimitiveTypeLoader = _EnumLoader(
),
"PrimitiveType",
)
+"""
+Names of salad data types (based on Avro schema declarations).
+
+Refer to the [Avro schema declaration documentation](https://avro.apache.org/docs/current/spec.html#schemas) for
+detailed information.
+
+null: no value
+boolean: a binary value
+int: 32-bit signed integer
+long: 64-bit signed integer
+float: single precision (32-bit) IEEE 754 floating-point number
+double: double precision (64-bit) IEEE 754 floating-point number
+string: Unicode character sequence
+"""
AnyLoader = _EnumLoader(("Any",), "Any")
+"""
+The **Any** type validates for any non-null value.
+"""
RecordFieldLoader = _RecordLoader(RecordField)
RecordSchemaLoader = _RecordLoader(RecordSchema)
EnumSchemaLoader = _RecordLoader(EnumSchema)
=====================================
schema_salad/metaschema/metaschema_base.yml
=====================================
@@ -39,8 +39,9 @@ $graph:
- "xsd:string"
doc:
- |
- Salad data types are based on Avro schema declarations. Refer to the
- [Avro schema declaration documentation](https://avro.apache.org/docs/current/spec.html#schemas) for
+ Names of salad data types (based on Avro schema declarations).
+
+ Refer to the [Avro schema declaration documentation](https://avro.apache.org/docs/current/spec.html#schemas) for
detailed information.
- "null: no value"
- "boolean: a binary value"
=====================================
schema_salad/python_codegen.py
=====================================
@@ -406,14 +406,24 @@ if _errors__:
if type_declaration["type"] in ("enum", "https://w3id.org/cwl/salad#enum"):
for sym in type_declaration["symbols"]:
self.add_vocab(shortname(sym), sym)
+ if "doc" in type_declaration:
+ doc = type_declaration["doc"]
+ if isinstance(doc, MutableSequence):
+ formated_doc = "\n".join(doc)
+ else:
+ formated_doc = doc.strip()
+ docstring = f'\n"""\n{formated_doc}\n"""'
+ else:
+ docstring = ""
return self.declare_type(
TypeDef(
self.safe_name(type_declaration["name"]) + "Loader",
- '_EnumLoader(("{}",), "{}")'.format(
+ '_EnumLoader(("{}",), "{}"){}'.format(
'", "'.join(
schema.avro_field_name(sym) for sym in type_declaration["symbols"]
),
self.safe_name(type_declaration["name"]),
+ docstring,
),
)
)
=====================================
schema_salad/ref_resolver.py
=====================================
@@ -842,7 +842,7 @@ class Loader:
)
elif isinstance(document, CommentedSeq):
pass
- elif isinstance(document, (list, dict)): # type: ignore[unreachable]
+ elif isinstance(document, (list, dict)):
raise ValidationException(
f"Expected CommentedMap or CommentedSeq, got {type(document)}: {document!r}"
)
=====================================
schema_salad/tests/memory-leak-check.py
=====================================
@@ -0,0 +1,14 @@
+#!/usr/bin/env python
+
+import sys
+
+import cwl_utils.parser
+import objgraph # type: ignore[import]
+
+growth = []
+for _ in range(5):
+ growth = objgraph.growth(limit=50)
+ cwl_utils.parser.load_document_by_uri(sys.argv[1])
+objgraph.show_growth(limit=50)
+if len(growth) != 0:
+ exit(1)
=====================================
schema_salad/tests/metaschema-pre.yml
=====================================
@@ -105,7 +105,7 @@
"http://www.w3.org/2001/XMLSchema#string"
],
"doc": [
- "Salad data types are based on Avro schema declarations. Refer to the\n[Avro schema declaration documentation](https://avro.apache.org/docs/current/spec.html#schemas) for\ndetailed information.\n",
+ "Names of salad data types (based on Avro schema declarations).\n\nRefer to the [Avro schema declaration documentation](https://avro.apache.org/docs/current/spec.html#schemas) for\ndetailed information.\n",
"null: no value",
"boolean: a binary value",
"int: 32-bit signed integer",
=====================================
schema_salad/tests/test_makedoc.py
=====================================
@@ -239,5 +239,5 @@ def test_detect_changes_in_html(metaschema_doc: str, tmp_path: Path) -> None:
with open(result, "w") as h:
h.write(metaschema_doc)
assert (
- hasher.hexdigest() == "0dec6861574d2a80f5f5cd177103747e893fe6b23d1ec9b2b37850408d9ca1d1"
+ hasher.hexdigest() == "5fd520208b242c0fbf50235c83c88bc462f2b8d67b3dfbb9ffb399d7851fdab2"
), result
=====================================
setup.py
=====================================
@@ -40,7 +40,7 @@ if USE_MYPYC and any(
mypyc_targets = [
# "schema_salad/codegen_base.py", # interpreted classes cannot inherit from compiled
# "schema_salad/codegen.py",
- "schema_salad/exceptions.py",
+ # "schema_salad/exceptions.py", # leads to memory leaks
"schema_salad/__init__.py",
# "schema_salad/java_codegen.py", # due to use of __name__
"schema_salad/jsonld_context.py",
=====================================
tox.ini
=====================================
@@ -4,6 +4,7 @@ envlist =
py{36,37,38,39,310,311}-unit,
py{37,38,39,310,311}-bandit,
py{37,38,39,310,311}-mypy,
+ py{37,38,39,310,311}-memleak,
py310-lintreadme,
py310-pydocstyle
@@ -28,6 +29,7 @@ description =
py{36,37,38,39,310,311}-lint: Lint the Python code
py{37,38,39,310,311}-bandit: Search for common security issues
py{37,38,39,310,311}-mypy: Check for type safety
+ py{37,38,39,310,311}-memleak: Simple test for memory leaks with mypyc
py310-pydocstyle: docstring style checker
py310-lintreadme: Lint the README.rst->.md conversion
@@ -40,7 +42,9 @@ deps =
py{36,37,38,39,310,311}-lint: flake8-bugbear < 22.13
py{36,37,38,39,310,311}-lint: black
py{37,38,39,310,311}-bandit: bandit < 1.8
- py{37,38,39,310,311}-mypy: -rmypy-requirements.txt
+ py{37,38,39,310,311}-{mypy,memleak}: -rmypy-requirements.txt
+ py{37,38,39,310,311}-memleak: cwl-utils
+ py{37,38,39,310,311}-memleak: objgraph
# don't forget to update dev-requirements.txt as well
setenv =
@@ -54,12 +58,14 @@ commands =
py{36,37,38,39,310,311}-lint: make format-check
py{37,38,39,310,311}-mypy: make mypy
py{37,38,39,310,311}-mypy: make mypyc
+ py{37,38,39,310,311}-memleak: make mypyi
+ py{37,38,39,310,311}-memleak: python schema_salad/tests/memory-leak-check.py schema_salad/tests/test_real_cwl/ICGC-TCGA-PanCancer/preprocess_vcf.cwl
py37-mypy: make mypy_3.6
allowlist_externals =
py{36,37,38,39,310,311}-lint: flake8
py{36,37,38,39,310,311}-lint: black
- py{36,37,38,39,310,311}-{mypy,shellcheck,lint,lintreadme,unit}: make
+ py{36,37,38,39,310,311}-{mypy,memleak,shellcheck,lint,lintreadme,unit}: make
skip_install =
py{36,37,38,39,310,311}-lint: true
View it on GitLab: https://salsa.debian.org/python-team/packages/python-schema-salad/-/commit/b89824e6157ac4b5c3aedf60236e648e671cd71c
--
View it on GitLab: https://salsa.debian.org/python-team/packages/python-schema-salad/-/commit/b89824e6157ac4b5c3aedf60236e648e671cd71c
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20230220/17c24900/attachment-0001.htm>
More information about the debian-med-commit
mailing list