@@ -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
3030DEVPKGS =-rdev-requirements.txt -rtest-requirements.txt -rmypy-requirements.txt -rlint-requirements.txt
3131COVBASE =coverage run --append
3232PYTEST_EXTRA ?=
@@ -71,26 +71,27 @@ docs: FORCE
7171
7272# # clean : clean up all temporary / machine-generated files
7373clean : 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
8889pep257 : 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)
105106format :
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
108109format-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
112113pylint : $(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
138139coverage.xml : .coverage
@@ -185,12 +186,12 @@ mypyi:
185186
186187check-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
204205bandit :
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:
225226flake8 : 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
236237FORCE :
0 commit comments