Skip to content

Commit f237792

Browse files
authored
Merge branch 'main' into dlang-support-extension-objects
2 parents 6a44929 + 9a92ffc commit f237792

35 files changed

+262
-111
lines changed

.github/workflows/ci-tests.yml

Lines changed: 65 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,16 @@ jobs:
2121
matrix:
2222
py-ver-major: [3]
2323
py-ver-minor: [8, 9, 10, 11, 12]
24-
step: [lint, bandit, unit, mypy, memleak]
24+
step: [lint, unit, mypy, memleak]
2525

2626
env:
2727
py-semver: ${{ format('{0}.{1}', matrix.py-ver-major, matrix.py-ver-minor) }}
2828
TOXENV: ${{ format('py{0}{1}-{2}', matrix.py-ver-major, matrix.py-ver-minor, matrix.step) }}
2929

3030
steps:
3131
- uses: actions/checkout@v4
32+
with:
33+
fetch-depth: 0
3234

3335
- name: Set up Python
3436
uses: actions/setup-python@v5
@@ -103,6 +105,68 @@ jobs:
103105
- name: Test with tox
104106
run: tox
105107

108+
typescript:
109+
name: Confirm that codegen typescript passes tests with CWL
110+
runs-on: ubuntu-22.04
111+
steps:
112+
- uses: actions/checkout@v4
113+
- name: Set up Node
114+
uses: actions/setup-node@v4
115+
- name: Set up Python
116+
uses: actions/setup-python@v5
117+
with:
118+
python-version: 3.12
119+
cache: pip
120+
cache-dependency-path: |
121+
requirements.txt
122+
tox.ini
123+
- name: Upgrade setuptools and install schema-salad
124+
run: |
125+
pip install -U pip setuptools wheel
126+
pip install .
127+
- name: Download valid CWL documents for testing
128+
run: |
129+
wget "https://github.com/common-workflow-lab/cwl-ts-auto/archive/refs/heads/main.zip"
130+
unzip main.zip
131+
- name: Generate cwl-ts-auto
132+
run: |
133+
schema-salad-tool --codegen typescript --codegen-examples cwl-ts-auto-main/src/test/data/examples \
134+
--codegen-target cwl-ts-auto \
135+
https://github.com/common-workflow-language/cwl-v1.2/raw/codegen/CommonWorkflowLanguage.yml
136+
- name: run cwl-ts-auto tests
137+
run: |
138+
cd cwl-ts-auto
139+
npm install
140+
npm test
141+
142+
cpp:
143+
name: Confirm that codegen C++ passes tests with CWL
144+
runs-on: ubuntu-22.04
145+
steps:
146+
- name: Install C++ dependencies
147+
run: sudo apt-get install libyaml-cpp-dev
148+
- uses: actions/checkout@v4
149+
- name: Set up Python
150+
uses: actions/setup-python@v5
151+
with:
152+
python-version: 3.12
153+
cache: pip
154+
cache-dependency-path: |
155+
requirements.txt
156+
tox.ini
157+
- name: Upgrade setuptools and install schema-salad
158+
run: |
159+
pip install -U pip setuptools wheel
160+
pip install .
161+
- name: Download cwl-cpp-auto for its tests
162+
run: |
163+
wget "https://github.com/common-workflow-lab/cwl-cpp-auto/archive/refs/heads/main.zip"
164+
unzip main.zip
165+
- name: Generate cwl-cpp-auto and run tests
166+
run: |
167+
cd cwl-cpp-auto-main
168+
make cwl_v1_2.h tests CXXFLAGS=-std=c++17
169+
106170
release_test:
107171
name: Schema Salad release test
108172

.github/workflows/quay-publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
username: ${{ secrets.REGISTRY_USERNAME }}
2525
password: ${{ secrets.REGISTRY_PASSWORD }}
2626
- name: Build and publish schema-salad image to Quay
27-
uses: docker/build-push-action@v5
27+
uses: docker/build-push-action@v6
2828
with:
2929
context: .
3030
file: schema_salad.Dockerfile

.github/workflows/wheels.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ on:
1010
branches:
1111
- main
1212

13+
concurrency:
14+
group: wheels-${{ github.event.pull_request.number || github.ref }}
15+
cancel-in-progress: true
16+
1317
jobs:
1418
build_wheels:
1519
name: ${{ matrix.image }} wheels
@@ -42,7 +46,7 @@ jobs:
4246
# platforms: all
4347

4448
- name: Build wheels
45-
uses: pypa/cibuildwheel@v2.17.0
49+
uses: pypa/cibuildwheel@v2.20.0
4650
env:
4751
CIBW_BUILD: ${{ matrix.build }}
4852
CIBW_MANYLINUX_X86_64_IMAGE: quay.io/pypa/${{ matrix.image }}
@@ -98,7 +102,7 @@ jobs:
98102
ref: ${{ github.event.client_payload.ref }}
99103

100104
- name: Build wheels
101-
uses: pypa/cibuildwheel@v2.17.0
105+
uses: pypa/cibuildwheel@v2.20.0
102106

103107
- uses: actions/upload-artifact@v4
104108
with:

Makefile

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ DEVPKGS=-rdev-requirements.txt -rtest-requirements.txt -rmypy-requirements.txt
3131
COVBASE=coverage run --append
3232
PYTEST_EXTRA ?= -rs
3333

34-
VERSION=8.5.$(shell date +%Y%m%d%H%M%S --utc --date=`git log --first-parent \
34+
VERSION=8.7.$(shell date +%Y%m%d%H%M%S --utc --date=`git log --first-parent \
3535
--max-count=1 --format=format:%cI`)
3636

3737
## all : default task (install schema-salad in dev mode)
@@ -95,7 +95,7 @@ pydocstyle_report.txt: $(filter-out schema_salad/metaschema.py,$(PYSOURCES))
9595

9696
## diff_pydocstyle_report : check Python docstring style for changed files only
9797
diff_pydocstyle_report: pydocstyle_report.txt
98-
diff-quality --compare-branch=main --violations=pydocstyle --fail-under=100 $^
98+
diff-quality --compare-branch=origin/main --violations=pydocstyle --fail-under=100 $^
9999

100100
## codespell : check for common misspellings
101101
codespell:
@@ -109,16 +109,16 @@ format-check:
109109
black --diff --check --force-exclude metaschema.py --exclude _version.py schema_salad setup.py mypy-stubs
110110

111111
## pylint : run static code analysis on Python code
112-
pylint: $(PYSOURCES)
112+
pylint: FORCE
113113
pylint --msg-template="{path}:{line}: [{msg_id}({symbol}), {obj}] {msg}" \
114114
$^ -j0|| true
115115

116-
pylint_report.txt: $(PYSOURCES)
116+
pylint_report.txt: FORCE
117117
pylint --msg-template="{path}:{line}: [{msg_id}({symbol}), {obj}] {msg}" \
118118
$^ -j0> $@ || true
119119

120120
diff_pylint_report: pylint_report.txt
121-
diff-quality --compare-branch=main --violations=pylint pylint_report.txt
121+
diff-quality --compare-branch=origin/main --violations=pylint pylint_report.txt
122122

123123
.coverage:
124124
pytest --cov --cov-config=.coveragerc --cov-report= ${PYTEST_EXTRA}
@@ -148,10 +148,10 @@ coverage-report: .coverage
148148
coverage report
149149

150150
diff-cover: coverage.xml
151-
diff-cover --compare-branch=main $^
151+
diff-cover --compare-branch=origin/main $^
152152

153153
diff-cover.html: coverage.xml
154-
diff-cover --compare-branch=main $^ --html-report $@
154+
diff-cover --compare-branch=origin/main $^ --html-report $@
155155

156156
## test : run the schema-salad test suite
157157
test: $(PYSOURCES)
@@ -200,6 +200,10 @@ compute-metaschema-hash:
200200
shellcheck: FORCE
201201
shellcheck build-schema_salad-docker.sh release-test.sh
202202

203+
## bandit : check for common security issues
204+
bandit:
205+
bandit --recursive --exclude schema_salad/tests/ schema_salad
206+
203207
pyupgrade: $(filter-out schema_salad/metaschema.py,$(PYSOURCES))
204208
pyupgrade --exit-zero-even-if-changed --py38-plus $^
205209
auto-walrus $^

cibw-requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
cibuildwheel==2.17.0
1+
cibuildwheel==2.20.0

dev-requirements.txt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
1-
diff_cover < 8.1
2-
pylint < 3.2
3-
pydocstyle < 6.4
4-
flake8 > 4
5-
flake8-bugbear < 24.3
61
tox < 3.29 # until tox-pyenv is updated for tox 4.x
72
tox-pyenv < 1.2
83
isort > 5, < 5.14
94
build < 1.2.2
105
autoflake < 2.4
11-
bandit < 1.7.9
126
auto-walrus

lint-requirements.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
diff_cover < 9.2
2+
pydocstyle < 6.4
3+
flake8 > 4
4+
flake8-bugbear < 24.9
5+
bandit < 1.7.10
6+
pylint < 3.3

mypy-requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
mypy[mypyc]==1.9.0 # update pyproject.toml as well
2-
black~=24.3
1+
mypy[mypyc]==1.11.2 # update pyproject.toml as well
2+
black~=24.8
33
types-requests
44
types-dataclasses
55
objgraph

mypy-stubs/cachecontrol/cache.pyi

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
1+
from datetime import datetime
2+
from typing import IO
3+
14
class BaseCache:
25
def get(self, key: str) -> bytes | None: ...
3-
def set(self, key: str, value: bytes, expires: int | None = None) -> None: ...
6+
def set(self, key: str, value: bytes, expires: int | datetime | None = None) -> None: ...
47
def delete(self, key: str) -> None: ...
58
def close(self) -> None: ...
9+
10+
class SeparateBodyBaseCache(BaseCache):
11+
def set_body(self, key: str, body: bytes) -> None: ...
12+
def get_body(self, key: str) -> IO[bytes] | None: ...
Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,3 @@
1-
# Stubs for cachecontrol.caches (Python 2)
2-
#
3-
# NOTE: This dynamically typed stub was automatically generated by stubgen.
1+
from cachecontrol.caches.file_cache import SeparateBodyFileCache as SeparateBodyFileCache
42

5-
from typing import Any
6-
7-
from .file_cache import FileCache as FileCache
8-
9-
# from .redis_cache import RedisCache as RedisCache
10-
11-
notice = ... # type: Any
3+
__all__ = ["SeparateBodyFileCache"]

0 commit comments

Comments
 (0)