Skip to content

Commit

Permalink
rename our local type stubs directory
Browse files Browse the repository at this point in the history
as per python/mypy#13155 (comment)

Set more accurate minimum versions for ruamel-yaml
  • Loading branch information
mr-c committed Jul 20, 2022
1 parent 46d03e1 commit 6ad0df4
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 10 deletions.
5 changes: 2 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,8 @@ venv3/
# pycharm
.idea/

# typshed repo
typeshed/2and3/schema_salad
typeshed/2and3/ruamel/yaml
# local type stubs
mypy-stubs/ruamel/yaml


#mypy
Expand Down
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ clean: FORCE
# Linting and code style related targets
## sorting imports using isort: https://github.com/timothycrosley/isort
sort_imports: $(PYSOURCES)
isort $^ typeshed
isort $^

remove_unused_imports: $(PYSOURCES)
autoflake --in-place --remove-all-unused-imports $^
Expand All @@ -93,7 +93,7 @@ format:
black setup.py cwlupgrader tests

format-check:
black --diff --check cwlupgrader setup.py typeshed
black --diff --check cwlupgrader setup.py

## pylint : run static code analysis on Python code
pylint: $(PYSOURCES)
Expand Down Expand Up @@ -153,11 +153,11 @@ mypy3: mypy
mypy: $(PYSOURCES)
if ! test -f $(shell python3 -c 'import ruamel.yaml; import os.path; print(os.path.dirname(ruamel.yaml.__file__))')/py.typed ; \
then \
rm -Rf typeshed/ruamel/yaml ; \
rm -Rf mypy-stubs/ruamel/yaml ; \
ln -s $(shell python3 -c 'import ruamel.yaml; import os.path; print(os.path.dirname(ruamel.yaml.__file__))') \
typeshed/ruamel/ ; \
mypy-stubs/ruamel/ ; \
fi # if minimally required ruamel.yaml version is 0.15.99 or greater, than the above can be removed
MYPYPATH=$$MYPYPATH:typeshed mypy $^
MYPYPATH=$$MYPYPATH:mypy-stubs mypy $^

pyupgrade: $(PYSOURCES)
pyupgrade --exit-zero-even-if-changed --py36-plus $^
Expand Down
File renamed without changes.
5 changes: 4 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
ruamel.yaml >= 0.14.12, < 0.17.22
ruamel.yaml >= 0.16.0, < 0.17.22;python_version>='3.10'
ruamel.yaml >= 0.15.98, < 0.17.22;python_version>='3.9'
ruamel.yaml >= 0.15.78, < 0.17.22;python_version>='3.8'
ruamel.yaml >= 0.15.71, < 0.17.22
schema-salad
5 changes: 4 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@
package_data={"cwlupgrader.tests": ["../testdata/**/*.cwl"]},
install_requires=[
"setuptools",
"ruamel.yaml >= 0.14.12, < 0.17.22",
"ruamel.yaml >= 0.16.0, < 0.17.22;python_version>='3.10'",
"ruamel.yaml >= 0.15.98, < 0.17.22;python_version>='3.9'",
"ruamel.yaml >= 0.15.78, < 0.17.22;python_version>='3.8'",
"ruamel.yaml >= 0.15.71, < 0.17.22",
"schema_salad",
],
entry_points={"console_scripts": ["cwl-upgrader = cwlupgrader.main:main"]},
Expand Down

0 comments on commit 6ad0df4

Please sign in to comment.