diff --git a/.gitignore b/.gitignore index 10fdc15e..2d2fcf9e 100644 --- a/.gitignore +++ b/.gitignore @@ -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 diff --git a/Makefile b/Makefile index de6c963b..fb643b2f 100644 --- a/Makefile +++ b/Makefile @@ -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 $^ @@ -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) @@ -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 $^ diff --git a/typeshed/2and3/ruamel/__init__.py b/mypy-stubs/ruamel/__init__.py similarity index 100% rename from typeshed/2and3/ruamel/__init__.py rename to mypy-stubs/ruamel/__init__.py diff --git a/requirements.txt b/requirements.txt index 33c6657a..82f03e5d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -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 diff --git a/setup.py b/setup.py index 8bbca685..57aa98e7 100644 --- a/setup.py +++ b/setup.py @@ -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"]},