Skip to content

Commit 1432031

Browse files
committed
Merge remote-tracking branch 'origin/main' into skip_internal_imports
2 parents 02c0fbc + dc972ff commit 1432031

28 files changed

+510
-142
lines changed

.github/dependabot.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
version: 2
22
updates:
3-
- package-ecosystem: pip
4-
directory: "/"
5-
schedule:
6-
interval: daily
7-
open-pull-requests-limit: 10
3+
- package-ecosystem: "pip" # See documentation for possible values
4+
directory: "/" # Location of package manifests
5+
schedule:
6+
interval: "daily"
7+
# Maintain dependencies for GitHub Actions
8+
- package-ecosystem: "github-actions"
9+
directory: "/"
10+
schedule:
11+
interval: "daily"

.github/workflows/ci-tests.yml

Lines changed: 29 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Continous integration tests
1+
name: Continuous integration tests
22

33
on:
44
push:
@@ -15,31 +15,30 @@ jobs:
1515
tox:
1616
name: CI tests via Tox
1717

18-
runs-on: ubuntu-20.04
19-
18+
runs-on: ubuntu-20.04 # 22.04 doesn't support Python 3.6
2019
strategy:
2120
matrix:
2221
py-ver-major: [3]
23-
py-ver-minor: [6, 7, 8, 9, 10]
22+
py-ver-minor: [6, 7, 8, 9, 10, 11]
2423
step: [lint, unit, mypy]
2524

2625
env:
2726
py-semver: ${{ format('{0}.{1}', matrix.py-ver-major, matrix.py-ver-minor) }}
2827
TOXENV: ${{ format('py{0}{1}-{2}', matrix.py-ver-major, matrix.py-ver-minor, matrix.step) }}
2928

3029
steps:
31-
- uses: actions/checkout@v2
32-
30+
- uses: actions/checkout@v3
31+
with:
32+
fetch-depth: 0
3333
- name: Set up Python
34-
uses: actions/setup-python@v2
34+
uses: actions/setup-python@v4
3535
with:
3636
python-version: ${{ env.py-semver }}
37-
38-
- name: Cache for pip
39-
uses: actions/cache@v2
40-
with:
41-
path: ~/.cache/pip
42-
key: ${{ runner.os }}-pip-${{ matrix.step }}-${{ hashFiles('requirements.txt', 'tox.ini') }}
37+
cache: pip
38+
cache-dependency-path: |
39+
requirements.txt
40+
test-requirements.txt
41+
mypy-requirements.txt
4342
4443
- name: Upgrade setuptools and install tox
4544
run: |
@@ -48,7 +47,7 @@ jobs:
4847
4948
- name: MyPy cache
5049
if: ${{ matrix.step == 'mypy' }}
51-
uses: actions/cache@v2
50+
uses: actions/cache@v3
5251
with:
5352
path: .mypy_cache/${{ env.py-semver }}
5453
key: mypy-${{ env.py-semver }}
@@ -58,9 +57,10 @@ jobs:
5857

5958
- name: Upload coverage to Codecov
6059
if: ${{ matrix.step == 'unit' }}
61-
uses: codecov/codecov-action@v2.1.0
60+
uses: codecov/codecov-action@v3
6261
with:
6362
fail_ci_if_error: true
63+
token: ${{ secrets.CODECOV_TOKEN }}
6464

6565
tox-style:
6666
name: CI linters via Tox
@@ -72,24 +72,19 @@ jobs:
7272
step: [lintreadme, pydocstyle]
7373

7474
env:
75-
py-semver: "3.10"
76-
TOXENV: ${{ format('py310-{0}', matrix.step) }}
75+
py-semver: "3.11"
76+
TOXENV: ${{ format('py311-{0}', matrix.step) }}
7777

7878
steps:
79-
- uses: actions/checkout@v2
79+
- uses: actions/checkout@v3
8080
with:
8181
fetch-depth: 0
8282

8383
- name: Set up Python
84-
uses: actions/setup-python@v2
84+
uses: actions/setup-python@v4
8585
with:
8686
python-version: ${{ env.py-semver }}
87-
88-
- name: Cache for pip
89-
uses: actions/cache@v2
90-
with:
91-
path: ~/.cache/pip
92-
key: ${{ runner.os }}-pip-${{ matrix.step }}-${{ hashFiles('requirements.txt') }}
87+
cache: pip
9388

9489
- name: Upgrade setuptools and install tox
9590
run: |
@@ -105,23 +100,20 @@ jobs:
105100

106101
release_test:
107102
name: cwl-utils release test
108-
109-
runs-on: ubuntu-20.04
103+
runs-on: ubuntu-22.04
110104

111105
steps:
112-
- uses: actions/checkout@v2
106+
- uses: actions/checkout@v3
113107

114108
- name: Set up Python
115-
uses: actions/setup-python@v2
109+
uses: actions/setup-python@v4
116110
with:
117-
python-version: "3.10" # quoted, otherwise that turns into the number 3.1
118-
119-
- name: Cache for pip
120-
uses: actions/cache@v2
121-
with:
122-
path: ~/.cache/pip
123-
key: ${{ runner.os }}-pip-release-${{ hashFiles('requirements.txt', 'test-requirements.txt') }}
124-
111+
python-version: "3.11" # quoted, otherwise that turns into the number 3.1
112+
cache: pip
113+
cache-dependency-path: |
114+
requirements.txt
115+
test-requirements.txt
116+
mypy-requirements.txt
125117
- name: Install packages
126118
run: |
127119
pip install -U pip setuptools wheel

.github/workflows/codeql-analysis.yml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,27 @@ name: "Code scanning - action"
22

33
on:
44
push:
5+
branches: [main]
56
pull_request:
7+
branches: [main]
68
schedule:
79
- cron: '0 1 * * 4'
810

11+
concurrency:
12+
group: codeql-${{ github.event.pull_request.number || github.ref }}
13+
cancel-in-progress: true
14+
915
jobs:
1016
CodeQL-Build:
1117

1218
runs-on: ubuntu-latest
1319

20+
permissions:
21+
security-events: write
22+
1423
steps:
1524
- name: Checkout repository
16-
uses: actions/checkout@v2
25+
uses: actions/checkout@v3
1726
with:
1827
# We must fetch at least the immediate parents so that if this is
1928
# a pull request then we can checkout the head.
@@ -26,9 +35,9 @@ jobs:
2635

2736
# Initializes the CodeQL tools for scanning.
2837
- name: Initialize CodeQL
29-
uses: github/codeql-action/init@v1
38+
uses: github/codeql-action/init@v2
3039
with:
3140
languages: python
3241

3342
- name: Perform CodeQL Analysis
34-
uses: github/codeql-action/analyze@v1
43+
uses: github/codeql-action/analyze@v2

.gitignore

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,8 @@ venv3/
2828
# pycharm
2929
.idea/
3030

31-
# typshed repo
32-
typeshed/2and3/schema_salad
33-
typeshed/2and3/ruamel/yaml
31+
# local type stubs
32+
mypy-stubs/ruamel/yaml
3433

3534

3635
#mypy

Makefile

Lines changed: 33 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -32,70 +32,78 @@ DEVPKGS=diff_cover black pylint pep257 pydocstyle flake8 tox tox-pyenv \
3232
-rtest-requirements.txt -rmypy-requirements.txt
3333
DEBDEVPKGS=pylint python3-coverage sloccount \
3434
python3-flake8 shellcheck
35-
VERSION=1.2.2 # please also update setup.py
35+
VERSION=1.2.7 # please also update setup.py
3636

37-
## all : default task
37+
## all : default task (install cwl-upgrader in dev mode)
3838
all: dev
3939

40-
## help : print this help message and exit
40+
## help : print this help message and exit
4141
help: Makefile
4242
@sed -n 's/^##//p' $<
4343

44-
## install-dep : install most of the development dependencies via pip
44+
## cleanup : shortcut for "make sort_imports format flake8 diff_pydocstyle_report"
45+
cleanup: sort_imports format flake8 diff_pydocstyle_report
46+
47+
## install-dep : install most of the development dependencies via pip
4548
install-dep: install-dependencies
4649

4750
install-dependencies: FORCE
4851
pip install --upgrade $(DEVPKGS)
4952
pip install -r requirements.txt -r mypy-requirements.txt
5053

51-
## install : install the ${MODULE} module and script(s)
54+
## install : install the cwlupgrader package and scripts
5255
install: FORCE
5356
pip install .$(EXTRAS)
5457

55-
## dev : install the ${MODULE} module in dev mode
58+
## dev : install the cwlupgrader package in dev mode
5659
dev: install-dep
5760
pip install -e .$(EXTRAS)
5861

59-
## dist : create a module package for distribution
62+
## dist : create a module package for distribution
6063
dist: dist/${MODULE}-$(VERSION).tar.gz
6164

6265
dist/${MODULE}-$(VERSION).tar.gz: $(SOURCES)
6366
python setup.py sdist bdist_wheel
6467

65-
## clean : clean up all temporary / machine-generated files
68+
## clean : clean up all temporary / machine-generated files
6669
clean: FORCE
6770
rm -f ${MODILE}/*.pyc tests/*.pyc
6871
python setup.py clean --all || true
6972
rm -Rf .coverage
7073
rm -f diff-cover.html
7174

7275
# Linting and code style related targets
73-
## sorting imports using isort: https://github.com/timothycrosley/isort
76+
## sort_import : sorting imports using isort: https://github.com/timothycrosley/isort
7477
sort_imports: $(PYSOURCES)
75-
isort $^ typeshed
78+
isort $^
7679

7780
remove_unused_imports: $(PYSOURCES)
7881
autoflake --in-place --remove-all-unused-imports $^
7982

8083
pep257: pydocstyle
81-
## pydocstyle : check Python code style
84+
## pydocstyle : check Python docstring style
8285
pydocstyle: $(PYSOURCES)
8386
pydocstyle --add-ignore=D100,D101,D102,D103 $^ || true
8487

8588
pydocstyle_report.txt: $(PYSOURCES)
8689
pydocstyle setup.py $^ > $@ 2>&1 || true
8790

91+
## diff_pydocstyle_report : check Python docstring style for changed files only
8892
diff_pydocstyle_report: pydocstyle_report.txt
89-
diff-quality --compare-branch=main --violations=pycodestyle --fail-under=100 $^
93+
diff-quality --compare-branch=main --violations=pydocstyle --fail-under=100 $^
94+
95+
## codespell : check for common misspellings
96+
codespell:
97+
codespell -w $(shell git ls-files | grep -v mypy-stubs | grep -v gitignore | grep -v EDAM.owl | grep -v pre.yml | grep -v test_schema)
9098

91-
## format : check/fix all code indentation and formatting (runs black)
99+
## format : check/fix all code indentation and formatting (runs black)
92100
format:
93101
black setup.py cwlupgrader tests
94102

95103
format-check:
96-
black --diff --check cwlupgrader setup.py typeshed
104+
black --diff --check cwlupgrader setup.py
97105

98-
## pylint : run static code analysis on Python code
106+
## pylint : run static code analysis on Python code
99107
pylint: $(PYSOURCES)
100108
pylint --msg-template="{path}:{line}: [{msg_id}({symbol}), {obj}] {msg}" \
101109
$^ -j0|| true
@@ -105,7 +113,7 @@ pylint_report.txt: $(PYSOURCES)
105113
$^ -j0> $@ || true
106114

107115
diff_pylint_report: pylint_report.txt
108-
diff-quality --compare-branch main --violations=pylint pylint_report.txt
116+
diff-quality --compare-branch=main --violations=pylint pylint_report.txt
109117

110118
.coverage: testcov
111119

@@ -125,23 +133,23 @@ coverage-report: .coverage
125133
coverage report
126134

127135
diff-cover: coverage.xml
128-
diff-cover --compare-branch main $^
136+
diff-cover --compare-branch=main $^
129137

130138
diff-cover.html: coverage.xml
131139
diff-cover --compare-branch main $^ --html-report $@
132140

133-
## test : run the ${MODULE} test suite
141+
## test : run the cwlupgrader test suite
134142
test: $(PYSOURCES)
135-
python setup.py test
143+
python -m pytest -rs
136144

137-
## testcov : run the ${MODULE} test suite and collect coverage
145+
## testcov : run the cwlupgrader test suite and collect coverage
138146
testcov: $(PYSOURCES)
139147
python setup.py test --addopts "--cov" ${PYTEST_EXTRA}
140148

141149
sloccount.sc: $(PYSOURCES) Makefile
142150
sloccount --duplicates --wide --details $^ > $@
143151

144-
## sloccount : count lines of code
152+
## sloccount : count lines of code
145153
sloccount: $(PYSOURCES) Makefile
146154
sloccount $^
147155

@@ -153,17 +161,17 @@ mypy3: mypy
153161
mypy: $(PYSOURCES)
154162
if ! test -f $(shell python3 -c 'import ruamel.yaml; import os.path; print(os.path.dirname(ruamel.yaml.__file__))')/py.typed ; \
155163
then \
156-
rm -Rf typeshed/ruamel/yaml ; \
164+
rm -Rf mypy-stubs/ruamel/yaml ; \
157165
ln -s $(shell python3 -c 'import ruamel.yaml; import os.path; print(os.path.dirname(ruamel.yaml.__file__))') \
158-
typeshed/ruamel/ ; \
166+
mypy-stubs/ruamel/ ; \
159167
fi # if minimally required ruamel.yaml version is 0.15.99 or greater, than the above can be removed
160-
MYPYPATH=$$MYPYPATH:typeshed mypy $^
168+
MYPYPATH=$$MYPYPATH:mypy-stubs mypy $^
161169

162170
pyupgrade: $(PYSOURCES)
163171
pyupgrade --exit-zero-even-if-changed --py36-plus $^
164172

165173
release-test: FORCE
166-
git diff-index --quiet HEAD -- || ( echo You have uncommited changes, please commit them and try again; false )
174+
git diff-index --quiet HEAD -- || ( echo You have uncommitted changes, please commit them and try again; false )
167175
./release-test.sh
168176

169177
release: release-test

0 commit comments

Comments
 (0)