Skip to content

Commit a79a028

Browse files
committed
1 parent 068b2cf commit a79a028

341 files changed

Lines changed: 100 additions & 110 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.coveragerc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[run]
22
branch = True
33
source = schema_salad
4-
omit = schema_salad/tests/*
4+
omit = src/schema_salad/tests/*
55

66
[report]
77
exclude_lines =
@@ -11,6 +11,6 @@ exclude_lines =
1111
if __name__ == .__main__.:
1212
ignore_errors = True
1313
omit =
14-
schema_salad/tests/*
15-
schema_salad/metaschema.py
16-
schema_salad/python_codegen_support.py
14+
src/schema_salad/tests/*
15+
src/schema_salad/metaschema.py
16+
src/schema_salad/python_codegen_support.py

.dockerignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ testenv*/
1818
*.so
1919
*.swp
2020
.github/
21-
schema_salad/*.so
21+
src/schema_salad/*.so
2222
*.Dockerfile
2323
build-schema_salad-docker.sh
2424
__pycache__/

.flake8

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ extend-ignore = E203,E501,E701,E704
66
# when Python 3.10 is the minimum version, re-enable check B905 for zip + strict
77
extend-select = B950
88
per-file-ignores =
9-
schema_salad/metaschema.py:B950
10-
schema_salad/tests/*.py:B011
11-
schema_salad/tests/test_codegen_errors.py:B950
12-
schema_salad/tests/util.py:B950
9+
src/schema_salad/metaschema.py:B950
10+
src/schema_salad/tests/*.py:B011
11+
src/schema_salad/tests/test_codegen_errors.py:B950
12+
src/schema_salad/tests/util.py:B950

.readthedocs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ sphinx:
1313
formats: all
1414

1515
build:
16-
os: ubuntu-22.04
16+
os: ubuntu-24.04
1717
tools:
1818
python: "3.11"
1919

MANIFEST.in

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
include Makefile LICENSE.txt requirements.txt mypy-requirements.txt test-requirements.txt mypy.ini
2-
include schema_salad/py.typed
3-
include schema_salad/avro/*
4-
recursive-include schema_salad/java *
5-
recursive-include schema_salad/typescript *
6-
recursive-include schema_salad/dotnet *
7-
include schema_salad/tests/*
8-
include schema_salad/tests/test_schema/*.md
9-
include schema_salad/tests/test_schema/*.yml
10-
include schema_salad/tests/test_schema/*.cwl
11-
recursive-include schema_salad/tests/cpp_tests *.h *.yml
12-
include schema_salad/tests/foreign/*.cwl
13-
recursive-include schema_salad/tests/test_real_cwl *
14-
include schema_salad/metaschema/*
15-
include schema_salad/tests/docimp/*
2+
include src/schema_salad/py.typed
3+
include src/schema_salad/avro/*
4+
recursive-include src/schema_salad/java *
5+
recursive-include src/schema_salad/typescript *
6+
recursive-include src/schema_salad/dotnet *
7+
include src/schema_salad/tests/*
8+
include src/schema_salad/tests/test_schema/*.md
9+
include src/schema_salad/tests/test_schema/*.yml
10+
include src/schema_salad/tests/test_schema/*.cwl
11+
recursive-include src/schema_salad/tests/cpp_tests *.h *.yml
12+
include src/schema_salad/tests/foreign/*.cwl
13+
recursive-include src/schema_salad/tests/test_real_cwl *
14+
include src/schema_salad/metaschema/*
15+
include src/schema_salad/tests/docimp/*
1616
recursive-include mypy-stubs *.py?
1717
global-exclude *~
1818
global-exclude *.pyc

Makefile

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ EXTRAS=[pycodegen]
2626

2727
# `SHELL=bash` doesn't work for some, so don't use BASH-isms like
2828
# `[[` conditional expressions.
29-
PYSOURCES=$(wildcard ${MODULE}/**.py ${MODULE}/avro/*.py ${MODULE}/tests/*.py) setup.py
29+
PYSOURCES=$(wildcard src/${MODULE}/**.py src/${MODULE}/avro/*.py src/${MODULE}/tests/*.py) setup.py
3030
DEVPKGS=-rdev-requirements.txt -rtest-requirements.txt -rmypy-requirements.txt -rlint-requirements.txt
3131
COVBASE=coverage run --append
3232
PYTEST_EXTRA ?=
@@ -71,26 +71,27 @@ docs: FORCE
7171

7272
## clean : clean up all temporary / machine-generated files
7373
clean: FORCE
74-
rm -rf ${MODULE}/__pycache__ ${MODULE}/tests/__pycache__ schema_salad/_version.py
75-
rm -f *.so ${MODULE}/*.so ${MODULE}/tests/*.so ${MODULE}/avro/*.so
74+
find src -type d -name __pycache__ | xargs rm -Rf
75+
rm -f src/schema_salad/_version.py
76+
find src -type f -name "*.so" -delete
7677
python setup.py clean --all || true
7778
rm -Rf .coverage
7879
rm -f diff-cover.html
7980

8081
# Linting and code style related targets
8182
## sort_import : sorting imports using isort: https://github.com/timothycrosley/isort
82-
sort_imports: $(filter-out schema_salad/metaschema.py,$(PYSOURCES)) mypy-stubs
83+
sort_imports: $(filter-out src/schema_salad/metaschema.py,$(PYSOURCES)) mypy-stubs
8384
isort $^
8485

85-
remove_unused_imports: $(filter-out schema_salad/metaschema.py,$(PYSOURCES))
86+
remove_unused_imports: $(filter-out src/schema_salad/metaschema.py,$(PYSOURCES))
8687
autoflake --in-place --remove-all-unused-imports $^
8788

8889
pep257: pydocstyle
8990
## pydocstyle : check Python docstring style
90-
pydocstyle: $(filter-out schema_salad/metaschema.py,$(PYSOURCES))
91+
pydocstyle: $(filter-out src/schema_salad/metaschema.py,$(PYSOURCES))
9192
pydocstyle --add-ignore=D100,D101,D102,D103 $^ || true
9293

93-
pydocstyle_report.txt: $(filter-out schema_salad/metaschema.py,$(PYSOURCES))
94+
pydocstyle_report.txt: $(filter-out src/schema_salad/metaschema.py,$(PYSOURCES))
9495
pydocstyle setup.py $^ > $@ 2>&1 || true
9596

9697
## diff_pydocstyle_report : check Python docstring style for changed files only
@@ -103,10 +104,10 @@ codespell:
103104

104105
## format : check/fix all code indentation and formatting (runs black)
105106
format:
106-
black --force-exclude metaschema.py --exclude _version.py schema_salad setup.py mypy-stubs
107+
black --force-exclude metaschema.py --exclude _version.py src/schema_salad setup.py mypy-stubs
107108

108109
format-check:
109-
black --diff --check --force-exclude metaschema.py --exclude _version.py schema_salad setup.py mypy-stubs
110+
black --diff --check --force-exclude metaschema.py --exclude _version.py src/schema_salad setup.py mypy-stubs
110111

111112
## pylint : run static code analysis on Python code
112113
pylint: $(PYSOURCES)
@@ -123,16 +124,16 @@ diff_pylint_report: pylint_report.txt
123124
.coverage:
124125
pytest --cov --cov-config=.coveragerc --cov-report= ${PYTEST_EXTRA}
125126
$(COVBASE) -m schema_salad.main \
126-
--print-jsonld-context schema_salad/metaschema/metaschema.yml \
127+
--print-jsonld-context src/schema_salad/metaschema/metaschema.yml \
127128
> /dev/null
128129
$(COVBASE) -m schema_salad.main \
129-
--print-rdfs schema_salad/metaschema/metaschema.yml \
130+
--print-rdfs src/schema_salad/metaschema/metaschema.yml \
130131
> /dev/null
131132
$(COVBASE) -m schema_salad.main \
132-
--print-avro schema_salad/metaschema/metaschema.yml \
133+
--print-avro src/schema_salad/metaschema/metaschema.yml \
133134
> /dev/null
134135
$(COVBASE) -m schema_salad.makedoc --debug \
135-
schema_salad/metaschema/metaschema.yml \
136+
src/schema_salad/metaschema/metaschema.yml \
136137
> /dev/null
137138

138139
coverage.xml: .coverage
@@ -185,12 +186,12 @@ mypyi:
185186

186187
check-metaschema-diff:
187188
docker run \
188-
-v "$(realpath ${MODULE}/metaschema/):/tmp/:ro" \
189+
-v "$(realpath src/${MODULE}/metaschema/):/tmp/:ro" \
189190
"quay.io/commonwl/cwltool_module:latest" \
190191
schema-salad-doc /tmp/metaschema.yml \
191192
> /tmp/metaschema.orig.html
192193
schema-salad-doc \
193-
"$(realpath ${MODULE}/metaschema/metaschema.yml)" \
194+
"$(realpath src/${MODULE}/metaschema/metaschema.yml)" \
194195
> /tmp/metaschema.new.html
195196
diff -a --color /tmp/metaschema.orig.html /tmp/metaschema.new.html || true
196197

@@ -202,9 +203,9 @@ shellcheck: FORCE
202203

203204
## bandit : check for common security issues
204205
bandit:
205-
bandit --recursive --exclude schema_salad/tests/ schema_salad
206+
bandit --recursive --exclude src/schema_salad/tests/ src/schema_salad
206207

207-
pyupgrade: $(filter-out schema_salad/metaschema.py,$(PYSOURCES))
208+
pyupgrade: $(filter-out src/schema_salad/metaschema.py,$(PYSOURCES))
208209
pyupgrade --exit-zero-even-if-changed --py310-plus $^
209210
auto-walrus $^
210211

@@ -225,12 +226,12 @@ release:
225226
flake8: FORCE
226227
flake8 $(PYSOURCES)
227228

228-
schema_salad/metaschema.py: schema_salad/codegen_base.py schema_salad/python_codegen_support.py schema_salad/python_codegen.py schema_salad/metaschema/*.yml
229-
schema-salad-tool --codegen python schema_salad/metaschema/metaschema.yml > $@
229+
src/schema_salad/metaschema.py: src/schema_salad/codegen_base.py src/schema_salad/python_codegen_support.py src/schema_salad/python_codegen.py src/schema_salad/metaschema/*.yml
230+
schema-salad-tool --codegen python src/schema_salad/metaschema/metaschema.yml > $@
230231

231-
vpath %.yml schema_salad/tests/cpp_tests
232+
vpath %.yml src/schema_salad/tests/cpp_tests
232233

233-
schema_salad/tests/cpp_tests/%.h: %.yml
234+
src/schema_salad/tests/cpp_tests/%.h: %.yml
234235
schema-salad-tool --codegen cpp --codegen-target $@ $<
235236

236237
FORCE:

README.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ First set of examples is using the `CWL v1.2 schema <https://github.com/common-w
109109
+-------------+---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
110110
| Language | Repository | Serialization Example | Deserialization Example |
111111
+=============+=========================================================+======================================================================================================================================================+============================================================================================================================================================================+
112-
| Python | https://github.com/common-workflow-language/cwl-utils/ | `create_cwl_from_objects.py <https://github.com/common-workflow-language/cwl-utils/blob/main/create_cwl_from_objects.py>`_ | `load_document() <https://github.com/common-workflow-language/cwl-utils/blob/main/cwl_utils/parser/__init__.py#L93>`_ |
112+
| Python | https://github.com/common-workflow-language/cwl-utils/ | `create_cwl_from_objects.py <https://github.com/common-workflow-language/cwl-utils/blob/main/create_cwl_from_objects.py>`_ | `load_document() <https://github.com/common-workflow-language/cwl-utils/blob/main/src/cwl_utils/parser/__init__.py#L93>`_ |
113113
+-------------+---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
114114
| Java | https://github.com/common-workflow-language/cwljava/ | (Not yet implemented) | `PackedWorkflowClassTest.java <https://github.com/common-workflow-language/cwljava/blob/cwl-1.2.0/src/test/java/org/w3id/cwl/cwl1_2/utils/PackedWorkflowClassTest.java>`_ |
115115
+-------------+---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
@@ -207,8 +207,8 @@ Here is an example schema to do that::
207207
type: array
208208
items: Product
209209

210-
You can check the schema and document in schema_salad/tests/basket_schema.yml
211-
and schema_salad/tests/basket.yml::
210+
You can check the schema and document in src/schema_salad/tests/basket_schema.yml
211+
and src/schema_salad/tests/basket.yml::
212212

213213
$ schema-salad-tool basket_schema.yml basket.yml
214214
Document `basket.yml` is valid
@@ -257,7 +257,7 @@ provides for robust support of inline documentation.
257257

258258
.. _JSON-LD: http://json-ld.org
259259
.. _Avro: http://avro.apache.org
260-
.. _metaschema: https://github.com/common-workflow-language/schema_salad/blob/main/schema_salad/metaschema/metaschema.yml
260+
.. _metaschema: https://github.com/common-workflow-language/schema_salad/blob/main/src/schema_salad/metaschema/metaschema.yml
261261
.. _specification: http://www.commonwl.org/v1.2/SchemaSalad.html
262262
.. _Language: https://github.com/common-workflow-language/cwl-v1.2/blob/v1.2.0/CommandLineTool.yml
263263
.. _RDF: https://www.w3.org/RDF/

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@
8787

8888
version = _version.version
8989

90-
autoapi_dirs = ["../schema_salad"]
90+
autoapi_dirs = ["../src/schema_salad"]
9191
autodoc_typehints = "description"
9292
autoapi_keep_files = True
9393
autoapi_ignore = ["*migrations*", "*.pyi"]

lgtm.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ extraction:
66
index:
77
# Specify a list of files and folders to exclude from extraction.
88
exclude:
9-
- schema_salad/typescript/
9+
- src/schema_salad/typescript/

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ requires = [
1515
build-backend = "setuptools.build_meta"
1616

1717
[tool.setuptools_scm]
18-
write_to = "schema_salad/_version.py"
18+
write_to = "src/schema_salad/_version.py"
1919

2020
[tool.cibuildwheel]
2121
test-command = "python -m pytest -n auto --junitxml={project}/test-results/junit_$(python -V | awk '{print $2}')_${AUDITWHEEL_PLAT}.xml --pyargs schema_salad"

0 commit comments

Comments
 (0)