diff --git a/.coveragerc b/.coveragerc new file mode 100644 index 00000000..6086f7fa --- /dev/null +++ b/.coveragerc @@ -0,0 +1,25 @@ +[paths] +source = + cwltest + */site-packages/cwltest + */cwltest + +[run] +branch = True +source_pkgs = cwltest +omit = + tests/* + */site-packages/cwltest/tests/* + +[report] +exclude_lines = + if self.debug: + pragma: no cover + raise NotImplementedError + if __name__ == .__main__.: + if TYPE_CHECKING: + \.\.\. +ignore_errors = True +omit = + tests/* + */site-packages/cwltest/tests/* diff --git a/.flake8 b/.flake8 new file mode 100644 index 00000000..60ef4d02 --- /dev/null +++ b/.flake8 @@ -0,0 +1,9 @@ +[flake8] +ignore = E203,W503 +max-line-length = 100 +select = B,C,E,F,W,T4 +extend-ignore = E501,B905 +# when Python 3.10 is the minimum version, re-enable check B905 for zip + strict +extend-select = B9 +per-file-ignores= + ./tests/test_badgedir.py:B950 diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..bf1d70a2 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,16 @@ +# To get started with Dependabot version updates, you'll need to specify which +# package ecosystems to update and where the package manifests are located. +# Please see the documentation for all configuration options: +# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates + +version: 2 +updates: + - package-ecosystem: "pip" + directory: "/" # Location of package manifests + schedule: + interval: "daily" + # Maintain dependencies for GitHub Actions + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "daily" diff --git a/.github/workflows/ci-tests.yml b/.github/workflows/ci-tests.yml new file mode 100644 index 00000000..bbda8ef2 --- /dev/null +++ b/.github/workflows/ci-tests.yml @@ -0,0 +1,139 @@ +name: Continuous integration tests + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +concurrency: + group: build-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + + tox: + name: CI tests via Tox + + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + # The README.rst file mentions the versions tested, please update it as well + py-ver-major: [3] + py-ver-minor: [9, 10, 11, 12, 13, 14] + step: [lint, unit, mypy, bandit] + + env: + py-semver: ${{ format('{0}.{1}', matrix.py-ver-major, matrix.py-ver-minor) }} + TOXENV: ${{ format('py{0}{1}-{2}', matrix.py-ver-major, matrix.py-ver-minor, matrix.step) }} + + steps: + - uses: actions/checkout@v5 + with: + fetch-depth: 0 + + - name: Set up Python + uses: actions/setup-python@v6 + with: + python-version: ${{ env.py-semver }} + allow-prereleases: true + cache: pip + cache-dependency-path: | + requirements.txt + test-requirements.txt + mypy-requirements.txt + + - name: Upgrade setuptools and install tox + run: | + pip install -U pip setuptools wheel + pip install "tox>4,<5" "tox-gh-actions>3" + + - name: install dev libraries + run: sudo apt-get install -y libxml2-dev libxslt-dev + + - name: MyPy cache + if: ${{ matrix.step == 'mypy' }} + uses: actions/cache@v4 + with: + path: .mypy_cache/${{ env.py-semver }} + key: mypy-${{ env.py-semver }} + + - name: Test with tox + run: tox + + - name: Upload coverage to Codecov + if: ${{ matrix.step == 'unit' }} + uses: codecov/codecov-action@v5 + with: + fail_ci_if_error: true + token: ${{ secrets.CODECOV_TOKEN }} + + tox-style: + name: CI linters via Tox + + runs-on: ubuntu-24.04 + + strategy: + matrix: + step: [lintreadme, pydocstyle] + + env: + py-semver: "3.13" + TOXENV: ${{ format('py313-{0}', matrix.step) }} + + steps: + - uses: actions/checkout@v5 + with: + fetch-depth: 0 + + - name: Set up Python + uses: actions/setup-python@v6 + with: + python-version: ${{ env.py-semver }} + cache: pip + cache-dependency-path: | + requirements.txt + test-requirements.txt + mypy-requirements.txt + + - name: Upgrade setuptools and install tox + run: | + pip install -U pip setuptools wheel + pip install "tox>4,<5" "tox-gh-actions>3" + + - if: ${{ matrix.step == 'pydocstyle' && github.event_name == 'pull_request'}} + name: Create local branch for diff-quality for PRs + run: git branch ${{github.base_ref}} origin/${{github.base_ref}} + + - name: Test with tox + run: tox + + release_test: + name: cwltest release test + + runs-on: ubuntu-24.04 + + steps: + - uses: actions/checkout@v5 + + - name: Set up Python + uses: actions/setup-python@v6 + with: + python-version: "3.13" + cache: pip + cache-dependency-path: | + requirements.txt + test-requirements.txt + mypy-requirements.txt + + - name: Install packages + run: | + pip install -U pip setuptools wheel + pip install virtualenv + + - name: Release test + env: + RELEASE_SKIP: head + run: ./release-test.sh diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 3cd36ce6..6ba449c2 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -2,10 +2,16 @@ name: "Code scanning - action" on: push: + branches: [main] pull_request: + branches: [main] schedule: - cron: '0 17 * * 0' +concurrency: + group: scan-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + jobs: CodeQL-Build: @@ -13,7 +19,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v5 with: # We must fetch at least the immediate parents so that if this is # a pull request then we can checkout the head. @@ -26,9 +32,9 @@ jobs: # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@v1 + uses: github/codeql-action/init@v4 with: languages: python - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v1 + uses: github/codeql-action/analyze@v4 diff --git a/.gitignore b/.gitignore index 27e2aacb..dbcde96b 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,14 @@ *.egg-info build dist + +cwltest/_version.py + +# Generated by tox +coverage.xml +.coverage +.coverage.* +pydocstyle_report.txt + +# Generated by `make release-test` +testenv* diff --git a/.readthedocs.yml b/.readthedocs.yml new file mode 100644 index 00000000..cd1f4405 --- /dev/null +++ b/.readthedocs.yml @@ -0,0 +1,26 @@ +# .readthedocs.yml +# Read the Docs configuration file +# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details + +# Required +version: 2 + +# Build documentation in the docs/ directory with Sphinx +sphinx: + configuration: docs/conf.py + +# Optionally build your docs in additional formats such as PDF and ePub +formats: all + +build: + os: ubuntu-22.04 + tools: + python: "3.11" + apt_packages: + - graphviz + +python: + install: + - requirements: docs/requirements.txt + - method: pip + path: . diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 89a8f691..00000000 --- a/.travis.yml +++ /dev/null @@ -1,64 +0,0 @@ -services: - - docker - -matrix: - include: - - os: linux - language: python - python: 3.5 - script: - - tox - - RELEASE_SKIP=head PYVER=3 ${TRAVIS_BUILD_DIR}/release-test.sh - - os: linux - language: python - python: 3.6 - script: - - tox - - RELEASE_SKIP=head PYVER=3 ${TRAVIS_BUILD_DIR}/release-test.sh - - os: linux - language: python - python: 3.7 - script: - - tox - - RELEASE_SKIP=head PYVER=3 ${TRAVIS_BUILD_DIR}/release-test.sh - - os: linux - language: python - python: 3.8 - script: - - tox - - RELEASE_SKIP=head PYVER=3 ${TRAVIS_BUILD_DIR}/release-test.sh - - os: osx - language: generic - env: TRAVIS_PYTHON_VERSION=3.5 PYENV_VERSION=3.5.4 - - os: osx - language: generic - env: TRAVIS_PYTHON_VERSION=3.6 PYENV_VERSION=3.6.3 - - os: osx - language: generic - env: TRAVIS_PYTHON_VERSION=3.7 PYENV_VERSION=3.7.5 - - os: osx - language: generic - env: TRAVIS_PYTHON_VERSION=3.8 PYENV_VERSION=3.8.0 - -install: - - source $TRAVIS_BUILD_DIR/travis/os_install.sh - - pip install tox-travis - -script: - - tox - -before_cache: - - brew cleanup -cache: - pip: true - directories: - - .mypy_cache - - $HOME/.pyenv_cache - - $HOME/Library/Caches/Homebrew - - $HOME/.pyenv/versions - -branches: - only: - - master -notifications: - email: false diff --git a/MANIFEST.in b/MANIFEST.in index 46873cc4..40bd4c80 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,7 +1,10 @@ -include Makefile gittaggers.py -include cwltest/cwltest-schema.yml -include cwltest/tests/* -include cwltest/tests/test-data/* -include cwltest/tests/test-data/v1.0/* +include Makefile test-requirements.txt mypy-requirements.txt requirements.txt tox.ini mypy.ini +include dev-requirements.txt .flake8 .coveragerc release-test.sh +include docs/Makefile docs/conf.py docs/requirements.txt docs/_static/favicon.ico docs/*.rst +include cwltest/*.yml +include tests/* +include tests/test-data/* +include tests/test-data/v1.0/* +recursive-include mypy-stubs *.py? global-exclude *~ global-exclude *.pyc diff --git a/Makefile b/Makefile index b5bcd1c3..6bcc2a58 100644 --- a/Makefile +++ b/Makefile @@ -15,123 +15,148 @@ # # Contact: common-workflow-language@googlegroups.com -# make pycodestyle to check for basic Python code compliance -# make autopep8 to fix most pep8 errors +# make format to fix most python formatting errors # make pylint to check Python code for enhanced compliance including naming # and documentation # make coverage-report to check coverage of the python scripts by the tests MODULE=cwltest +PACKAGE=cwltest # `SHELL=bash` doesn't work for some, so don't use BASH-isms like # `[[` conditional expressions. -PYSOURCES=$(wildcard ${MODULE}/**.py tests/*.py) setup.py -DEVPKGS=pycodestyle diff_cover pylint coverage pydocstyle flake8 \ - pytest pytest-xdist isort +PYSOURCES=$(wildcard ${MODULE}/**.py tests/*.py) +DEVPKGS=-rdev-requirements.txt -rtest-requirements.txt -rmypy-requirements.txt DEBDEVPKGS=pep8 python-autopep8 pylint python-coverage pydocstyle sloccount \ python-flake8 python-mock shellcheck -VERSION=2.0.$(shell TZ=UTC git log --first-parent --max-count=1 \ +VERSION=2.6.$(shell TZ=UTC git log --first-parent --max-count=1 \ --format=format:%cd --date=format-local:%Y%m%d%H%M%S) -mkfile_dir := $(dir $(abspath $(lastword $(MAKEFILE_LIST)))) -## all : default task -all: FORCE - pip install -e . +## all : default task (install in dev mode) +all: dev -## help : print this help message and exit +## help : print this help message and exit help: Makefile @sed -n 's/^##//p' $< -install-dependencies: install-dep -## install-dep : install most of the development dependencies via pip -install-dep: +## cleanup : shortcut for "make sort_imports format flake8 diff_pydocstyle_report" +cleanup: sort_imports format flake8 diff_pydocstyle_report + +## install-dep : install most of the development dependencies via pip +install-dep: install-dependencies + +install-dependencies: FORCE pip install --upgrade $(DEVPKGS) pip install -r requirements.txt -## install-deb-dep: install most of the dev dependencies via apt-get +## install-deb-dep : install most of the dev dependencies via apt-get install-deb-dep: sudo apt-get install $(DEBDEVPKGS) -## install : install the ${MODULE} module and schema-salad-tool +## install : install the cwltest package and cwltest script install: FORCE pip install . -## dist : create a module package for distribution +## dev : install the cwltest package in dev mode +dev: install-dep + pip install -U pip setuptools wheel + pip install -e . + +## dist : create a module package for distribution dist: dist/${MODULE}-$(VERSION).tar.gz dist/${MODULE}-$(VERSION).tar.gz: $(SOURCES) - ./setup.py sdist bdist_wheel + python -m build + +## docs : make the docs +docs: FORCE + cd docs && $(MAKE) html -## clean : clean up all temporary / machine-generated files +## clean : clean up all temporary / machine-generated files clean: FORCE rm -f ${MODILE}/*.pyc tests/*.pyc - ./setup.py clean --all || true - rm -Rf .coverage + rm -Rf .coverage\.* .coverage rm -f diff-cover.html # Linting and code style related targets -## sorting imports using isort: https://github.com/timothycrosley/isort -sort_imports: - isort ${MODULE}/*.py tests/*.py setup.py +## sort_import : sorting imports using isort: https://github.com/timothycrosley/isort +sort_imports: $(PYSOURCES) mypy-stubs + isort $^ + +remove_unused_imports: $(filter-out schema_salad/metaschema.py,$(PYSOURCES)) + autoflake --in-place --remove-all-unused-imports $^ pep257: pydocstyle -## pydocstyle : check Python code style +## pydocstyle : check Python docstring style pydocstyle: $(PYSOURCES) pydocstyle --add-ignore=D100,D101,D102,D103 $^ || true pydocstyle_report.txt: $(PYSOURCES) - pydocstyle setup.py $^ > $@ 2>&1 || true + pydocstyle $^ > $@ 2>&1 || true +## diff_pydocstyle_report : check Python docstring style for changed files only diff_pydocstyle_report: pydocstyle_report.txt - diff-quality --violations=pycodestyle --fail-under=100 $^ + diff-quality --compare-branch=main --violations=pydocstyle --fail-under=100 $^ + +## codespell : check for common misspellings +codespell: + codespell -w $(shell git ls-files | grep -v mypy-stubs | grep -v gitignore) + +## format : check/fix all code indentation and formatting (runs black) +format: $(filter-out cwltest/_version.py,$(PYSOURCES)) mypy-stubs + black $^ -## format : check/fix all code indentation and formatting (runs black) -format: - black --exclude cwltool/schemas setup.py cwltest +format-check: $(filter-out cwltest/_version.py,$(PYSOURCES)) mypy-stubs + black --diff --check $^ -## pylint : run static code analysis on Python code +## pylint : run static code analysis on Python code pylint: $(PYSOURCES) pylint --msg-template="{path}:{line}: [{msg_id}({symbol}), {obj}] {msg}" \ $^ -j0|| true -pylint_report.txt: ${PYSOURCES} +pylint_report.txt: $(PYSOURCES) pylint --msg-template="{path}:{line}: [{msg_id}({symbol}), {obj}] {msg}" \ $^ -j0> $@ || true diff_pylint_report: pylint_report.txt - diff-quality --violations=pylint pylint_report.txt + diff-quality --compare-branch=main --violations=pylint pylint_report.txt -.coverage: $(PYSOURCES) all - coverage run ./setup.py test +.coverage: $(PYSOURCES) + COV_CORE_SOURCE=cwltest COV_CORE_CONFIG=.coveragerc COV_CORE_DATAFILE=.coverage \ + python -m pytest --cov --cov-append --cov-report= + # https://pytest-cov.readthedocs.io/en/latest/plugins.html#plugin-coverage coverage.xml: .coverage - python-coverage xml + coverage xml coverage.html: htmlcov/index.html htmlcov/index.html: .coverage - python-coverage html + coverage html @echo Test coverage of the Python code is now in htmlcov/index.html coverage-report: .coverage - python-coverage report + coverage report -diff-cover: coverage-gcovr.xml coverage.xml - diff-cover coverage-gcovr.xml coverage.xml +diff-cover: coverage.xml + diff-cover --compare-branch=main $^ -diff-cover.html: coverage-gcovr.xml coverage.xml - diff-cover coverage-gcovr.xml coverage.xml \ - --html-report diff-cover.html +diff-cover.html: coverage.xml + diff-cover --compare-branch=main $^ --html-report $@ -## test : run the ${MODULE} test suite -test: all - ./setup.py test +## test : run the cwltest test suite +test: $(PYSOURCES) + python -m pytest -rs ${PYTEST_EXTRA} -sloccount.sc: ${PYSOURCES} Makefile +## testcov : run the cwltest test suite and collect coverage +testcov: $(PYSOURCES) + pytest --cov ${PYTEST_EXTRA} + +sloccount.sc: $(PYSOURCES) Makefile sloccount --duplicates --wide --details $^ > $@ -## sloccount : count lines of code -sloccount: ${PYSOURCES} Makefile +## sloccount : count lines of code +sloccount: $(PYSOURCES) Makefile sloccount $^ list-author-emails: @@ -139,29 +164,29 @@ list-author-emails: @git log --format='%aN,%aE' | sort -u | grep -v 'root' 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/2and3/ruamel/yaml ; \ - ln -s $(shell python3 -c 'import ruamel.yaml; import os.path; print(os.path.dirname(ruamel.yaml.__file__))') \ - typeshed/2and3/ruamel/ ; \ - fi # if minimally required ruamel.yaml version is 0.15.99 or greater, than the above can be removed - MYPYPATH=$$MYPYPATH:typeshed/3:typeshed/2and3 mypy --disallow-untyped-calls \ - --warn-redundant-casts \ - ${MODULE} +mypy: $(PYSOURCES) + MYPYPATH=$$MYPYPATH:mypy-stubs mypy $^ + +pyupgrade: $(filter-out schema_salad/metaschema.py,$(PYSOURCES)) + pyupgrade --exit-zero-even-if-changed --py39-plus $^ + auto-walrus $^ release-test: FORCE - git diff-index --quiet HEAD -- || ( echo You have uncommited changes, please commit them and try again; false ) + git diff-index --quiet HEAD -- || ( echo You have uncommitted changes, please commit them and try again; false ) ./release-test.sh -release: FORCE - PYVER=3 ./release-test.sh - . testenv3_2/bin/activate && \ - testenv3_2/src/${MODULE}/setup.py sdist bdist_wheel - . testenv3_2/bin/activate && \ +release: + export SETUPTOOLS_SCM_PRETEND_VERSION=${VERSION} && \ + ./release-test.sh && \ + . testenv2/bin/activate && \ + pip install build && \ + python -m build testenv2/src/${PACKAGE} && \ pip install twine && \ - twine upload testenv3_2/src/${MODULE}/dist/*whl && \ - git tag ${VERSION} && git push --tags + twine upload testenv2/src/${PACKAGE}/dist/* && \ + git tag --no-sign ${VERSION} && git push --tags + +flake8: FORCE + flake8 $(PYSOURCES) FORCE: diff --git a/README.rst b/README.rst index decd324f..9a5a2950 100644 --- a/README.rst +++ b/README.rst @@ -1,43 +1,76 @@ -|Linux Build Status| |Windows Build status| |Code coverage| +########################################## +Common Workflow Language testing framework +########################################## -.. |Linux Build Status| image:: https://img.shields.io/travis/common-workflow-language/cwltest/master.svg?label=unix%20build - :target: https://travis-ci.org/common-workflow-language/cwltest -.. |Windows Build status| image:: https://img.shields.io/appveyor/ci/mr-c/cwltest/master.svg?label=windows%20build - :target: https://ci.appveyor.com/project/mr-c/cwltest/branch/master +|Linux Build Status| |Code coverage| + +PyPI: |PyPI Version| |PyPI Downloads Month| |Total PyPI Downloads| + +Conda: |Conda Version| |Conda Installs| + +.. |Linux Build Status| image:: https://github.com/common-workflow-language/cwltest/actions/workflows/ci-tests.yml/badge.svg?branch=main + :target: https://github.com/common-workflow-language/cwltest/actions/workflows/ci-tests.yml .. |Code coverage| image:: https://codecov.io/gh/common-workflow-language/cwltest/branch/master/graph/badge.svg :target: https://codecov.io/gh/common-workflow-language/cwltest -========================================== -Common workflow language testing framework -========================================== +.. |PyPI Version| image:: https://badge.fury.io/py/cwltest.svg + :target: https://badge.fury.io/py/cwltest + +.. |PyPI Downloads Month| image:: https://pepy.tech/badge/cwltest/month + :target: https://pepy.tech/project/cwltest + +.. |Total PyPI Downloads| image:: https://static.pepy.tech/personalized-badge/cwltest?period=total&units=international_system&left_color=black&right_color=orange&left_text=Total%20PyPI%20Downloads + :target: https://pepy.tech/project/cwltest + +.. |Conda Version| image:: https://anaconda.org/bioconda/cwltest/badges/version.svg + :target: https://anaconda.org/bioconda/cwltest + +.. |Conda Installs| image:: https://anaconda.org/bioconda/cwltest/badges/downloads.svg + :target: https://anaconda.org/bioconda/cwltest This is a testing tool for checking the output of Tools and Workflows described with the Common Workflow Language. Among other uses, it is used to run the CWL conformance tests. -This is written and tested for Python 2.7, 3.4, 3.5, 3.6, and 3.7 +This is written and tested for Python 3.9, 3.10, 3.11, 3.12, 3.13, and 3.14 + +.. contents:: Table of Contents + :local: +******* Install -------- +******* -Installing the official package from PyPi:: +Installing the official package from PyPi + +.. code:: bash pip install cwltest -Or from source:: +Or from bioconda + +.. code:: bash + + conda install -c bioconda cwltest + +Or from source + +.. code:: bash git clone https://github.com/common-workflow-language/cwltest.git - cd cwltest && python setup.py install + cd cwltest && pip install . +*********************** Run on the command line ------------------------ +*********************** Simple command:: cwltest --test test-descriptions.yml --tool cwl-runner +***************************************** Generate conformance badges using cwltest ------------------------------------------ +***************************************** To make badges that show the results of the conformance test, you can generate JSON files for https://badgen.net by using --badgedir option @@ -58,3 +91,57 @@ Once you upload JSON file to a server, you make a badge by using a link like htt Here is an example of markdown to add a badge:: ![test result](https://flat.badgen.net/https/path/to/generated/json?icon=commonwl) + +************************* +Custom file access module +************************* + +If your CWL implementation does not write output files to a local file +system location but instead to some other remote storage system, you +can provide an alternate implementation of the *StdFsAccess* object +that is able to access your storage system. + +Step 1: + +Implement your own class with the same public interface of the +*StdFsAccess* object in *cwltest/stdfsaccess.py* (as of this writing, +the methods are *open*, *size*, *isfile* and *isdir*). These methods +should expect to be called with URIs from the *location* field of the +outputs of test cases. + +Define a function that, when called, returns a new instance of your object. + +Step 2: + +Create a Python package containing your class (or add it to an +existing one). + +In the package metadata, add an entry point that declares the module +(in this example, *my_cwl_runner.fsaccess*) containing the function +(in this example, *get_fsaccess*) that *cwltest* will invoke to get an +object implementing the *StdFsAccess* interface. + +In *setup.py* this looks like: + +.. code:: python + + setup( + ... + entry_points={"cwltest.fsaccess": ["fsaccess=my_cwl_runner.fsaccess:get_fsaccess"]}}, + ... + ) + +In *pyproject.toml* it looks like: + +.. code:: + + [project.entry-points.'cwltest.fsaccess'] + fsaccess = 'my_cwl_runner.fsaccess:get_fsaccess' + + +Step 3: + +Install your package in the same Python environemnt as the +installation of *cwltest*. When invoked, *cwltest* will query Python +package metadata for a package with the *cwltest.fsaccess* entry point +and call it to get back a custom filesystem access object. diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index 8ca61233..00000000 --- a/appveyor.yml +++ /dev/null @@ -1,48 +0,0 @@ -version: .{build}-{branch} - -cache: - - '%LOCALAPPDATA%\pip\Cache' - -environment: - - SYSTEMROOT: "C:\\WINDOWS" - - matrix: - - PYTHON: "C:\\Python35-x64" - PYTHON_VERSION: "3.5.x" - PYTHON_ARCH: "64" - - - PYTHON: "C:\\Python36-x64" - PYTHON_VERSION: "3.6.x" - PYTHON_ARCH: "64" - - - PYTHON: "C:\\Python37-x64" - PYTHON_VERSION: "3.7.x" - PYTHON_ARCH: "64" - - - PYTHON: "C:\\Python38-x64" - PYTHON_VERSION: "3.8.x" - PYTHON_ARCH: "64" - -install: - - "%PYTHON%\\python.exe -m pip install -U pip setuptools^>=20.3" - - "SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%" - # Note the use of a `^` to escape the `>` - -build_script: - - | - %PYTHON%\\python.exe -m pip install -U wheel pytest pytest-xdist - %PYTHON%\\python.exe -m pip install -e . - -test_script: - - | - %PYTHON%\\python.exe setup.py test --addopts "--verbose -p no:cacheprovider --junit-xml=tests.xml" - -on_finish: - - ps: | - $wc = New-Object 'System.Net.WebClient' - $wc.UploadFile("https://ci.appveyor.com/api/testresults/junit/$($Env:APPVEYOR_JOB_ID)", (Resolve-Path .\tests.xml)) - -branches: - only: - - master diff --git a/cwltest/__init__.py b/cwltest/__init__.py index d1922980..fa05598e 100755 --- a/cwltest/__init__.py +++ b/cwltest/__init__.py @@ -1,550 +1,14 @@ -#!/usr/bin/env python +"""Run CWL descriptions with a cwl-runner, and look for expected output.""" -import argparse -import json import logging -import os -import shutil -import sys -import tempfile import threading -import time -from typing import Any, Dict, List, Optional, Set, Text, Union -from concurrent.futures import ThreadPoolExecutor -from collections import defaultdict -from rdflib import Graph - -import ruamel.yaml as yaml -import ruamel.yaml.scanner as yamlscanner -import schema_salad.ref_resolver -import schema_salad.schema -import schema_salad.avro.schema -import pkg_resources # part of setuptools - -import junit_xml -from cwltest.utils import ( - compare, - CompareFail, - TestResult, - REQUIRED, - get_test_number_by_key, -) - -_logger = logging.getLogger("cwltest") -_logger.addHandler(logging.StreamHandler()) -_logger.setLevel(logging.INFO) UNSUPPORTED_FEATURE = 33 DEFAULT_TIMEOUT = 600 # 10 minutes +REQUIRED = "required" -if sys.version_info < (3, 0): - import subprocess32 as subprocess - from pipes import quote -else: - import subprocess - from shlex import quote +logger = logging.getLogger("cwltest") +logger.addHandler(logging.StreamHandler()) +logger.setLevel(logging.INFO) templock = threading.Lock() - - -def prepare_test_command( - tool, # type: str - args, # type: List[str] - testargs, # type: Optional[List[str]] - test, # type: Dict[str, str] - cwd, # type: str - verbose=False, # type: bool -): # type: (...) -> List[str] - """ Turn the test into a command line. """ - test_command = [tool] - test_command.extend(args) - - # Add additional arguments given in test case - if testargs is not None: - for testarg in testargs: - (test_case_name, prefix) = testarg.split("==") - if test_case_name in test: - test_command.extend([prefix, test[test_case_name]]) - - # Add prefixes if running on MacOSX so that boot2docker writes to /Users - with templock: - if "darwin" in sys.platform and tool.endswith("cwltool"): - outdir = tempfile.mkdtemp(prefix=os.path.abspath(os.path.curdir)) - test_command.extend( - [ - "--tmp-outdir-prefix={}".format(outdir), - "--tmpdir-prefix={}".format(outdir), - ] - ) - else: - outdir = tempfile.mkdtemp() - test_command.extend(["--outdir={}".format(outdir)]) - if not verbose: - test_command.extend(["--quiet"]) - - cwd = schema_salad.ref_resolver.file_uri(cwd) - toolpath = test["tool"] - if toolpath.startswith(cwd): - toolpath = toolpath[len(cwd)+1:] - test_command.extend([os.path.normcase(toolpath)]) - - jobpath = test.get("job") - if jobpath: - if jobpath.startswith(cwd): - jobpath = jobpath[len(cwd)+1:] - test_command.append(os.path.normcase(jobpath)) - return test_command - - -def run_test( - args, # type: argparse.Namespace - test, # type: Dict[str, str] - test_number, # type: int - total_tests, # type: int - timeout, # type: int - verbose=False, # type: bool -): # type: (...) -> TestResult - - global templock - - out = {} # type: Dict[str,Any] - outdir = outstr = outerr = u"" - test_command = [] # type: List[str] - duration = 0.0 - prefix = "" - suffix = "" - if sys.stderr.isatty(): - prefix = "\r" - else: - suffix = "\n" - try: - process = None # type: Optional[subprocess.Popen[str]] - cwd = os.getcwd() - test_command = prepare_test_command( - args.tool, args.args, args.testargs, test, cwd, verbose - ) - - if test.get("short_name"): - sys.stderr.write( - "%sTest [%i/%i] %s: %s%s\n" - % ( - prefix, - test_number, - total_tests, - test.get("short_name"), - test.get("doc"), - suffix, - ) - ) - else: - sys.stderr.write( - "%sTest [%i/%i] %s%s\n" - % (prefix, test_number, total_tests, test.get("doc"), suffix) - ) - sys.stderr.flush() - - start_time = time.time() - stderr = subprocess.PIPE if not args.verbose else None - process = subprocess.Popen(test_command, stdout=subprocess.PIPE, stderr=stderr, universal_newlines=True, cwd=cwd) - outstr, outerr = process.communicate(timeout=timeout) - return_code = process.poll() - duration = time.time() - start_time - if return_code: - raise subprocess.CalledProcessError(return_code, " ".join(test_command)) - - out = json.loads(outstr) - except ValueError as err: - _logger.error(str(err)) - _logger.error(outstr) - _logger.error(outerr) - except subprocess.CalledProcessError as err: - if err.returncode == UNSUPPORTED_FEATURE and REQUIRED not in test.get( - "tags", ["required"] - ): - return TestResult( - UNSUPPORTED_FEATURE, outstr, outerr, duration, args.classname - ) - if test.get("should_fail", False): - return TestResult(0, outstr, outerr, duration, args.classname) - _logger.error( - u"""Test %i failed: %s""", - test_number, - " ".join([quote(tc) for tc in test_command]), - ) - _logger.error(test.get("doc")) - if err.returncode == UNSUPPORTED_FEATURE: - _logger.error(u"Does not support required feature") - else: - _logger.error(u"Returned non-zero") - _logger.error(outerr) - return TestResult(1, outstr, outerr, duration, args.classname, str(err)) - except (yamlscanner.ScannerError, TypeError) as err: - _logger.error( - u"""Test %i failed: %s""", - test_number, - u" ".join([quote(tc) for tc in test_command]), - ) - _logger.error(outstr) - _logger.error(u"Parse error %s", str(err)) - _logger.error(outerr) - except KeyboardInterrupt: - _logger.error( - u"""Test %i interrupted: %s""", - test_number, - u" ".join([quote(tc) for tc in test_command]), - ) - raise - except subprocess.TimeoutExpired: - _logger.error( - u"""Test %i timed out: %s""", - test_number, - u" ".join([quote(tc) for tc in test_command]), - ) - _logger.error(test.get("doc")) - return TestResult(2, outstr, outerr, timeout, args.classname, "Test timed out") - finally: - if process is not None and process.returncode is None: - _logger.error(u"""Terminating lingering process""") - process.terminate() - for _ in range(0, 3): - time.sleep(1) - if process.poll() is not None: - break - if process.returncode is None: - process.kill() - - fail_message = "" - - if test.get("should_fail", False): - _logger.warning( - u"""Test %i failed: %s""", - test_number, - u" ".join([quote(tc) for tc in test_command]), - ) - _logger.warning(test.get("doc")) - _logger.warning(u"Returned zero but it should be non-zero") - return TestResult(1, outstr, outerr, duration, args.classname) - - try: - compare(test.get("output"), out) - except CompareFail as ex: - _logger.warning( - u"""Test %i failed: %s""", - test_number, - u" ".join([quote(tc) for tc in test_command]), - ) - _logger.warning(test.get("doc")) - _logger.warning(u"Compare failure %s", ex) - fail_message = str(ex) - - if outdir: - shutil.rmtree(outdir, True) - - return TestResult( - (1 if fail_message else 0), - outstr, - outerr, - duration, - args.classname, - fail_message, - ) - - -def arg_parser(): # type: () -> argparse.ArgumentParser - parser = argparse.ArgumentParser( - description="Common Workflow Language testing framework" - ) - parser.add_argument( - "--test", type=str, help="YAML file describing test cases", required=True - ) - parser.add_argument( - "--basedir", type=str, help="Basedir to use for tests", default="." - ) - parser.add_argument("-l", action="https://github.com/store_true", help="List tests then exit") - parser.add_argument( - "-n", type=str, default=None, help="Run specific tests, format is 1,3-6,9" - ) - parser.add_argument( - "-s", - type=str, - default=None, - help="Run specific tests using their short names separated by comma", - ) - parser.add_argument( - "--tool", - type=str, - default="cwl-runner", - help="CWL runner executable to use (default 'cwl-runner'", - ) - parser.add_argument( - "--only-tools", action="https://github.com/store_true", help="Only test CommandLineTools" - ) - parser.add_argument("--tags", type=str, default=None, help="Tags to be tested") - parser.add_argument("--show-tags", action="https://github.com/store_true", help="Show all Tags.") - parser.add_argument( - "--junit-xml", type=str, default=None, help="Path to JUnit xml file" - ) - parser.add_argument( - "--junit-verbose", - action="https://github.com/store_true", - help="Store more verbose output to JUnit xml file", - ) - parser.add_argument( - "--test-arg", - type=str, - help="Additional argument " - "given in test cases and required prefix for tool runner.", - default=None, - metavar="cache==--cache-dir", - action="https://github.com/append", - dest="testargs", - ) - parser.add_argument( - "args", help="arguments to pass first to tool runner", nargs=argparse.REMAINDER - ) - parser.add_argument( - "-j", - type=int, - default=1, - help="Specifies the number of tests to run simultaneously " - "(defaults to one).", - ) - parser.add_argument( - "--verbose", action="https://github.com/store_true", help="More verbose output during test run." - ) - parser.add_argument( - "--classname", - type=str, - default="", - help="Specify classname for the Test Suite.", - ) - parser.add_argument( - "--timeout", - type=int, - default=DEFAULT_TIMEOUT, - help="Time of execution in seconds after which the test will be " - "skipped. Defaults to {} seconds ({} minutes).".format( - DEFAULT_TIMEOUT, DEFAULT_TIMEOUT / 60 - ), - ) - parser.add_argument( - "--badgedir", type=str, help="Directory that stores JSON files for badges." - ) - - pkg = pkg_resources.require("cwltest") - if pkg: - ver = u"%s %s" % (sys.argv[0], pkg[0].version) - else: - ver = u"%s %s" % (sys.argv[0], "unknown version") - parser.add_argument("--version", action="https://github.com/version", version=ver) - - return parser - - -def main(): # type: () -> int - - args = arg_parser().parse_args(sys.argv[1:]) - if "--" in args.args: - args.args.remove("--") - - # Remove test arguments with wrong syntax - if args.testargs is not None: - args.testargs = [ - testarg for testarg in args.testargs if testarg.count("==") == 1 - ] - - if not args.test: - arg_parser().print_help() - return 1 - - schema_resource = pkg_resources.resource_stream(__name__, "cwltest-schema.yml") - cache = {"https://w3id.org/cwl/cwltest/cwltest-schema.yml": schema_resource.read().decode("utf-8")} # type: Optional[Dict[str, Union[str, Graph, bool]]] - (document_loader, - avsc_names, - schema_metadata, - metaschema_loader) = schema_salad.schema.load_schema("https://w3id.org/cwl/cwltest/cwltest-schema.yml", cache=cache) - - if not isinstance(avsc_names, schema_salad.avro.schema.Names): - print(avsc_names) - return 1 - - tests, metadata = schema_salad.schema.load_and_validate(document_loader, avsc_names, args.test, True) - - failures = 0 - unsupported = 0 - passed = 0 - suite_name, _ = os.path.splitext(os.path.basename(args.test)) - report = junit_xml.TestSuite(suite_name, []) - - # the number of total tests, failured tests, unsupported tests and passed tests for each tag - ntotal = defaultdict(int) # type: Dict[str, int] - nfailures = defaultdict(int) # type: Dict[str, int] - nunsupported = defaultdict(int) # type: Dict[str, int] - npassed = defaultdict(int) # type: Dict[str, int] - - if args.only_tools: - alltests = tests - tests = [] - for t in alltests: - loader = schema_salad.ref_resolver.Loader({"id": "@id"}) - cwl = loader.resolve_ref(t["tool"])[0] - if isinstance(cwl, dict): - if cwl["class"] == "CommandLineTool": - tests.append(t) - else: - raise Exception("Unexpected code path.") - - if args.tags: - alltests = tests - tests = [] - tags = args.tags.split(",") - for t in alltests: - ts = t.get("tags", []) - if any((tag in ts for tag in tags)): - tests.append(t) - - for t in tests: - if t.get("label"): - t["short_name"] = t["label"] - - if args.show_tags: - alltags = set() # type: Set[str] - for t in tests: - ts = t.get("tags", []) - alltags |= set(ts) - for tag in alltags: - print(tag) - return 0 - - if args.l: - for i, t in enumerate(tests): - if t.get("short_name"): - print( - u"[%i] %s: %s" % (i + 1, t["short_name"], t.get("doc", "").strip()) - ) - else: - print(u"[%i] %s" % (i + 1, t.get("doc", "").strip())) - - return 0 - - if args.n is not None or args.s is not None: - ntest = [] - if args.n is not None: - for s in args.n.split(","): - sp = s.split("-") - if len(sp) == 2: - ntest.extend(list(range(int(sp[0]) - 1, int(sp[1])))) - else: - ntest.append(int(s) - 1) - if args.s is not None: - for s in args.s.split(","): - test_number = get_test_number_by_key(tests, "short_name", s) - if test_number: - ntest.append(test_number) - else: - _logger.error('Test with short name "%s" not found ', s) - return 1 - else: - ntest = list(range(0, len(tests))) - - total = 0 - with ThreadPoolExecutor(max_workers=args.j) as executor: - jobs = [ - executor.submit( - run_test, - args, - tests[i], - i + 1, - len(tests), - args.timeout, - args.junit_verbose, - ) - for i in ntest - ] - try: - for i, job in zip(ntest, jobs): - test_result = job.result() - test_case = test_result.create_test_case(tests[i]) - test_case.url = "cwltest:{}#{}".format(suite_name, i + 1) - total += 1 - tags = tests[i].get("tags", []) - for t in tags: - ntotal[t] += 1 - - return_code = test_result.return_code - category = test_case.category - if return_code == 0: - passed += 1 - for t in tags: - npassed[t] += 1 - elif return_code != 0 and return_code != UNSUPPORTED_FEATURE: - failures += 1 - for t in tags: - nfailures[t] += 1 - test_case.add_failure_info(output=test_result.message) - elif return_code == UNSUPPORTED_FEATURE and category == REQUIRED: - failures += 1 - for t in tags: - nfailures[t] += 1 - test_case.add_failure_info(output=test_result.message) - elif category != REQUIRED and return_code == UNSUPPORTED_FEATURE: - unsupported += 1 - for t in tags: - nunsupported[t] += 1 - test_case.add_skipped_info("Unsupported") - else: - raise Exception( - "This is impossible, return_code: {}, category: " - "{}".format(return_code, category) - ) - report.test_cases.append(test_case) - except KeyboardInterrupt: - for job in jobs: - job.cancel() - _logger.error("Tests interrupted") - - if args.junit_xml: - with open(args.junit_xml, "w") as xml: - junit_xml.TestSuite.to_file(xml, [report]) - - if args.badgedir: - os.mkdir(args.badgedir) - for t, v in ntotal.items(): - percent = int((npassed[t] / float(v)) * 100) - if npassed[t] == v: - color = "green" - elif t == "required": - color = "red" - else: - color = "yellow" - - with open("{}/{}.json".format(args.badgedir, t), "w") as out: - out.write( - json.dumps( - { - "subject": "{}".format(t), - "status": "{}%".format(percent), - "color": color, - } - ) - ) - - if failures == 0 and unsupported == 0: - _logger.info("All tests passed") - return 0 - if failures == 0 and unsupported > 0: - _logger.warning( - "%i tests passed, %i unsupported features", total - unsupported, unsupported - ) - return 0 - _logger.warning( - "%i tests passed, %i failures, %i unsupported features", - total - (failures + unsupported), - failures, - unsupported, - ) - return 1 - - -if __name__ == "__main__": - sys.exit(main()) diff --git a/cwltest/__main__.py b/cwltest/__main__.py new file mode 100644 index 00000000..ee36e8bb --- /dev/null +++ b/cwltest/__main__.py @@ -0,0 +1,5 @@ +"""Default entrypoint for the cwltest module.""" + +from . import main + +main.main() diff --git a/cwltest/argparser.py b/cwltest/argparser.py new file mode 100644 index 00000000..b5698cf7 --- /dev/null +++ b/cwltest/argparser.py @@ -0,0 +1,120 @@ +"""Command line argument parsing for cwltest.""" + +import argparse +import sys +from importlib.metadata import PackageNotFoundError, version + +from cwltest import DEFAULT_TIMEOUT + + +def arg_parser() -> argparse.ArgumentParser: + """Generate a command Line argument parser for cwltest.""" + parser = argparse.ArgumentParser( + description="Common Workflow Language testing framework" + ) + parser.add_argument( + "--test", type=str, help="YAML file describing test cases", required=True + ) + parser.add_argument( + "--basedir", type=str, help="Basedir to use for tests", default="." + ) + parser.add_argument( + "--baseuri", type=str, help="Base URI to use links in the report", default=None + ) + parser.add_argument("-l", action="https://github.com/store_true", help="List tests then exit") + parser.add_argument( + "-n", type=str, default=None, help="Run specific tests, format is 1,3-6,9" + ) + parser.add_argument( + "-s", + type=str, + default=None, + help="Run specific tests using their short names separated by comma", + ) + parser.add_argument( + "-N", + type=str, + default=None, + help="Exclude specific tests by number, format is 1,3-6,9", + ) + parser.add_argument( + "-S", + type=str, + default=None, + help="Exclude specific tests by short names separated by comma", + ) + parser.add_argument( + "--tool", + type=str, + default="cwl-runner", + help="CWL runner executable to use (default 'cwl-runner'", + ) + parser.add_argument( + "--only-tools", action="https://github.com/store_true", help="Only test CommandLineTools" + ) + parser.add_argument("--tags", type=str, default=None, help="Tags to be tested") + parser.add_argument( + "--exclude-tags", type=str, default=None, help="Tags not to be tested" + ) + parser.add_argument("--show-tags", action="https://github.com/store_true", help="Show all Tags.") + parser.add_argument( + "--junit-xml", type=str, default=None, help="Path to JUnit xml file" + ) + parser.add_argument( + "--junit-verbose", + action="https://github.com/store_true", + help="Store more verbose output to JUnit XML file by not passing " + "'--quiet' to the CWL runner.", + ) + parser.add_argument( + "--test-arg", + type=str, + help="Additional argument " + "given in test cases and required prefix for tool runner.", + default=None, + metavar="cache==--cache-dir", + action="https://github.com/append", + dest="testargs", + ) + parser.add_argument( + "args", help="arguments to pass first to tool runner", nargs=argparse.REMAINDER + ) + parser.add_argument( + "-j", + type=int, + default=1, + help="Specifies the number of tests to run simultaneously " + "(defaults to one).", + ) + parser.add_argument( + "--verbose", action="https://github.com/store_true", help="More verbose output during test run." + ) + parser.add_argument( + "--classname", + type=str, + default="", + help="Specify classname for the Test Suite.", + ) + parser.add_argument( + "--timeout", + type=int, + default=DEFAULT_TIMEOUT, + help="Time of execution in seconds after which the test will be " + "skipped. Defaults to {} seconds ({} minutes).".format( + DEFAULT_TIMEOUT, DEFAULT_TIMEOUT / 60 + ), + ) + parser.add_argument( + "--badgedir", + type=str, + help="Create JSON badges, one for each tag (plus a computed 'all' tag) " + " and store them in this directory.", + ) + + try: + ver = version("cwltest") + except PackageNotFoundError: + ver = "unknown version" + parser.add_argument("--version", action="https://github.com/version", version=f"{sys.argv[0]} {ver}") + + return parser diff --git a/cwltest/compare.py b/cwltest/compare.py new file mode 100644 index 00000000..9af35615 --- /dev/null +++ b/cwltest/compare.py @@ -0,0 +1,263 @@ +"""Compare utilities for CWL objects.""" + +import hashlib +import json +from typing import Any, Callable, Optional + +import cwltest.stdfsaccess + +fs_access = cwltest.stdfsaccess.StdFsAccess("") + + +class CompareFail(Exception): + """Compared CWL objects are not equal.""" + + @classmethod + def format( + cls, expected: Any, actual: Any, cause: Optional[Any] = None + ) -> "CompareFail": + """Load the difference details into the error message.""" + message = "expected: {}\ngot: {}".format( + json.dumps(expected, indent=4, sort_keys=True), + json.dumps(actual, indent=4, sort_keys=True), + ) + if cause: + message += "\ncaused by: %s" % cause + return cls(message) + + +def _check_keys( + keys: set[str], expected: dict[str, Any], actual: dict[str, Any], skip_details: bool +) -> None: + for k in keys: + try: + compare(expected.get(k), actual.get(k), skip_details) + except CompareFail as e: + raise CompareFail.format( + expected, actual, f"field {k!r} failed comparison: {str(e)}" + ) from e + + +def _compare_contents(expected: dict[str, Any], actual: dict[str, Any]) -> None: + with open(actual["path"]) as f: + actual_contents = f.read() + if (expected_contents := expected["contents"]) != actual_contents: + raise CompareFail.format( + expected, + actual, + json.dumps( + "Output file contents do not match: actual '%s' is not equal to expected '%s'" + % (actual_contents, expected_contents) + ), + ) + + +def _compare_dict( + expected: dict[str, Any], actual: dict[str, Any], skip_details: bool +) -> None: + for c in expected: + try: + compare(expected[c], actual.get(c), skip_details) + except CompareFail as e: + raise CompareFail.format( + expected, actual, f"failed comparison for key {c!r}: {e}" + ) from e + extra_keys = set(actual.keys()).difference(list(expected.keys())) + for k in extra_keys: + if actual[k] is not None: + raise CompareFail.format(expected, actual, "unexpected key '%s'" % k) + + +def _compare_directory( + expected: dict[str, Any], actual: dict[str, Any], skip_details: bool +) -> None: + if actual.get("class") != "Directory": + raise CompareFail.format( + expected, actual, "expected object with a class 'Directory'" + ) + if "listing" not in actual: + raise CompareFail.format( + expected, actual, "'listing' is mandatory field in Directory object" + ) + for i in expected["listing"]: + found = False + for j in actual["listing"]: + try: + compare(i, j, skip_details) + found = True + break + except CompareFail: + pass + if not found: + raise CompareFail.format( + expected, + actual, + "%s not found" % json.dumps(i, indent=4, sort_keys=True), + ) + _compare_file(expected, actual, skip_details) + + +def _compare_file( + expected: dict[str, Any], actual: dict[str, Any], skip_details: bool +) -> None: + _compare_location(expected, actual, skip_details) + if "contents" in expected: + _compare_contents(expected, actual) + if actual.get("class") == "File" and not skip_details: + _compare_checksum(expected, actual) + _compare_size(expected, actual) + other_keys = set(expected.keys()) - { + "path", + "location", + "listing", + "contents", + "checksum", + "size", + } + _check_keys(other_keys, expected, actual, skip_details) + + +def _compare_location( + expected: dict[str, Any], actual: dict[str, Any], skip_details: bool +) -> None: + if "path" in expected: + expected_comp = "path" + if "path" not in actual: + actual["path"] = actual["location"] + elif "location" in expected: + expected_comp = "location" + else: + return + if "path" in actual: + actual_comp = "path" + else: + actual_comp = "location" + + if actual.get("class") == "Directory": + actual[actual_comp] = actual[actual_comp].rstrip("/") + exist_fun: Callable[[str], bool] = fs_access.isdir + else: + exist_fun = fs_access.isfile + + if not exist_fun(actual[actual_comp]) and not skip_details: + raise CompareFail.format( + expected, + actual, + f"{actual[actual_comp]} does not exist", + ) + if expected[expected_comp] != "Any" and ( + not ( + actual[actual_comp].endswith("/" + expected[expected_comp]) + or ( + "/" not in actual[actual_comp] + and expected[expected_comp] == actual[actual_comp] + ) + ) + ): + raise CompareFail.format( + expected, + actual, + f"{actual[actual_comp]} does not end with {expected[expected_comp]}", + ) + + +def _compare_checksum(expected: dict[str, Any], actual: dict[str, Any]) -> None: + if "path" in actual: + path = actual["path"] + else: + path = actual["location"] + checksum = hashlib.sha1() # nosec + + with fs_access.open(path, "rb") as f: + contents = f.read(1024 * 1024) + while contents != b"": + checksum.update(contents) + contents = f.read(1024 * 1024) + + actual_checksum_on_disk = f"sha1${checksum.hexdigest()}" + if "checksum" in actual: + actual_checksum_declared = actual["checksum"] + if actual_checksum_on_disk != actual_checksum_declared: + raise CompareFail.format( + expected, + actual, + "Output file checksums do not match: actual " + f"{actual_checksum_on_disk!r} on disk is not equal to actual " + f"{actual_checksum_declared!r} in the output object", + ) + if "checksum" in expected: + expected_checksum = expected["checksum"] + if expected_checksum != actual_checksum_on_disk: + raise CompareFail.format( + expected, + actual, + "Output file checksums do not match: actual " + f"{actual_checksum_on_disk!r} is not equal to expected {expected_checksum!r}", + ) + + +def _compare_size(expected: dict[str, Any], actual: dict[str, Any]) -> None: + if "path" in actual: + path = actual["path"] + else: + path = actual["location"] + + actual_size_on_disk = fs_access.size(path) + + if "size" in actual: + actual_size_declared = actual["size"] + if actual_size_on_disk != actual_size_declared: + raise CompareFail.format( + expected, + actual, + "Output file sizes do not match: actual " + f"{actual_size_on_disk!r} on disk is not equal to actual " + f"{actual_size_declared!r}' in the output object", + ) + if "size" in expected: + expected_size = expected["size"] + if expected_size != actual_size_on_disk: + raise CompareFail.format( + expected, + actual, + "Output file sizes do not match: actual " + f"{actual_size_on_disk!r} is not equal to expected {expected_size!r}", + ) + + +def compare(expected: Any, actual: Any, skip_details: bool = False) -> None: + """Compare two CWL objects.""" + if expected == "Any": + return + if expected is not None and actual is None: + raise CompareFail.format(expected, actual) + + try: + if isinstance(expected, dict): + if not isinstance(actual, dict): + raise CompareFail.format(expected, actual) + + if expected.get("class") == "File": + _compare_file(expected, actual, skip_details) + elif expected.get("class") == "Directory": + _compare_directory(expected, actual, skip_details) + else: + _compare_dict(expected, actual, skip_details) + + elif isinstance(expected, list): + if not isinstance(actual, list): + raise CompareFail.format(expected, actual) + + if len(expected) != len(actual): + raise CompareFail.format(expected, actual, "lengths don't match") + for c in range(0, len(expected)): + try: + compare(expected[c], actual[c], skip_details) + except CompareFail as e: + raise CompareFail.format(expected, actual, e) from e + else: + if expected != actual: + raise CompareFail.format(expected, actual) + + except Exception as e: + raise CompareFail(str(e)) from e diff --git a/cwltest/cwltest-schema-strict.yml b/cwltest/cwltest-schema-strict.yml new file mode 100644 index 00000000..3ce52dd9 --- /dev/null +++ b/cwltest/cwltest-schema-strict.yml @@ -0,0 +1,27 @@ +$base: "https://w3id.org/cwl/cwltest#" +$graph: + - name: TestCase + type: record + documentRoot: true + fields: + id: + type: string + jsonldPredicate: + _type: "@id" + identity: true + short_name: string? + doc: string? + tags: string[] + tool: + type: string + jsonldPredicate: + _type: "@id" + job: + type: string? + jsonldPredicate: + _type: "@id" + should_fail: + type: boolean? + default: false + output: + type: Any? diff --git a/cwltest/cwltest-schema.yml b/cwltest/cwltest-schema.yml index e084a75c..3d40c7ca 100644 --- a/cwltest/cwltest-schema.yml +++ b/cwltest/cwltest-schema.yml @@ -21,6 +21,8 @@ $graph: type: string? jsonldPredicate: _type: "@id" - should_fail: boolean? + should_fail: + type: boolean? + default: false output: type: Any? diff --git a/cwltest/hooks.py b/cwltest/hooks.py new file mode 100644 index 00000000..9b792e8e --- /dev/null +++ b/cwltest/hooks.py @@ -0,0 +1,23 @@ +"""Hooks for pytest-cwl users.""" + +from typing import Any, Optional + +from cwltest import utils + + +def pytest_cwl_execute_test( # type: ignore[empty-body] + config: utils.CWLTestConfig, processfile: str, jobfile: Optional[str] +) -> tuple[int, Optional[dict[str, Any]]]: + """ + Execute CWL test using a Python function instead of a command line runner. + + The return value is a tuple. + - status code + - 0 = success + - :py:attr:`cwltest.UNSUPPORTED_FEATURE` for an unsupported feature + - and any other number for failure + - CWL output object using plain Python objects. + + :param processfile: a path to a CWL document + :param jobfile: an optionl path to JSON/YAML input object + """ diff --git a/cwltest/main.py b/cwltest/main.py new file mode 100644 index 00000000..c38efd25 --- /dev/null +++ b/cwltest/main.py @@ -0,0 +1,273 @@ +#!/usr/bin/env python3 +"""Entry point for cwltest.""" + +import argparse +import os +import sys +from collections import Counter, defaultdict +from concurrent.futures import ThreadPoolExecutor +from typing import Optional, cast + +import junit_xml +import schema_salad.avro +import schema_salad.ref_resolver +import schema_salad.schema +from schema_salad.exceptions import ValidationException + +from cwltest import logger, utils +from cwltest.argparser import arg_parser +from cwltest.utils import ( + CWLTestConfig, + CWLTestReport, + TestResult, + load_optional_fsaccess_plugin, +) + +if sys.stderr.isatty(): + PREFIX = "\r" + SUFFIX = "" +else: + PREFIX = "" + SUFFIX = "\n" + + +def _run_test( + args: argparse.Namespace, + test: dict[str, str], + test_number: int, + total_tests: int, +) -> TestResult: + if test.get("short_name"): + sys.stderr.write( + "%sTest [%i/%i] %s: %s%s\n" + % ( + PREFIX, + test_number, + total_tests, + test.get("short_name"), + test.get("doc", "").replace("\n", " ").strip(), + SUFFIX, + ) + ) + else: + sys.stderr.write( + "%sTest [%i/%i] %s%s\n" + % ( + PREFIX, + test_number, + total_tests, + test.get("doc", "").replace("\n", " ").strip(), + SUFFIX, + ) + ) + sys.stderr.flush() + config = CWLTestConfig( + basedir=args.basedir, + test_baseuri=args.baseuri, + test_basedir=args.test_basedir, + classname=args.classname, + entry=args.test, + entry_line=test["line"], + tool=args.tool, + args=args.args, + testargs=args.testargs, + timeout=args.timeout, + verbose=args.verbose, + runner_quiet=not args.junit_verbose, + ) + return utils.run_test_plain(config, test, test_number) + + +def _expand_number_range(nr: str) -> list[int]: + result: list[int] = [] + for s in nr.split(","): + sp = s.split("-") + if len(sp) == 2: + result.extend(range(int(sp[0]) - 1, int(sp[1]))) + else: + result.append(int(s) - 1) + return result + + +def main() -> int: + """Run the main logic loop.""" + args = arg_parser().parse_args(sys.argv[1:]) + if "--" in args.args: + args.args.remove("--") + + # Remove test arguments with wrong syntax + if args.testargs is not None: + args.testargs = [ + testarg for testarg in args.testargs if testarg.count("==") == 1 + ] + + if not args.test: + arg_parser().print_help() + return 1 + + args.test_basedir = os.path.dirname(utils.absuri(args.test)) + "/" + if args.baseuri is None: + args.baseuri = "file://" + args.test_basedir + if not args.baseuri.endswith("/"): + args.baseuri = args.baseuri + "/" + + try: + tests, metadata = utils.load_and_validate_tests(args.test) + except ValidationException: + return 1 + + failures = 0 + unsupported = 0 + suite_name, _ = os.path.splitext(os.path.basename(args.test)) + report: Optional[junit_xml.TestSuite] = junit_xml.TestSuite(suite_name, []) + + load_optional_fsaccess_plugin() + + ntotal: dict[str, int] = Counter() + npassed: dict[str, list[CWLTestReport]] = defaultdict(list) + + if args.only_tools: + alltests = tests + tests = [] + for t in alltests: + loader = schema_salad.ref_resolver.Loader({"id": "@id"}) + cwl = loader.resolve_ref(t["tool"])[0] + if isinstance(cwl, dict): + if cwl["class"] == "CommandLineTool": + tests.append(t) + else: + raise Exception("Unexpected code path.") + + if args.tags: + tags = set(args.tags.split(",")) + tests = [t for t in tests if tags.intersection(t.get("tags", []))] + + if args.exclude_tags: + tags = set(args.exclude_tags.split(",")) + tests = [t for t in tests if not tags.intersection(t.get("tags", []))] + + for t in tests: + if t.get("label"): + logger.warning("The `label` field is deprecated. Use `id` field instead.") + t["short_name"] = t["label"] # noqa: B909 + elif t.get("id"): + if isinstance(t.get("id"), str): + t["short_name"] = utils.shortname(t["id"]) + else: + logger.warning( + "The `id` field with integer is deprecated. Use string identifier instead." + ) + else: + logger.warning("The `id` field is missing.") + + if args.show_tags: + alltags: set[str] = set() + for t in tests: + ts = t.get("tags", []) + alltags |= set(ts) + for tag in sorted(alltags): + print(tag) + return 0 + + if args.l: + for i, t in enumerate(tests): + if t.get("short_name"): + print( + "[%i] %s: %s" + % ( + i + 1, + t["short_name"], + t.get("doc", "").replace("\n", " ").strip(), + ) + ) + else: + print("[%i] %s" % (i + 1, t.get("doc", "").replace("\n", " ").strip())) + + return 0 + + if args.n is not None or args.s is not None: + ntest = [] + if args.n is not None: + ntest = _expand_number_range(args.n) + if args.s is not None: + for s in args.s.split(","): + test_number = utils.get_test_number_by_key(tests, "short_name", s) + if test_number: + ntest.append(test_number) + else: + logger.error('Test with short name "%s" not found ', s) + return 1 + else: + ntest = list(range(0, len(tests))) + + exclude_n = [] + if args.N is not None: + exclude_n = _expand_number_range(args.N) + if args.S is not None: + for s in args.S.split(","): + test_number = utils.get_test_number_by_key(tests, "short_name", s) + if test_number: + exclude_n.append(test_number) + else: + logger.error('Test with short name "%s" not found ', s) + return 1 + + ntest = list(filter(lambda x: x not in exclude_n, ntest)) + + total = 0 + with ThreadPoolExecutor(max_workers=args.j) as executor: + jobs = [ + executor.submit( + _run_test, + args, + tests[i], + i + 1, + len(tests), + ) + for i in ntest + ] + try: + ( + total, + passed, + failures, + unsupported, + ntotal, + npassed, + nfailures, + nunsupported, + report, + ) = utils.parse_results( + (job.result() for job in jobs), tests, suite_name, report + ) + except KeyboardInterrupt: + for job in jobs: + job.cancel() + logger.error("Tests interrupted") + + if args.junit_xml: + with open(args.junit_xml, "w") as xml: + junit_xml.to_xml_report_file(xml, [cast(junit_xml.TestSuite, report)]) + + if args.badgedir: + utils.generate_badges(args.badgedir, ntotal, npassed, nfailures, nunsupported) + + if failures == 0 and unsupported == 0: + logger.info("All tests passed") + return 0 + if failures == 0 and unsupported > 0: + logger.warning( + "%i tests passed, %i unsupported features", total - unsupported, unsupported + ) + return 0 + logger.warning( + "%i tests passed, %i failures, %i unsupported features", + total - (failures + unsupported), + failures, + unsupported, + ) + return 1 + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/cwltest/plugin.py b/cwltest/plugin.py new file mode 100644 index 00000000..5dabf9ea --- /dev/null +++ b/cwltest/plugin.py @@ -0,0 +1,465 @@ +"""Discovers CWL test files and converts them to pytest.Items.""" + +import argparse +import json +import os +import pickle # nosec +import time +import traceback +from collections.abc import Iterator +from io import StringIO +from pathlib import Path +from typing import TYPE_CHECKING, Any, Optional, Protocol, Union, cast +from urllib.parse import urljoin + +import pytest + +from cwltest import REQUIRED, UNSUPPORTED_FEATURE, logger, utils +from cwltest.compare import CompareFail, compare + +if TYPE_CHECKING: + from _pytest._code.code import TracebackStyle + from _pytest.nodes import Node + from pluggy import HookCaller + + +class TestRunner(Protocol): + """Protocol to type-check test runner functions via the pluggy hook.""" + + def __call__( + self, config: utils.CWLTestConfig, processfile: str, jobfile: Optional[str] + ) -> list[Optional[dict[str, Any]]]: + """Type signature for pytest_cwl_execute_test hook results.""" + ... + + +def _get_comma_separated_option(config: pytest.Config, name: str) -> list[str]: + options = config.getoption(name) + if options is None: + return [] + elif "," in options: + return [opt.strip() for opt in options.split(",")] + else: + return [options.strip()] + + +def _run_test_hook_or_plain( + test: dict[str, str], + config: utils.CWLTestConfig, + hook: "HookCaller", +) -> utils.TestResult: + """Run tests using a provided pytest_cwl_execute_test hook or the --cwl-runner.""" + processfile, jobfile = utils.prepare_test_paths(test, config.basedir) + start_time = time.time() + reltool = os.path.relpath(test["tool"], start=config.test_basedir) + tooluri = urljoin(config.test_baseuri, reltool) + if test.get("job", None): + reljob = os.path.relpath(test["job"], start=config.test_basedir) + joburi = urljoin(config.test_baseuri, reljob) + else: + joburi = None + outerr = "" + hook_out = hook(config=config, processfile=processfile, jobfile=jobfile) + if not hook_out: + return utils.run_test_plain(config, test) + returncode, out = cast(tuple[int, Optional[dict[str, Any]]], hook_out[0]) + duration = time.time() - start_time + outstr = json.dumps(out) if out is not None else "{}" + if returncode == UNSUPPORTED_FEATURE: + if REQUIRED not in test.get("tags", ["required"]): + return utils.TestResult( + UNSUPPORTED_FEATURE, + outstr, + "", + duration, + config.classname, + config.entry, + tooluri, + joburi, + ) + elif returncode != 0: + if not bool(test.get("should_fail", False)): + logger.warning("Test failed unexpectedly: %s %s", processfile, jobfile) + logger.warning(test.get("doc")) + message = "Returned non-zero but it should be zero" + return utils.TestResult( + 1, + outstr, + outerr, + duration, + config.classname, + config.entry, + tooluri, + joburi, + message, + ) + return utils.TestResult( + 0, + outstr, + outerr, + duration, + config.classname, + config.entry, + tooluri, + joburi, + ) + if bool(test.get("should_fail", False)): + return utils.TestResult( + 1, + outstr, + outerr, + duration, + config.classname, + config.entry, + tooluri, + joburi, + "Test should failed, but it did not.", + ) + + fail_message = "" + + try: + compare(test.get("output"), out) + except CompareFail as ex: + logger.warning("""Test failed: %s %s""", processfile, jobfile) + logger.warning(test.get("doc")) + logger.warning("Compare failure %s", ex) + fail_message = str(ex) + + return utils.TestResult( + (1 if fail_message else 0), + outstr, + outerr, + duration, + config.classname, + config.entry, + tooluri, + joburi, + fail_message, + ) + + +class CWLTestException(Exception): + """custom exception for error reporting.""" + + +class CWLItem(pytest.Item): + """A CWL test Item.""" + + def __init__( + self, + name: str, + parent: Optional["Node"], + spec: dict[str, Any], + ) -> None: + """Initialize this CWLItem.""" + super().__init__(name, parent) + self.spec = spec + + def runtest(self) -> None: + """Execute using cwltest.""" + cwl_args = self.config.getoption("cwl_args") + config = utils.CWLTestConfig( + basedir=self.config.getoption("cwl_basedir"), + test_baseuri=self.config.getoption("cwl_basedir"), + test_basedir=self.config.getoption("cwl_basedir"), + entry="tests.yaml", + entry_line="0", + outdir=str( + self.config._tmp_path_factory.mktemp( # type: ignore[attr-defined] + self.spec.get("label", "unlabled_test") + ) + ), + tool=self.config.getoption("cwl_runner"), + args=cwl_args.split(" ") if cwl_args else None, + testargs=self.config.getoption("cwl_test_arg"), + timeout=self.config.getoption("timeout", None), + verbose=self.config.getoption("verbose", 0) >= 1, + runner_quiet=not self.config.getoption("cwl_runner_verbose", False), + ) + hook = self.config.hook.pytest_cwl_execute_test + result = _run_test_hook_or_plain( + self.spec, + config, + hook, + ) + cwl_results = self.config.cwl_results # type: ignore[attr-defined] + cast(list[tuple[dict[str, Any], utils.TestResult]], cwl_results).append( + (self.spec, result) + ) + if result.return_code != 0: + raise CWLTestException(self, result) + + def repr_failure( + self, + excinfo: pytest.ExceptionInfo[BaseException], + style: Optional["TracebackStyle"] = None, + ) -> str: + """ + Document failure reason. + + Called when self.runtest() raises an exception. + """ + if isinstance(excinfo.value, CWLTestException): + from ruamel.yaml.main import YAML + + yaml = YAML() + result = excinfo.value.args[1] + stream = StringIO() + yaml.dump(self.spec, stream) + return "\n".join( + [ + "CWL test execution failed. ", + result.message, + f"Test: {stream.getvalue()}", + ] + ) + else: + return ( + f"{excinfo.type.__name__} occurred during CWL test execution:\n" + + "".join( + traceback.format_exception( + excinfo.type, excinfo.value, excinfo.traceback[0]._rawentry + ) + ) + ) + + def reportinfo(self) -> tuple[Union["os.PathLike[str]", str], Optional[int], str]: + """Status report.""" + return self.path, 0, "cwl test: %s" % self.name + + +class CWLYamlFile(pytest.File): + """A CWL test file.""" + + def _add_global_properties(self) -> None: + """Nonfunctional if xdist is installed and anything besides "-n 0" is used.""" + from _pytest.junitxml import xml_key + + if xml := self.config._store.get(xml_key, None): + xml.add_global_property("runner", self.config.getoption("cwl_runner")) + xml.add_global_property( + "runner_extra_args", self.config.getoption("cwl_args") + ) + + def collect(self) -> Iterator[CWLItem]: + """Load the cwltest file and yield parsed entries.""" + include: set[str] = set(_get_comma_separated_option(self.config, "cwl_include")) + exclude: set[str] = set(_get_comma_separated_option(self.config, "cwl_exclude")) + tags: set[str] = set(_get_comma_separated_option(self.config, "cwl_tags")) + exclude_tags: set[str] = set( + _get_comma_separated_option(self.config, "cwl_exclude_tags") + ) + tests, _ = utils.load_and_validate_tests(str(self.path)) + self._add_global_properties() + for entry in tests: + entry_tags = entry.get("tags", []) + if "label" in entry: + name = entry["label"] + elif "id" in entry: + name = utils.shortname(entry["id"]) + else: + name = entry.get("doc", "") + item = CWLItem.from_parent(self, name=name, spec=entry) + if include and name not in include: + item.add_marker( + pytest.mark.skip( + reason=f"Test {name!r} is not in the include list: {','.join(include)}." + ) + ) + elif exclude and name in exclude: + item.add_marker( + pytest.mark.skip(reason=f"Test {name!r} is in the exclude list.") + ) + elif tags and not tags.intersection(entry_tags): + item.add_marker( + pytest.mark.skip( + reason=f"Test {name!r} with tags {','.join(entry_tags)}" + f" doesn't have a tag on the allowed tag list: {','.join(tags)}." + ) + ) + elif exclude_tags and exclude_tags.intersection(entry_tags): + item.add_marker( + pytest.mark.skip( + reason=f"Test {name!r} has one or more tags on the exclusion " + f" tag list: {','.join(exclude_tags.intersection(entry_tags))}." + ) + ) + yield item + + +__OPTIONS: list[tuple[str, dict[str, Any]]] = [ + ( + "--cwl-runner", + { + "type": str, + "dest": "cwl_runner", + "default": "cwl-runner", + "help": "Name of the CWL runner to use.", + }, + ), + ( + "--cwl-runner-verbose", + { + "dest": "cwl_runner_verbose", + "default": False, + "action": "store_true", + "help": "If set, don't pass --quiet to the CWL runner.", + }, + ), + ( + "--cwl-badgedir", + { + "type": str, + "help": "Create badge JSON files, one for each tag (plus a computed " + "'all' tag), and store them in this directory.", + }, + ), + ( + "--cwl-include", + { + "type": str, + "help": "Run specific CWL tests using their short names separated by comma", + }, + ), + ( + "--cwl-exclude", + { + "type": str, + "help": "Exclude specific CWL tests using their short names separated by comma", + }, + ), + ("--cwl-tags", {"type": str, "help": "Tags to be tested."}), + ("--cwl-exclude-tags", {"type": str, "help": "Tags not to be tested."}), + ( + "--cwl-args", + { + "type": str, + "help": "one or more arguments to pass first to tool runner (separated by spaces)", + }, + ), + ( + "--cwl-test-arg", + { + "type": str, + "help": "Additional argument given in test cases and required prefix for tool runner.", + "action": "append", + }, + ), + ( + "--cwl-basedir", + { + "help": "Basedir to use for tests", + "default": os.getcwd(), + }, + ), +] + + +def pytest_addoption(parser: pytest.Parser) -> None: + """Add our options to the pytest command line.""" + for entry in __OPTIONS: + parser.addoption(entry[0], **entry[1]) + + +def _doc_options() -> argparse.ArgumentParser: + """Generate a stand-alone ArgumentParser to aid in documention.""" + parser = argparse.ArgumentParser("cwltest options for pytest.", add_help=False) + for entry in __OPTIONS: + parser.add_argument(entry[0], **entry[1]) + return parser + + +def pytest_collect_file( + file_path: Path, parent: pytest.Collector +) -> Optional[pytest.Collector]: + """Is this file for us.""" + if ( + file_path.suffix == ".yml" or file_path.suffix == ".yaml" + ) and file_path.stem.endswith(".cwltest"): + return cast( + Optional[pytest.Collector], + CWLYamlFile.from_parent(parent, path=file_path), + ) + return None + + +def pytest_configure(config: pytest.Config) -> None: + """Store the raw tests and the test results.""" + cwl_results: list[tuple[dict[str, Any], utils.TestResult]] = [] + config.cwl_results = cwl_results # type: ignore[attr-defined] + + +def _zip_results( + cwl_results: list[tuple[dict[str, Any], utils.TestResult]], +) -> tuple[list[dict[str, Any]], list[utils.TestResult]]: + tests, results = (list(item) for item in zip(*cwl_results)) + return tests, results + + +def pytest_sessionfinish(session: pytest.Session) -> None: + """Generate badges.""" + cwl_badgedir = session.config.getoption("cwl_badgedir") + if not cwl_badgedir: + return + + cwl_results = cast( + list[tuple[dict[str, Any], utils.TestResult]], + session.config.cwl_results, # type: ignore[attr-defined] + ) + + if session.config.pluginmanager.has_plugin("xdist"): + import xdist # type: ignore[import-untyped] + + directory = cast( + pytest.TempPathFactory, + session.config._tmp_path_factory, # type: ignore[attr-defined] + ).getbasetemp() + if xdist.is_xdist_worker(session): + if not cwl_results: + return + pickle_filename = f"cwltest_{xdist.get_xdist_worker_id(session)}.pickle" + with (directory.parent / pickle_filename).open("wb") as handle: + pickle.dump( + _zip_results(cwl_results), handle, protocol=pickle.HIGHEST_PROTOCOL + ) + return + + if xdist.is_xdist_controller(session): + tests: list[dict[str, Any]] = [] + results: list[utils.TestResult] = [] + for pickle_filepath in directory.glob("cwltest_*"): + with pickle_filepath.open("rb") as handle: + new_tests, new_results = pickle.load(handle) # nosec + tests.extend(new_tests) + results.extend(new_results) + else: + if not cwl_results: + return + tests, results = _zip_results(cwl_results) + + else: + if not cwl_results: + return + tests, results = _zip_results(cwl_results) + + ( + total, + passed, + failures, + unsupported, + ntotal, + npassed, + nfailures, + nunsupported, + _, + ) = utils.parse_results(results, tests) + + utils.generate_badges(cwl_badgedir, ntotal, npassed, nfailures, nunsupported) + + +def pytest_addhooks(pluginmanager: pytest.PytestPluginManager) -> None: + """Register our cwl hooks.""" + from cwltest import hooks + + pluginmanager.add_hookspecs(hooks) diff --git a/cwltest/tests/__init__.py b/cwltest/py.typed similarity index 100% rename from cwltest/tests/__init__.py rename to cwltest/py.typed diff --git a/cwltest/stdfsaccess.py b/cwltest/stdfsaccess.py new file mode 100644 index 00000000..b59375e3 --- /dev/null +++ b/cwltest/stdfsaccess.py @@ -0,0 +1,48 @@ +"""Abstracted IO access.""" + +import os +import urllib +from typing import IO, Any + +from schema_salad.ref_resolver import uri_file_path + + +def abspath(src: str, basedir: str) -> str: + """Determine local filesystem absolute path given a basedir, handling both plain paths and URIs.""" + if src.startswith("file://"): + abpath = uri_file_path(src) + elif urllib.parse.urlsplit(src).scheme in ["http", "https"]: + return src + else: + if basedir.startswith("file://"): + abpath = src if os.path.isabs(src) else basedir + "/" + src + else: + abpath = src if os.path.isabs(src) else os.path.join(basedir, src) + return abpath + + +class StdFsAccess: + """Local filesystem implementation.""" + + def __init__(self, basedir: str) -> None: + """Perform operations with respect to a base directory.""" + self.basedir = basedir + + def _abs(self, p: str) -> str: + return abspath(p, self.basedir) + + def open(self, fn: str, mode: str) -> IO[Any]: + """Open a file from a file: URI.""" + return open(self._abs(fn), mode) + + def size(self, fn: str) -> int: + """Get the size of the file resource pointed to by a URI.""" + return os.stat(self._abs(fn)).st_size + + def isfile(self, fn: str) -> bool: + """Determine if a resource pointed to by a URI represents a file.""" + return os.path.isfile(self._abs(fn)) + + def isdir(self, fn: str) -> bool: + """Determine if a resource pointed to by a URI represents a directory.""" + return os.path.isdir(self._abs(fn)) diff --git a/cwltest/tests/test_argparse.py b/cwltest/tests/test_argparse.py deleted file mode 100644 index 6a5c067b..00000000 --- a/cwltest/tests/test_argparse.py +++ /dev/null @@ -1,20 +0,0 @@ -import unittest -from cwltest import arg_parser - - -class TestArgparse(unittest.TestCase): - def setUp(self): - self.parser = arg_parser() - - def test_arg(self): - parsed = self.parser.parse_args( - ["--test", "test_name", "-n", "52", "--tool", "cwltool", "-j", "4"] - ) - self.assertEqual(parsed.test, "test_name") - self.assertEqual(parsed.n, "52") - self.assertEqual(parsed.tool, "cwltool") - self.assertEqual(parsed.j, 4) - - -if __name__ == "__main__": - unittest.main() diff --git a/cwltest/tests/test_categories.py b/cwltest/tests/test_categories.py deleted file mode 100644 index 3ec67194..00000000 --- a/cwltest/tests/test_categories.py +++ /dev/null @@ -1,79 +0,0 @@ -import unittest -import re -import os -from os import linesep as n -from os import sep as p - -from .util import run_with_mock_cwl_runner, get_data -import xml.etree.ElementTree as ET -import schema_salad.ref_resolver - -class TestCategories(unittest.TestCase): - maxDiff = None - - def test_unsupported_with_required_tests(self): - args = ["--test", schema_salad.ref_resolver.file_uri(get_data("tests/test-data/required-unsupported.yml"))] - try: - cwd = os.getcwd() - os.chdir(get_data("tests/test-data/")) - error_code, stdout, stderr = run_with_mock_cwl_runner(args) - finally: - os.chdir(cwd) - - self.assertEqual(error_code, 1) - print(stderr) - stderr = re.sub(r" '?--outdir=[^ ]*", "", stderr) - if os.name == "nt": - q = "'" - else: - q = "" - self.assertEqual( - "Test [1/2] Required test that is unsupported (without tags){n}" - "{n}" - "Test 1 failed: mock-cwl-runner --quiet return-unsupported.cwl {q}v1.0{p}cat-job.json{q}{n}" - "Required test that is unsupported (without tags){n}" - "Does not support required feature{n}" - "{n}" - "Test [2/2] Required test that is unsupported (with tags){n}" - "{n}" - "Test 2 failed: mock-cwl-runner --quiet return-unsupported.cwl {q}v1.0{p}cat-job.json{q}{n}" - "Required test that is unsupported (with tags){n}" - "Does not support required feature{n}" - "{n}" - "0 tests passed, 2 failures, 0 unsupported features{n}".format( - n=n, p=p, q=q - ), - stderr, - ) - - def test_unsupported_with_optional_tests(self): - args = ["--test", schema_salad.ref_resolver.file_uri(get_data("tests/test-data/optional-unsupported.yml"))] - error_code, stdout, stderr = run_with_mock_cwl_runner(args) - self.assertEqual(error_code, 0) - self.assertEqual( - "Test [1/1] Optional test that is unsupported{n}{n}" - "0 tests passed, 1 unsupported " - "features{n}".format(n=n), - stderr, - ) - - def test_error_with_optional_tests(self): - args = ["--test", schema_salad.ref_resolver.file_uri(get_data("tests/test-data/optional-error.yml"))] - error_code, stdout, stderr = run_with_mock_cwl_runner(args) - self.assertEqual(error_code, 1) - self.assertIn("1 failures", stderr) - - def test_category_in_junit_xml(self): - junit_xml_report = get_data("tests/test-data/junit-report.xml") - args = [ - "--test", - schema_salad.ref_resolver.file_uri(get_data("tests/test-data/optional-error.yml")), - "--junit-xml", - junit_xml_report, - ] - run_with_mock_cwl_runner(args) - tree = ET.parse(junit_xml_report) - root = tree.getroot() - category = root.find("testsuite").find("testcase").attrib["class"] - self.assertEqual(category, "js, init_work_dir") - os.remove(junit_xml_report) diff --git a/cwltest/tests/test_compare.py b/cwltest/tests/test_compare.py deleted file mode 100644 index 5a20caea..00000000 --- a/cwltest/tests/test_compare.py +++ /dev/null @@ -1,64 +0,0 @@ -import unittest -from .util import get_data -from cwltest import CompareFail -from cwltest.utils import compare_file, compare - - -class TestCompareFile(unittest.TestCase): - def test_compare_file(self): - expected = { - "location": "cores.txt", - "size": 2, - "class": "File", - "checksum": "sha1$7448d8798a4380162d4b56f9b452e2f6f9e24e7a", - } - - actual = { - "basename": "cores.txt", - "checksum": "sha1$7448d8798a4380162d4b56f9b452e2f6f9e24e7a", - "class": "File", - "location": "file:///var/folders/8x/2df05_7j20j6r8y81w4qf43r0000gn/T/tmpG0EkrS/cores.txt", - "path": "/var/folders/8x/2df05_7j20j6r8y81w4qf43r0000gn/T/tmpG0EkrS/cores.txt", - "size": 2, - } - try: - compare_file(expected, actual) - except CompareFail: - self.fail("File comparison failed unexpectedly") - - def test_compare_contents_success(self): - expected = { - "location": "cores.txt", - "size": 2, - "class": "File", - "contents": "2\n", - } - - actual = { - "basename": "cores.txt", - "checksum": "sha1$7448d8798a4380162d4b56f9b452e2f6f9e24e7a", - "class": "File", - "location": "file:///var/folders/8x/2df05_7j20j6r8y81w4qf43r0000gn/T/tmpG0EkrS/cores.txt", - "path": get_data("tests/test-data/cores.txt"), - "size": 2, - } - compare(expected, actual) - - def test_compare_contents_failure(self): - expected = { - "location": "cores.txt", - "size": 2, - "class": "File", - "contents": "2", - } - - actual = { - "basename": "cores.txt", - "checksum": "sha1$7448d8798a4380162d4b56f9b452e2f6f9e24e7a", - "class": "File", - "location": "file:///var/folders/8x/2df05_7j20j6r8y81w4qf43r0000gn/T/tmpG0EkrS/cores.txt", - "path": get_data("tests/test-data/cores.txt"), - "size": 2, - } - with self.assertRaises(CompareFail): - compare_file(expected, actual) diff --git a/cwltest/tests/test_prepare.py b/cwltest/tests/test_prepare.py deleted file mode 100644 index 3d93487b..00000000 --- a/cwltest/tests/test_prepare.py +++ /dev/null @@ -1,29 +0,0 @@ -import os -import unittest -from cwltest import prepare_test_command - - -class TestPrepareCommand(unittest.TestCase): - """ Test prepare_test_command() """ - - def test_unix_relative_path(self): - """ Confirm unix style to windows style path corrections. """ - command = prepare_test_command( - tool="cwl-runner", - args=[], - testargs=None, - test={ - "doc": "General test of command line generation", - "output": {"args": ["echo"]}, - "tool": "v1.0/bwa-mem-tool.cwl", - "job": "v1.0/bwa-mem-job.json", - "tags": ["required"], - }, - cwd=os.getcwd() - ) - if os.name == "nt": - self.assertEqual(command[3], "v1.0\\bwa-mem-tool.cwl") - self.assertEqual(command[4], "v1.0\\bwa-mem-job.json") - else: - self.assertEqual(command[3], "v1.0/bwa-mem-tool.cwl") - self.assertEqual(command[4], "v1.0/bwa-mem-job.json") diff --git a/cwltest/tests/test_short_names.py b/cwltest/tests/test_short_names.py deleted file mode 100644 index ca0367a1..00000000 --- a/cwltest/tests/test_short_names.py +++ /dev/null @@ -1,56 +0,0 @@ -import unittest - -import os -from os import linesep as n - -from .util import run_with_mock_cwl_runner, get_data -import xml.etree.ElementTree as ET - - -class TestShortNames(unittest.TestCase): - def test_stderr_output(self): - args = ["--test", get_data("tests/test-data/short-names.yml")] - error_code, stdout, stderr = run_with_mock_cwl_runner(args) - self.assertIn( - "Test [1/1] opt-error: Test with a short name{n}".format(n=n), stderr - ) - - def test_run_by_short_name(self): - short_name = "opt-error" - args = [ - "--test", - get_data("tests/test-data/with-and-without-short-names.yml"), - "-s", - short_name, - ] - error_code, stdout, stderr = run_with_mock_cwl_runner(args) - self.assertIn("Test [2/2] opt-error: Test with a short name", stderr) - self.assertNotIn("Test [1/2]", stderr) - - def test_list_tests(self): - args = [ - "--test", - get_data("tests/test-data/with-and-without-short-names.yml"), - "-l", - ] - error_code, stdout, stderr = run_with_mock_cwl_runner(args) - self.assertEqual( - "[1] Test without a short name{n}" - "[2] opt-error: Test with a short name{n}".format(n=n), - stdout, - ) - - def test_short_name_in_junit_xml(self): - junit_xml_report = get_data("tests/test-data/junit-report.xml") - args = [ - "--test", - get_data("tests/test-data/short-names.yml"), - "--junit-xml", - junit_xml_report, - ] - run_with_mock_cwl_runner(args) - tree = ET.parse(junit_xml_report) - root = tree.getroot() - category = root.find("testsuite").find("testcase").attrib["file"] - self.assertEqual(category, "opt-error") - os.remove(junit_xml_report) diff --git a/cwltest/tests/util.py b/cwltest/tests/util.py deleted file mode 100644 index 3a2bc779..00000000 --- a/cwltest/tests/util.py +++ /dev/null @@ -1,35 +0,0 @@ -import os -import sys - -import subprocess - -from pkg_resources import ( - Requirement, - ResolutionError, # type: ignore - resource_filename, -) - - -def get_data(filename): - filename = os.path.normpath( - filename - ) # normalizing path depending on OS or else it will cause problem when joining path - filepath = None - try: - filepath = resource_filename(Requirement.parse("cwltest"), filename) - except ResolutionError: - pass - if not filepath or not os.path.isfile(filepath): - filepath = os.path.join(os.path.dirname(__file__), os.pardir, filename) - return filepath - - -def run_with_mock_cwl_runner(args): - process = subprocess.Popen( - ["cwltest", "--tool", "mock-cwl-runner"] + args, - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - ) - - stdout, stderr = process.communicate() - return process.returncode, stdout.decode(), stderr.decode() diff --git a/cwltest/utils.py b/cwltest/utils.py index 034b538c..a14ae7a8 100644 --- a/cwltest/utils.py +++ b/cwltest/utils.py @@ -1,41 +1,123 @@ import json - -from typing import Any, Dict, Set, Text, List, Optional +import os +import re +import shlex +import shutil +import subprocess # nosec +import sys +import tempfile +import time +from collections import Counter, defaultdict +from collections.abc import Iterable, MutableMapping, MutableSequence +from importlib.metadata import EntryPoint, entry_points +from importlib.resources import files +from typing import Any, Optional, Union, cast +from urllib.parse import urljoin import junit_xml +import ruamel.yaml.scanner +import schema_salad.avro +import schema_salad.ref_resolver +import schema_salad.schema +from rdflib import Graph +from ruamel.yaml.scalarstring import ScalarString +from schema_salad.exceptions import ValidationException + +import cwltest.compare +import cwltest.stdfsaccess +from cwltest import REQUIRED, UNSUPPORTED_FEATURE, logger, templock +from cwltest.compare import CompareFail, compare + + +class CWLTestConfig: + """Store configuration values for cwltest.""" -REQUIRED = "required" + def __init__( + self, + entry: str, + entry_line: str, + basedir: Optional[str] = None, + test_baseuri: Optional[str] = None, + test_basedir: Optional[str] = None, + outdir: Optional[str] = None, + classname: Optional[str] = None, + tool: Optional[str] = None, + args: Optional[list[str]] = None, + testargs: Optional[list[str]] = None, + timeout: Optional[int] = None, + verbose: Optional[bool] = None, + runner_quiet: Optional[bool] = None, + ) -> None: + """Initialize test configuration.""" + self.basedir: str = basedir or os.getcwd() + self.test_baseuri: str = test_baseuri or "file://" + self.basedir + self.test_basedir: str = test_basedir or self.basedir + self.outdir: Optional[str] = outdir + self.classname: str = classname or "" + self.entry = urljoin( + self.test_baseuri, os.path.basename(entry) + f"#L{entry_line}" + ) + self.tool: str = tool or "cwl-runner" + self.args: list[str] = args or [] + self.testargs: list[str] = testargs or [] + self.timeout: Optional[int] = timeout + self.verbose: bool = verbose or False + self.runner_quiet: bool = runner_quiet or True -class TestResult(object): +class CWLTestReport: + """Encapsulate relevant test result data for a markdown report.""" + def __init__( + self, + id: Union[int, str], + category: list[str], + entry: str, + tool: str, + job: Optional[str], + ) -> None: + """Initialize a CWLTestReport object.""" + self.id = id + self.category = category + self.entry = entry + self.tool = tool + self.job = job + + +class TestResult: """Encapsulate relevant test result data.""" def __init__( self, - return_code, - standard_output, - error_output, - duration, - classname, - message="", - ): - # type: (int, Text, Text, float, Text, str) -> None + return_code: int, + standard_output: str, + error_output: str, + duration: float, + classname: str, + entry: str, + tool: str, + job: Optional[str], + message: str = "", + ) -> None: + """Initialize a TestResult object.""" self.return_code = return_code self.standard_output = standard_output self.error_output = error_output self.duration = duration self.message = message self.classname = classname + self.entry = entry + self.tool = tool + self.job = job - def create_test_case(self, test): - # type: (Dict[Text, Any]) -> junit_xml.TestCase - doc = test.get(u"doc", "N/A").strip() + def create_test_case(self, test: dict[str, Any]) -> junit_xml.TestCase: + """Create a jUnit XML test case from this test result.""" + doc = test.get("doc", "N/A").strip() if test.get("tags"): category = ", ".join(test["tags"]) else: category = REQUIRED - short_name = test.get(u"short_name") + short_name = test.get("short_name") case = junit_xml.TestCase( doc, elapsed_sec=self.duration, @@ -48,165 +130,559 @@ def create_test_case(self, test): case.failure_message = self.message return case - -class CompareFail(Exception): - @classmethod - def format(cls, expected, actual, cause=None): - # type: (Any, Any, Any) -> CompareFail - message = u"expected: %s\ngot: %s" % ( - json.dumps(expected, indent=4, sort_keys=True), - json.dumps(actual, indent=4, sort_keys=True), + def create_report_entry(self, test: dict[str, Any]) -> CWLTestReport: + """Package test result into a CWLTestReport.""" + return CWLTestReport( + test.get("id", "no-id"), + test.get("tags", ["required"]), + self.entry, + self.tool, + self.job, ) - if cause: - message += u"\ncaused by: %s" % cause - return cls(message) -def compare_location(expected, actual): - # type: (Dict[str,Any], Dict[str,Any]) -> None - if "path" in expected: - comp = "path" - if "path" not in actual: - actual["path"] = actual["location"] - elif "location" in expected: - comp = "location" - else: - return - if actual.get("class") == "Directory": - actual[comp] = actual[comp].rstrip("/") - - if expected[comp] != "Any" and ( - not ( - actual[comp].endswith("/" + expected[comp]) - or ("/" not in actual[comp] and expected[comp] == actual[comp]) - ) - ): - raise CompareFail.format( - expected, - actual, - u"%s does not end with %s" % (actual[comp], expected[comp]), - ) - - -def compare_contents(expected, actual): - # type: (Dict[str,Any], Dict[str,Any]) -> None - expected_contents = expected["contents"] - with open(actual["path"]) as f: - actual_contents = f.read() - if expected_contents != actual_contents: - raise CompareFail.format( - expected, - actual, - json.dumps( - u"Output file contents do not match: actual '%s' is not equal to expected '%s'" - % (actual_contents, expected_contents) - ), - ) - - -def check_keys(keys, expected, actual): - # type: (Set[str], Dict[str,Any], Dict[str,Any]) -> None - for k in keys: - try: - compare(expected.get(k), actual.get(k)) - except CompareFail as e: - raise CompareFail.format( - expected, actual, u"field '%s' failed comparison: %s" % (k, str(e)) +def _clean_ruamel_list(obj: list[Any]) -> Any: + """Entrypoint to transform roundtrip loaded ruamel.yaml to plain objects.""" + new_list = [] + for entry in obj: + e: Any = _clean_ruamel(entry) + e["line"] = str(entry.lc.line) + new_list.append(e) + return new_list + + +def _clean_ruamel(obj: Any) -> Any: + """Transform roundtrip loaded ruamel.yaml to plain objects.""" + if isinstance(obj, MutableMapping): + new_dict = {} + for k, v in obj.items(): + new_dict[str(k)] = _clean_ruamel(v) + return new_dict + if isinstance(obj, MutableSequence): + new_list = [] + for entry in obj: + new_list.append(_clean_ruamel(entry)) + return new_list + if isinstance(obj, ScalarString): + return str(obj) + for typ in int, float, bool, str: + if isinstance(obj, typ): + return typ(obj) + if obj is None: + return None + raise Exception(f"Unsupported type {type(obj)} of {obj!r}.") + + +def generate_badges( + badgedir: str, + ntotal: dict[str, int], + npassed: dict[str, list[CWLTestReport]], + nfailures: dict[str, list[CWLTestReport]], + nunsupported: dict[str, list[CWLTestReport]], +) -> None: + """Generate badges with conformance levels.""" + os.mkdir(badgedir) + for t, v in ntotal.items(): + percent = int((len(npassed[t]) / float(v)) * 100) + if len(npassed[t]) == v: + color = "green" + elif t == "required": + color = "red" + else: + color = "yellow" + + with open(f"{badgedir}/{t}.json", "w") as out: + out.write( + json.dumps( + { + "subject": f"{t}", + "status": f"{percent}%", + "color": color, + } + ) ) + with open(f"{badgedir}/{t}.md", "w") as out: + print(f"# `{t}` tests", file=out) + print("## List of passed tests", file=out) + for e in npassed[t]: + base = f"[{shortname(str(e.id))}]({e.entry})" + tool = f"[tool]({e.tool})" + if e.job: + arr = [tool, f"[job]({e.job})"] + else: + arr = [tool] + args = ", ".join(arr) + print(f"- {base} ({args})", file=out) + + print("## List of failed tests", file=out) + for e in nfailures[t]: + base = f"[{shortname(str(e.id))}]({e.entry})" + tool = f"[tool]({e.tool})" + if e.job: + arr = [tool, f"[job]({e.job})"] + else: + arr = [tool] + args = ", ".join(arr) + print(f"- {base} ({args})", file=out) + + print("## List of unsupported tests", file=out) + for e in nunsupported[t]: + base = f"[{shortname(str(e.id))}]({e.entry})" + tool = f"[tool]({e.tool})" + if e.job: + arr = [tool, f"[job]({e.job})"] + else: + arr = [tool] + args = ", ".join(arr) + print(f"- {base} ({args})", file=out) + + +def get_test_number_by_key( + tests: list[dict[str, str]], key: str, value: str +) -> Optional[int]: + """Retrieve the test index from its name.""" + for i, test in enumerate(tests): + if key in test and test[key] == value: + return i + return None + -def compare_file(expected, actual): - # type: (Dict[str,Any], Dict[str,Any]) -> None - compare_location(expected, actual) - if "contents" in expected: - compare_contents(expected, actual) - other_keys = set(expected.keys()) - {"path", "location", "listing", "contents"} - check_keys(other_keys, expected, actual) - - -def compare_directory(expected, actual): - # type: (Dict[str,Any], Dict[str,Any]) -> None - if actual.get("class") != "Directory": - raise CompareFail.format( - expected, actual, u"expected object with a class 'Directory'" - ) - if "listing" not in actual: - raise CompareFail.format( - expected, actual, u"'listing' is mandatory field in Directory object" - ) - for i in expected["listing"]: - found = False - for j in actual["listing"]: - try: - compare(i, j) - found = True - break - except CompareFail: - pass - if not found: - raise CompareFail.format( - expected, - actual, - u"%s not found" % json.dumps(i, indent=4, sort_keys=True), +def load_and_validate_tests(path: str) -> tuple[Any, dict[str, Any]]: + """ + Load and validate the given test file against the cwltest schema. + + This also processes $import directives. + """ + schema_resource = files("cwltest").joinpath("cwltest-schema.yml") + with schema_resource.open("r", encoding="utf-8") as fp: + cache: Optional[dict[str, Union[str, Graph, bool]]] = { + "https://w3id.org/cwl/cwltest/cwltest-schema.yml": fp.read() + } + ( + document_loader, + avsc_names, + _, + _, + ) = schema_salad.schema.load_schema( + "https://w3id.org/cwl/cwltest/cwltest-schema.yml", cache=cache + ) + + if not isinstance(avsc_names, schema_salad.avro.schema.Names): + print(avsc_names) + raise ValidationException(f"Wrong instance for avsc_names: {type(avsc_names)}") + + tests, metadata = schema_salad.schema.load_and_validate( + document_loader, avsc_names, path, True + ) + tests = cast(list[dict[str, Any]], _clean_ruamel_list(tests)) + + return tests, metadata + + +def parse_results( + results: Iterable[TestResult], + tests: list[dict[str, Any]], + suite_name: Optional[str] = None, + report: Optional[junit_xml.TestSuite] = None, +) -> tuple[ + int, # total + int, # passed + int, # failures + int, # unsupported + dict[str, int], # total for each tag + dict[str, list[CWLTestReport]], # passed for each tag + dict[str, list[CWLTestReport]], # failures for each tag + dict[str, list[CWLTestReport]], # unsupported for each tag + Optional[junit_xml.TestSuite], +]: + """ + Parse the results and return statistics and an optional report. + + An additional tag named "all" will be computed, containing all the test + results. + + Returns the total number of tests, dictionary of test counts + (total, passed, failed, unsupported) by tag, and a jUnit XML report. + """ + total = 0 + passed = 0 + failures = 0 + unsupported = 0 + ntotal: dict[str, int] = Counter() + nfailures: dict[str, list[CWLTestReport]] = defaultdict(list) + nunsupported: dict[str, list[CWLTestReport]] = defaultdict(list) + npassed: dict[str, list[CWLTestReport]] = defaultdict(list) + + for i, test_result in enumerate(results): + test_case = test_result.create_test_case(tests[i]) + test_report = test_result.create_report_entry(tests[i]) + test_case.url = ( + f"cwltest:{suite_name}#{i + 1}" + if suite_name is not None + else "cwltest:#{i + 1}" + ) + total += 1 + tags = tests[i].get("tags", []) + ["all"] + for t in tags: + ntotal[t] += 1 + + return_code = test_result.return_code + category = test_case.category + if return_code == 0: + passed += 1 + for t in tags: + npassed[t].append(test_report) + elif return_code != 0 and return_code != UNSUPPORTED_FEATURE: + failures += 1 + for t in tags: + nfailures[t].append(test_report) + test_case.add_failure_info(output=test_result.message) + elif category != REQUIRED and return_code == UNSUPPORTED_FEATURE: + unsupported += 1 + for t in tags: + nunsupported[t].append(test_report) + test_case.add_skipped_info("Unsupported") + else: + raise Exception( + "This is impossible, return_code: {}, category: " + "{}".format(return_code, category) ) - compare_file(expected, actual) - + if report: + report.test_cases.append(test_case) + return ( + total, + passed, + failures, + unsupported, + ntotal, + npassed, + nfailures, + nunsupported, + report, + ) + + +def prepare_test_command( + tool: str, + args: list[str], + testargs: Optional[list[str]], + test: dict[str, Any], + cwd: str, + quiet: Optional[bool] = True, +) -> list[str]: + """Turn the test into a command line.""" + test_command = [tool] + test_command.extend(args) + + # Add additional arguments given in test case + if testargs is not None: + for testarg in testargs: + (test_case_name, prefix) = testarg.split("==") + if test_case_name in test: + test_command.extend([prefix, test[test_case_name]]) + + # Add prefixes if running on MacOSX so that boot2docker writes to /Users + with templock: + if "darwin" in sys.platform and tool.endswith("cwltool"): + outdir = tempfile.mkdtemp(prefix=os.path.abspath(os.path.curdir)) + test_command.extend( + [ + f"--tmp-outdir-prefix={outdir}", + f"--tmpdir-prefix={outdir}", + ] + ) + else: + outdir = tempfile.mkdtemp() + test_command.extend([f"--outdir={outdir}"]) + if quiet: + test_command.extend(["--quiet"]) + processfile, jobfile = prepare_test_paths(test, cwd) + test_command.extend([os.path.normcase(processfile)]) + if jobfile: + test_command.append(os.path.normcase(jobfile)) + return test_command + + +def prepare_test_paths( + test: dict[str, str], + cwd: str, +) -> tuple[str, Optional[str]]: + """Determine the test path and the tool path.""" + cwd = schema_salad.ref_resolver.file_uri(cwd) + processfile = test["tool"] + if processfile.startswith(cwd): + processfile = processfile[len(cwd) + 1 :] + + jobfile = test.get("job") + if jobfile: + if jobfile.startswith(cwd): + jobfile = jobfile[len(cwd) + 1 :] + return processfile, jobfile + + +def run_test_plain( + config: CWLTestConfig, + test: dict[str, str], + test_number: Optional[int] = None, +) -> TestResult: + """Plain test runner.""" + out: dict[str, Any] = {} + outstr = outerr = "" + test_command: list[str] = [] + duration = 0.0 + number = "?" + + reltool = os.path.relpath(test["tool"], start=config.test_basedir) + tooluri = urljoin(config.test_baseuri, reltool) + if test.get("job", None): + reljob = os.path.relpath(test["job"], start=config.test_basedir) + joburi = urljoin(config.test_baseuri, reljob) + else: + joburi = None -def compare_dict(expected, actual): - # type: (Dict[str,Any], Dict[str,Any]) -> None - for c in expected: - try: - compare(expected[c], actual.get(c)) - except CompareFail as e: - raise CompareFail.format( - expected, actual, u"failed comparison for key '%s': %s" % (c, e) + if test_number is not None: + number = str(test_number) + process: Optional[subprocess.Popen[str]] = None + try: + cwd = os.getcwd() + test_command = prepare_test_command( + config.tool, config.args, config.testargs, test, cwd, config.runner_quiet + ) + if config.verbose: + sys.stderr.write(f"Running: {' '.join(test_command)}\n") + sys.stderr.flush() + start_time = time.time() + stderr = subprocess.PIPE if not config.verbose else None + process = subprocess.Popen( # nosec + test_command, + stdout=subprocess.PIPE, + stderr=stderr, + universal_newlines=True, + cwd=cwd, + ) + outstr, outerr = process.communicate(timeout=config.timeout) + return_code = process.poll() + duration = time.time() - start_time + if return_code: + raise subprocess.CalledProcessError(return_code, " ".join(test_command)) + + logger.debug('outstr: "%s".', outstr) + out = json.loads(outstr) if outstr else {} + except subprocess.CalledProcessError as err: + if err.returncode == UNSUPPORTED_FEATURE and REQUIRED not in test.get( + "tags", ["required"] + ): + return TestResult( + UNSUPPORTED_FEATURE, + outstr, + outerr, + duration, + config.classname, + config.entry, + tooluri, + joburi, + ) + if test.get("should_fail", False): + return TestResult( + 0, + outstr, + outerr, + duration, + config.classname, + config.entry, + tooluri, + joburi, + ) + if test_number: + logger.error( + """Test %i failed: %s""", + test_number, + shlex.join(test_command), + ) + else: + logger.error( + """Test failed: %s""", + shlex.join(test_command), ) - extra_keys = set(actual.keys()).difference(list(expected.keys())) - for k in extra_keys: - if actual[k] is not None: - raise CompareFail.format(expected, actual, u"unexpected key '%s'" % k) + logger.error(test.get("doc", "").replace("\n", " ").strip()) + if err.returncode == UNSUPPORTED_FEATURE: + logger.error("Does not support required feature") + else: + logger.error("Returned non-zero") + return TestResult( + 1, + outstr, + outerr, + duration, + config.classname, + config.entry, + tooluri, + joburi, + str(err), + ) + except (ruamel.yaml.scanner.ScannerError, TypeError) as err: + logger.error( + """Test %s failed: %s""", + number, + shlex.join(test_command), + ) + logger.error(outstr) + logger.error("Parse error %s", str(err)) + logger.error(outerr) + except KeyboardInterrupt: + logger.error( + """Test %s interrupted: %s""", + number, + shlex.join(test_command), + ) + raise + except json.JSONDecodeError: + logger.error( + """Test %s failed: %s""", + number, + shlex.join(test_command), + ) + logger.error(test.get("doc", "").replace("\n", " ").strip()) + invalid_json_msg = "Output is not a valid JSON document: '%s'" % outstr + logger.error(invalid_json_msg) + return TestResult( + 1, + outstr, + outerr, + duration, + config.classname, + config.entry, + tooluri, + joburi, + invalid_json_msg, + ) + except subprocess.TimeoutExpired: + logger.error( + """Test %s timed out: %s""", + number, + shlex.join(test_command), + ) + logger.error(test.get("doc", "").replace("\n", " ").strip()) + # Kill and re-communicate to get the logs and reap the child, as + # instructed in the subprocess docs. + if process: + process.kill() + outstr, outerr = process.communicate() + return TestResult( + 2, + outstr, + outerr, + float(cast(int, config.timeout)), + config.classname, + config.entry, + tooluri, + joburi, + "Test timed out", + ) + finally: + if process is not None and process.returncode is None: + logger.error("""Terminating lingering process""") + process.terminate() + for _ in range(0, 3): + time.sleep(1) + if process.poll() is not None: + break + if process.returncode is None: + process.kill() + + fail_message = "" + + if test.get("should_fail", False): + logger.warning( + """Test %s failed: %s""", + number, + shlex.join(test_command), + ) + logger.warning(test.get("doc", "").replace("\n", " ").strip()) + logger.warning("Returned zero but it should be non-zero") + return TestResult( + 1, + outstr, + outerr, + duration, + config.classname, + config.entry, + tooluri, + joburi, + ) + + try: + compare(test.get("output"), out) + except CompareFail as ex: + logger.warning( + """Test %s failed: %s""", + number, + shlex.join(test_command), + ) + logger.warning(test.get("doc", "").replace("\n", " ").strip()) + logger.warning("Compare failure %s", ex) + fail_message = str(ex) + if config.outdir: + shutil.rmtree(config.outdir, True) + + return TestResult( + (1 if fail_message else 0), + outstr, + outerr, + duration, + config.classname, + config.entry, + tooluri, + joburi, + fail_message, + ) -def compare(expected, actual): # type: (Any, Any) -> None - if expected == "Any": - return - if expected is not None and actual is None: - raise CompareFail.format(expected, actual) + +def shortname(name: str) -> str: + """ + Return the short name of a given name. + + It is a workaround of https://github.com/common-workflow-language/schema_salad/issues/511. + """ + return [n for n in re.split("[/#]", name) if len(n)][-1] + + +def absuri(path: str) -> str: + """Return an absolute URI.""" + if "://" in path: + return path + return "file://" + os.path.abspath(path) + + +def load_optional_fsaccess_plugin() -> None: + """ + Load optional fsaccess plugin. + + Looks for a package with cwltest.fsaccess entry point and if so, + use that to get a filesystem access object that will be used for + checking test output. + """ + fsaccess_eps: list[EntryPoint] try: - if isinstance(expected, dict): - if not isinstance(actual, dict): - raise CompareFail.format(expected, actual) - - if expected.get("class") == "File": - compare_file(expected, actual) - elif expected.get("class") == "Directory": - compare_directory(expected, actual) - else: - compare_dict(expected, actual) - - elif isinstance(expected, list): - if not isinstance(actual, list): - raise CompareFail.format(expected, actual) - - if len(expected) != len(actual): - raise CompareFail.format(expected, actual, u"lengths don't match") - for c in range(0, len(expected)): - try: - compare(expected[c], actual[c]) - except CompareFail as e: - raise CompareFail.format(expected, actual, e) - else: - if expected != actual: - raise CompareFail.format(expected, actual) + # The interface to importlib.metadata.entry_points() changed + # several times between Python 3.9 and 3.13; the code below + # actually works fine on all of them but there's no single + # mypy annotation that works across of them. Explicitly cast + # it to a consistent type to make mypy shut up. + fsaccess_eps = cast(list[EntryPoint], entry_points()["cwltest.fsaccess"]) # type: ignore [redundant-cast, unused-ignore] + except KeyError: + return - except Exception as e: - raise CompareFail(str(e)) + if len(fsaccess_eps) == 0: + return + if len(fsaccess_eps) > 1: + logger.warn( + "More than one cwltest.fsaccess entry point found, selected %s", + fsaccess_eps[0], + ) -def get_test_number_by_key(tests, key, value): - # type: (List[Dict[str, str]], str, str) -> Optional[int] - for i, test in enumerate(tests): - if key in test and test[key] == value: - return i - return None + cwltest.compare.fs_access = fsaccess_eps[0].load()() diff --git a/dev-requirements.txt b/dev-requirements.txt new file mode 100644 index 00000000..23730218 --- /dev/null +++ b/dev-requirements.txt @@ -0,0 +1,16 @@ +diff_cover +black ~= 25.9 +pylint +pep257 +pydocstyle +flake8 +tox >4, < 5 +virtualenv-pyenv +isort +wheel +autoflake +flake8-bugbear +pyupgrade +bandit +auto-walrus +build diff --git a/docs/Makefile b/docs/Makefile new file mode 100644 index 00000000..d4bb2cbb --- /dev/null +++ b/docs/Makefile @@ -0,0 +1,20 @@ +# Minimal makefile for Sphinx documentation +# + +# You can set these variables from the command line, and also +# from the environment for the first two. +SPHINXOPTS ?= +SPHINXBUILD ?= sphinx-build +SOURCEDIR = . +BUILDDIR = _build + +# Put it first so that "make" without argument is like "make help". +help: + @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + +.PHONY: help Makefile + +# Catch-all target: route all unknown targets to Sphinx using the new +# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). +%: Makefile + @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) diff --git a/docs/_static/favicon.ico b/docs/_static/favicon.ico new file mode 100644 index 00000000..9fadc9a7 Binary files /dev/null and b/docs/_static/favicon.ico differ diff --git a/docs/conf.py b/docs/conf.py new file mode 100644 index 00000000..f5a7a2ef --- /dev/null +++ b/docs/conf.py @@ -0,0 +1,104 @@ +# Configuration file for the Sphinx documentation builder. +# +# This file only contains a selection of the most common options. For a full +# list see the documentation: +# https://www.sphinx-doc.org/en/master/usage/configuration.html + +# -- Path setup -------------------------------------------------------------- + +# If extensions (or modules to document with autodoc) are in another directory, +# add these directories to sys.path here. If the directory is relative to the +# documentation root, use os.path.abspath to make it absolute, like shown here. +# +import os +import sys +import time +from datetime import datetime + +sys.path.insert(0, os.path.abspath("..")) + + +# -- Project information ----------------------------------------------------- + +build_date = datetime.utcfromtimestamp( + int(os.environ.get("SOURCE_DATE_EPOCH", time.time())) +) +# -- Project information ----------------------------------------------------- + +project = "cwltest" +copyright = ( + f"2016 - {build_date.year}, Common Workflow Language project and contributors" +) +author = "Common Workflow Language project and contributors" + + +# -- General configuration --------------------------------------------------- + +# Add any Sphinx extension module names here, as strings. They can be +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom +# ones. +extensions = [ + "sphinx.ext.autodoc", + "sphinx.ext.autosummary", + "sphinx.ext.intersphinx", + "sphinx.ext.inheritance_diagram", + "autoapi.extension", + "sphinx_autodoc_typehints", + "sphinx_rtd_theme", + "sphinxcontrib.autoprogram", +] + +intersphinx_mapping = { + "python": ("https://docs.python.org/3", None), + "schema_salad": ("https://schema-salad.readthedocs.io/en/stable/", None), + #"rdflib": ("https://rdflib.readthedocs.io/en/6.2.0/", None), + #"pytest": ("https://docs.pytest.org/en/7.2.x/", None), + "pytest_xdist": ("https://pytest-xdist.readthedocs.io/en/latest/", None), + #"ruamel.yaml": ("https://yaml.readthedocs.io/en/stable/", None), +} + + +# Add any paths that contain templates here, relative to this directory. +templates_path = ["_templates"] + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +# This pattern also affects html_static_path and html_extra_path. +exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"] + + +# -- Options for HTML output ------------------------------------------------- + +# The theme to use for HTML and HTML Help pages. See the documentation for +# a list of builtin themes. +# +html_theme = "sphinx_rtd_theme" + +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +html_static_path = ["_static"] + + +from importlib.metadata import version as metadata_version + +release = metadata_version("cwltest") +version = ".".join(release.split(".")[:2]) + +autoapi_dirs = ["../cwltest"] +autodoc_typehints = "description" +autoapi_keep_files = True +autoapi_ignore = ["*.pyi"] +autoapi_options = [ + "members", + "undoc-members", + "show-inheritance", + "show-inheritance-diagram", + "show-module-summary", + "imported-members", + "special-members", +] +# sphinx-autodoc-typehints +always_document_param_types = True +# If False, do not add type info for undocumented parameters. +# If True, add stub documentation for undocumented parameters to be able to add type info. diff --git a/docs/index.rst b/docs/index.rst new file mode 100644 index 00000000..ce7ab8af --- /dev/null +++ b/docs/index.rst @@ -0,0 +1,22 @@ +.. include:: ../README.rst + +******************** +Command Line Options +******************** + +.. autoprogram:: cwltest.argparser:arg_parser() + :prog: cwltest + +.. toctree:: + :maxdepth: 2 + + pytest + autoapi/index + +****************** +Indices and tables +****************** + +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` diff --git a/docs/pytest.rst b/docs/pytest.rst new file mode 100644 index 00000000..b8d0ad9c --- /dev/null +++ b/docs/pytest.rst @@ -0,0 +1,174 @@ +************* +Pytest plugin +************* + +``cwltest`` can also be used as a Pytest 7.x or 8.x plugin. The CWL test +filename must end with ``.cwltest.yml`` or ``.cwltest.yaml``. + +In this case, the simple command:: + + cwltest --test conformance_xxx.cwltest.yml --tool cwl-runner + +becomes:: + + pytest conformance_xxx.cwltest.yml --cwl-runner cwl-runner + +Command Line Options +==================== + +.. autoprogram:: cwltest.plugin:_doc_options() + :prog: pytest + +Converting ``cwltest`` options to ``pytest`` options +==================================================== + +The table below details all the available command conversions between the two formats. + +.. list-table:: + :widths: 40 30 30 + :header-rows: 1 + + * - Feature + - ``cwltest`` + - ``pytest`` + * - YAML file describing test cases + - ``--test conformance_xxx.cwltest.yml`` + - ``conformance_xxx.cwltest.yml`` + * - CWL runner executable to use + - ``--tool CWL_RUNNER`` + - :option:`--cwl-runner CWL_RUNNER` + * - Specifies the number of tests + + to run simultaneously + - ``-j CORES`` + - ``-n CORES`` [#f1]_ + * - Automatically scale the number of tests + + to run simultaneously + - **UNSUPPORTED** + - ``-n auto`` [#f1]_ + * - Only run one test at a time + + (good for debugging cwltest itself) + - ``-j 1`` + + (or leave out ``-j``) + - ``-n 0 -s`` [#f1]_ + * - Time of execution in seconds + + after which the test will be skipped + - ``--timeout TIMEOUT`` + - ``--timeout TIMEOUT`` [#f3]_ + * - List tests then exit + - ``-l`` + - ``--collect-only`` + * - Run specific tests using their short names + - ``-s TEST_NAME[,TEST_NAME…]`` + - :option:`--cwl-include TEST_NAME[,TEST_NAME…]` + * - Exclude specific tests by short names + - ``-S TEST_NAME[,TEST_NAME…]`` + - :option:`--cwl-exclude TEST_NAME[,TEST_NAME…]` + * - Tags to be tested + - ``--tags TAG[,TAG…]`` + - :option:`--cwl-tags TAG[,TAG…]` + * - Tags not to be tested + - ``--exclude-tags TAG[,TAG…]`` + - :option:`--cwl-exclude-tags TAG[,TAG…]` + * - Path to JUnit xml file + - ``--junit-xml PATH`` + - ``--junit-xml=PATH`` [#f4]_ + * - More verbose output during test run + - ``--verbose`` + - ``-v[vv]`` + * - Additional argument given in test cases + + and required prefix for tool runner + - ``--test-arg ARG_NAME==ARG_PREFIX`` + - :option:`--cwl-test-arg ARG_NAME==ARG_PREFIX` + * - Arguments to pass first to tool runner + - ``cwltest -- ARG [ARG …]`` + - :option:`--cwl-args "ARG [ARG …]"` + * - Only test CommandLineTools + - ``--only-tools`` + - **UNSUPPORTED** + * - Show all tags + - ``--show-tags`` + - **UNSUPPORTED** + * - Store more verbose output to JUnit xml file + - ``--junit-verbose`` + - :option:`--cwl-runner-verbose` [#f4]_ + * - Specify classname for the Test Suite + - ``--classname CLASS_NAME`` + - **UNSUPPORTED** + +.. [#f1] Requires `pytest-xdist `_. + See :ref:`pytest_xdist:parallelization`. +.. [#f2] ``-s`` is a shortcut for ``--capture=no``, also helps with debugging + ``cwltest`` or the cwltest plugin to ``pytest``. +.. [#f3] Requires `pytest-timeout `_. + Note: even if ``pytest-timeout`` is installed, there is no default + timeout. This is different than ``cwltest``'s default timeout of 10 + minutes. + +Differences in the XML output +============================= + +``cwltest --junit-xml`` output + +* top-level ```` element has the elapsed time, and counts (errors, + failures, skipped, and total) +* singular ```` sub-element the same attributes as the top-level + ```` plus ``name`` which is the basename of the YAML test file +* each ```` element has the follow attributes + + * ``name``: the doc string + * ``class``: the tags + * ``file``: the test ID + * ``url``: like "cwltest:conformance_tests#1" + (contains the basename of the YAML test file) + * ``time``: the elapsed time + +* ```` elements always contain the following sub-elements, + regardless of outcome + + * ````: the output object + * ````: stderr (docker pull, other warnings, and errors) + +* ```` elements for failed test cases do not have a ```` sub-element + +``pytest`` with ``cwltest`` plugin XML output + +* top-level ```` element has no attributes +* singular ```` sub-element has the same attributes as the ``cwltest`` + XML version along with these additional attributes + + * ``name``: default is ``pytest`` + (can be customized with the pytest INI option ``junit_suite_name``) + * ``timestamp="2023-01-08T11:39:07.425159"`` + * ``hostname``: the hostname of the machine where the tests ran +* inside the ```` is a ``..`` element + with two ```` elements. But this + `does not work with pytest-xdist `_. + + * ``runner``: the name of the CWL runner + * ``runner_extra_args``: the value of `--cwl-args`` + +* each ```` element has the following attributes + + * ``classname``: always the name of the YAML file (``conformance_test_v1.2.cwltest.yaml``) + * ``name``: the test ID + * ``time``: the elapsed time + +* ```` elements for failed test cases **do** have a ```` sub-element + with a ``message`` attribute containing the :py:meth:`cwltest.plugin.CWLItem.repr_failure` + output. This text is repeated as the content of the ```` element. + The presensce of ```` and ```` sub-elements varies. [#f4]_ + + .. [#f4] Depending on the value of the pytest INI option ``junit_logging``, + then ```` and ```` sub-elements will be generated. + However the default value for ``junit_logging`` is ``no``, so to get + either of these pick one from `the full list + `_. + You can set ``junit_logging`` in `a configuration file + `_ + or on the command line: ``pytest -o junit_logging=out-err``. diff --git a/docs/requirements.txt b/docs/requirements.txt new file mode 100644 index 00000000..e9d89216 --- /dev/null +++ b/docs/requirements.txt @@ -0,0 +1,5 @@ +sphinx >= 2.2 +sphinx-rtd-theme==3.0.2 +sphinx-autoapi +sphinx-autodoc-typehints +sphinxcontrib-autoprogram diff --git a/gittaggers.py b/gittaggers.py deleted file mode 100644 index e91cf0fb..00000000 --- a/gittaggers.py +++ /dev/null @@ -1,36 +0,0 @@ -import subprocess -import time -import pkg_resources -from setuptools.command.egg_info import egg_info - -SETUPTOOLS_VER = pkg_resources.get_distribution( - "setuptools").version.split('.') - -RECENT_SETUPTOOLS = int(SETUPTOOLS_VER[0]) > 40 or ( - int(SETUPTOOLS_VER[0]) == 40 and int(SETUPTOOLS_VER[1]) > 0) or ( - int(SETUPTOOLS_VER[0]) == 40 and int(SETUPTOOLS_VER[1]) == 0 and - int(SETUPTOOLS_VER[2]) > 0) - -class EggInfoFromGit(egg_info): - """Tag the build with git commit timestamp. - - If a build tag has already been set (e.g., "egg_info -b", building - from source package), leave it alone. - """ - - def git_timestamp_tag(self): - gitinfo = subprocess.check_output( - ['git', 'log', '--first-parent', '--max-count=1', - '--format=format:%ct', '.']).strip() - return time.strftime('.%Y%m%d%H%M%S', time.gmtime(int(gitinfo))) - - def tags(self): - if self.tag_build is None: - try: - self.tag_build = self.git_timestamp_tag() - except subprocess.CalledProcessError: - pass - return egg_info.tags(self) - - if RECENT_SETUPTOOLS: - vtags = property(tags) diff --git a/mypy-requirements.txt b/mypy-requirements.txt new file mode 100644 index 00000000..f2e4771d --- /dev/null +++ b/mypy-requirements.txt @@ -0,0 +1,6 @@ +mypy==1.18.2 +pytest >= 8.3, < 9 +types-setuptools +types-requests +types-PyYAML +cwltool diff --git a/typeshed/2and3/cachecontrol/__init__.pyi b/mypy-stubs/cachecontrol/__init__.pyi similarity index 63% rename from typeshed/2and3/cachecontrol/__init__.pyi rename to mypy-stubs/cachecontrol/__init__.pyi index dba67bc3..d8c9745d 100644 --- a/typeshed/2and3/cachecontrol/__init__.pyi +++ b/mypy-stubs/cachecontrol/__init__.pyi @@ -3,8 +3,7 @@ # NOTE: This dynamically typed stub was automatically generated by stubgen. from typing import Any + from .wrapper import CacheControl as CacheControl -#from .adapter import CacheControlAdapter as CacheControlAdapter -#from .controller import CacheController as CacheController __email__ = ... # type: Any diff --git a/mypy-stubs/cachecontrol/cache.pyi b/mypy-stubs/cachecontrol/cache.pyi new file mode 100644 index 00000000..f738f6fd --- /dev/null +++ b/mypy-stubs/cachecontrol/cache.pyi @@ -0,0 +1,5 @@ +class BaseCache: + def get(self, key: str) -> bytes | None: ... + def set(self, key: str, value: bytes, expires: int | None = None) -> None: ... + def delete(self, key: str) -> None: ... + def close(self) -> None: ... diff --git a/typeshed/2and3/cachecontrol/caches/__init__.pyi b/mypy-stubs/cachecontrol/caches/__init__.pyi similarity index 80% rename from typeshed/2and3/cachecontrol/caches/__init__.pyi rename to mypy-stubs/cachecontrol/caches/__init__.pyi index b7784c2b..42c0ad68 100644 --- a/typeshed/2and3/cachecontrol/caches/__init__.pyi +++ b/mypy-stubs/cachecontrol/caches/__init__.pyi @@ -3,7 +3,9 @@ # NOTE: This dynamically typed stub was automatically generated by stubgen. from typing import Any + from .file_cache import FileCache as FileCache -#from .redis_cache import RedisCache as RedisCache + +# from .redis_cache import RedisCache as RedisCache notice = ... # type: Any diff --git a/mypy-stubs/cachecontrol/caches/file_cache.pyi b/mypy-stubs/cachecontrol/caches/file_cache.pyi new file mode 100644 index 00000000..a89d758b --- /dev/null +++ b/mypy-stubs/cachecontrol/caches/file_cache.pyi @@ -0,0 +1,31 @@ +from os import PathLike +from typing import ContextManager + +from ..cache import BaseCache as BaseCache +from ..controller import CacheController as CacheController + +class _LockClass: + path: str + +_lock_class = ContextManager[_LockClass] + +class FileCache(BaseCache): + directory: str + forever: bool + filemode: int + dirmode: int + lock_class: _lock_class | None = None + def __init__( + self, + directory: str | PathLike[str], + forever: bool = ..., + filemode: int = ..., + dirmode: int = ..., + use_dir_lock: bool | None = ..., + lock_class: _lock_class | None = ..., + ) -> None: ... + @staticmethod + def encode(x: str) -> str: ... + def get(self, key: str) -> None | bytes: ... + def set(self, key: str, value: bytes, expires: int | None = None) -> None: ... + def delete(self, key: str) -> None: ... diff --git a/typeshed/2and3/cachecontrol/compat.pyi b/mypy-stubs/cachecontrol/compat.pyi similarity index 83% rename from typeshed/2and3/cachecontrol/compat.pyi rename to mypy-stubs/cachecontrol/compat.pyi index 0926ecc5..fabfae3f 100644 --- a/typeshed/2and3/cachecontrol/compat.pyi +++ b/mypy-stubs/cachecontrol/compat.pyi @@ -4,4 +4,4 @@ from typing import Any -text_type = ... # type: Any +str = ... # type: Any diff --git a/mypy-stubs/cachecontrol/controller.pyi b/mypy-stubs/cachecontrol/controller.pyi new file mode 100644 index 00000000..e8a06aa6 --- /dev/null +++ b/mypy-stubs/cachecontrol/controller.pyi @@ -0,0 +1,18 @@ +from typing import Collection + +from _typeshed import Incomplete + +from .cache import BaseCache + +class CacheController: + cache: BaseCache + cache_etags: bool + serializer: Incomplete + cacheable_status_codes: Collection[int] | None = None + def __init__( + self, + cache: BaseCache | None = None, + cache_etags: bool = True, + serializer: Incomplete | None = None, + status_codes: Collection[int] | None = None, + ) -> None: ... diff --git a/mypy-stubs/cachecontrol/wrapper.pyi b/mypy-stubs/cachecontrol/wrapper.pyi new file mode 100644 index 00000000..6244687f --- /dev/null +++ b/mypy-stubs/cachecontrol/wrapper.pyi @@ -0,0 +1,18 @@ +from typing import Collection, Type + +from _typeshed import Incomplete +from requests import Session + +from .cache import BaseCache +from .controller import CacheController + +def CacheControl( + sess: Session, + cache: BaseCache | None = None, + cache_etags: bool = True, + serializer: Incomplete | None = None, + heuristic: Incomplete | None = None, + controller_class: Type[CacheController] | None = None, + adapter_class: Incomplete | None = None, + cacheable_methods: Collection[str] | None = None, +) -> Session: ... diff --git a/mypy-stubs/defusedxml/ElementTree.pyi b/mypy-stubs/defusedxml/ElementTree.pyi new file mode 100644 index 00000000..e6f2465b --- /dev/null +++ b/mypy-stubs/defusedxml/ElementTree.pyi @@ -0,0 +1,6 @@ +import xml.etree.ElementTree +from pathlib import Path + +def parse( + source: Path = ..., parser: xml.etree.ElementTree.XMLParser = ... +) -> xml.etree.ElementTree.ElementTree: ... diff --git a/typeshed/2and3/future/__init__.pyi b/mypy-stubs/defusedxml/__init__.pyi similarity index 100% rename from typeshed/2and3/future/__init__.pyi rename to mypy-stubs/defusedxml/__init__.pyi diff --git a/mypy-stubs/junit_xml.pyi b/mypy-stubs/junit_xml.pyi new file mode 100644 index 00000000..e305ce42 --- /dev/null +++ b/mypy-stubs/junit_xml.pyi @@ -0,0 +1,93 @@ +# Stubs for junit_xml (Python 3.5) +# +# NOTE: This dynamically typed stub was automatically generated by stubgen. + +from typing import IO, Any, List, Optional + +unichr = chr + +class TestSuite: + name: Any = ... + test_cases: Any = ... + timestamp: Any = ... + hostname: Any = ... + id: Any = ... + package: Any = ... + file: Any = ... + log: Any = ... + url: Any = ... + stdout: Any = ... + stderr: Any = ... + properties: Any = ... + def __init__( + self, + name: str, + test_cases: Optional[Any] = ..., + hostname: Optional[Any] = ..., + id: Optional[Any] = ..., + package: Optional[Any] = ..., + timestamp: Optional[Any] = ..., + properties: Optional[Any] = ..., + file: Optional[Any] = ..., + log: Optional[Any] = ..., + url: Optional[Any] = ..., + stdout: Optional[Any] = ..., + stderr: Optional[Any] = ..., + ) -> None: ... + +class TestCase: + name: Any = ... + assertions: Any = ... + elapsed_sec: Any = ... + timestamp: Any = ... + classname: Any = ... + status: Any = ... + category: Any = ... + file: Any = ... + line: Any = ... + log: Any = ... + url: Any = ... + stdout: Any = ... + stderr: Any = ... + is_enabled: bool = ... + error_message: Any = ... + error_output: Any = ... + error_type: Any = ... + failure_message: Any = ... + failure_output: Any = ... + failure_type: Any = ... + skipped_message: Any = ... + skipped_output: Any = ... + def __init__( + self, + name: str, + classname: Optional[Any] = ..., + elapsed_sec: Optional[Any] = ..., + stdout: Optional[Any] = ..., + stderr: Optional[Any] = ..., + assertions: Optional[Any] = ..., + timestamp: Optional[Any] = ..., + status: Optional[Any] = ..., + category: Optional[Any] = ..., + file: Optional[Any] = ..., + line: Optional[Any] = ..., + log: Optional[Any] = ..., + group: Optional[Any] = ..., + url: Optional[Any] = ..., + ) -> None: ... + def add_failure_info( + self, + message: Optional[Any] = ..., + output: Optional[Any] = ..., + failure_type: Optional[Any] = ..., + ) -> None: ... + def add_skipped_info( + self, message: Optional[Any] = ..., output: Optional[Any] = ... + ) -> None: ... + +def to_xml_report_file( + file_descriptor: IO[Any], + test_suites: List[TestSuite], + prettyprint: bool = True, + encoding: Optional[str] = None, +) -> None: ... diff --git a/mypy-stubs/rdflib/__init__.pyi b/mypy-stubs/rdflib/__init__.pyi new file mode 100644 index 00000000..03d8e909 --- /dev/null +++ b/mypy-stubs/rdflib/__init__.pyi @@ -0,0 +1,32 @@ +from rdflib.graph import ConjunctiveGraph as ConjunctiveGraph +from rdflib.graph import Graph as Graph +from rdflib.namespace import CSVW as CSVW +from rdflib.namespace import DC as DC +from rdflib.namespace import DCAT as DCAT +from rdflib.namespace import DCTERMS as DCTERMS +from rdflib.namespace import DOAP as DOAP +from rdflib.namespace import FOAF as FOAF +from rdflib.namespace import ODRL2 as ODRL2 +from rdflib.namespace import ORG as ORG +from rdflib.namespace import OWL as OWL +from rdflib.namespace import PROF as PROF +from rdflib.namespace import PROV as PROV +from rdflib.namespace import QB as QB +from rdflib.namespace import RDF as RDF +from rdflib.namespace import RDFS as RDFS +from rdflib.namespace import SDO as SDO +from rdflib.namespace import SH as SH +from rdflib.namespace import SKOS as SKOS +from rdflib.namespace import SOSA as SOSA +from rdflib.namespace import SSN as SSN +from rdflib.namespace import TIME as TIME +from rdflib.namespace import VOID as VOID +from rdflib.namespace import XMLNS as XMLNS +from rdflib.namespace import XSD as XSD +from rdflib.namespace import Namespace as Namespace +from rdflib.term import BNode as BNode +from rdflib.term import Literal as Literal +from rdflib.term import URIRef as URIRef +from rdflib.term import Variable as Variable + +__version__: str diff --git a/mypy-stubs/rdflib/collection.pyi b/mypy-stubs/rdflib/collection.pyi new file mode 100644 index 00000000..0bee9842 --- /dev/null +++ b/mypy-stubs/rdflib/collection.pyi @@ -0,0 +1,19 @@ +from typing import Any, Iterator + +from rdflib.graph import Graph +from rdflib.term import Node + +class Collection: + graph: Graph + uri: Node + def __init__(self, graph: Graph, uri: Node, seq: Any = ...) -> None: ... + def n3(self) -> str: ... + def __len__(self) -> int: ... + def index(self, item: Any) -> int: ... + def __getitem__(self, key: str) -> Any: ... + def __setitem__(self, key: str, value: Any) -> None: ... + def __delitem__(self, key: str) -> None: ... + def __iter__(self) -> Iterator[Any]: ... + def append(self, item: Any) -> Collection: ... + def __iadd__(self, other: Any) -> Collection: ... + def clear(self) -> Collection: ... diff --git a/mypy-stubs/rdflib/compare.pyi b/mypy-stubs/rdflib/compare.pyi new file mode 100644 index 00000000..6451292a --- /dev/null +++ b/mypy-stubs/rdflib/compare.pyi @@ -0,0 +1,10 @@ +from typing import Dict, Union + +from rdflib.graph import ConjunctiveGraph, Graph + +Stats = Dict[str, Union[int, str]] + +class IsomorphicGraph(ConjunctiveGraph): + pass + +def to_isomorphic(graph: Graph = ...) -> IsomorphicGraph: ... diff --git a/mypy-stubs/rdflib/graph.pyi b/mypy-stubs/rdflib/graph.pyi new file mode 100644 index 00000000..23c2e6e1 --- /dev/null +++ b/mypy-stubs/rdflib/graph.pyi @@ -0,0 +1,252 @@ +import pathlib +from typing import ( + IO, + Any, + Iterable, + Iterator, + List, + Optional, + Set, + Tuple, + Union, + overload, +) + +from rdflib import query +from rdflib.collection import Collection +from rdflib.paths import Path +from rdflib.resource import Resource +from rdflib.term import BNode, Identifier, Node + +class Graph(Node): + base: Any = ... + context_aware: bool = ... + formula_aware: bool = ... + default_union: bool = ... + def __init__( + self, + store: str = ..., + identifier: Optional[Any] = ..., + namespace_manager: Optional[Any] = ..., + base: Optional[Any] = ..., + ) -> None: ... + store: Any = ... + identifier: Any = ... + namespace_manager: Any = ... + def toPython(self) -> str: ... + def destroy(self, configuration: Any) -> None: ... + def commit(self) -> None: ... + def rollback(self) -> None: ... + def open(self, configuration: Any, create: bool = ...) -> Any: ... + def close(self, commit_pending_transaction: bool = ...) -> None: ... + def add(self, triple: Any) -> None: ... + def addN(self, quads: Any) -> None: ... + def remove(self, triple: Any) -> None: ... + def triples( + self, + triple: Tuple[ + Optional[Union[str, Identifier]], + Optional[Union[str, Identifier]], + Optional[Identifier], + ], + ) -> Iterator[Tuple[Identifier, Identifier, Identifier]]: ... + def __getitem__( + self, item: slice | Path | Node + ) -> Iterator[ + Tuple[Identifier, Identifier, Identifier] | Tuple[Identifier, identifier] | Node + ]: ... + def __contains__(self, triple: Any) -> bool: ... + def __add__(self, other: Any) -> Graph: ... + def set(self, triple: Any) -> None: ... + def subjects( + self, predicate: Optional[Any] = ..., object: Optional[Any] = ... + ) -> Iterable[Node]: ... + def predicates( + self, subject: Optional[Any] = ..., object: Optional[Any] = ... + ) -> Iterable[Node]: ... + def objects( + self, subject: Optional[Any] = ..., predicate: Optional[Any] = ... + ) -> Iterable[Identifier]: ... + def subject_predicates(self, object: Optional[Any] = ...) -> None: ... + def subject_objects(self, predicate: Optional[Any] = ...) -> None: ... + def predicate_objects(self, subject: Optional[Any] = ...) -> None: ... + def triples_choices(self, triple: Any, context: Optional[Any] = ...) -> None: ... + def value( + self, + subject: Optional[Any] = ..., + predicate: Any = ..., + object: Optional[Any] = ..., + default: Optional[Any] = ..., + any: bool = ..., + ) -> Any: ... + def label(self, subject: Any, default: str = ...) -> Any: ... + def preferredLabel( + self, + subject: Any, + lang: Optional[Any] = ..., + default: Optional[Any] = ..., + labelProperties: Any = ..., + ) -> List[Tuple[Any, Any]]: ... + def comment(self, subject: Any, default: str = ...) -> Any: ... + def items(self, list: Any) -> Iterator[Any]: ... + def transitiveClosure( + self, func: Any, arg: Any, seen: Optional[Any] = ... + ) -> Iterator[Any]: ... + def transitive_objects( + self, subject: Any, property: Any, remember: Optional[Any] = ... + ) -> Iterator[Any]: ... + def transitive_subjects( + self, predicate: Any, object: Any, remember: Optional[Any] = ... + ) -> Iterator[Any]: ... + def seq(self, subject: Any) -> Seq | None: ... + def qname(self, uri: Any) -> Any: ... + def compute_qname(self, uri: Any, generate: bool = ...) -> Any: ... + def bind( + self, prefix: Any, namespace: Any, override: bool = ..., replace: bool = ... + ) -> Any: ... + def namespaces(self) -> Iterator[Tuple[Any, Any]]: ... + def absolutize(self, uri: Any, defrag: int = ...) -> Any: ... + + # no destination and non-None positional encoding + @overload + def serialize( + self, + destination: None, + format: str, + base: Optional[str], + encoding: str, + **args: Any, + ) -> bytes: ... + + # no destination and non-None keyword encoding + @overload + def serialize( + self, + destination: None = ..., + format: str = ..., + base: Optional[str] = ..., + *, + encoding: str, + **args: Any, + ) -> bytes: ... + + # no destination and None encoding + @overload + def serialize( + self, + destination: None = ..., + format: str = ..., + base: Optional[str] = ..., + encoding: None = ..., + **args: Any, + ) -> str: ... + + # non-None destination + @overload + def serialize( + self, + destination: Union[str, pathlib.PurePath, IO[bytes]], + format: str = ..., + base: Optional[str] = ..., + encoding: Optional[str] = ..., + **args: Any, + ) -> "Graph": ... + + # fallback + @overload + def serialize( + self, + destination: Optional[Union[str, pathlib.PurePath, IO[bytes]]] = ..., + format: str = ..., + base: Optional[str] = ..., + encoding: Optional[str] = ..., + **args: Any, + ) -> Union[bytes, str, "Graph"]: ... + def parse( + self, + source: Optional[Any] = ..., + publicID: Optional[Any] = ..., + format: Optional[str] = ..., + location: Optional[Any] = ..., + file: Optional[Any] = ..., + data: Optional[Any] = ..., + **args: Any, + ) -> "Graph": ... + def load( + self, source: Any, publicID: Optional[Any] = ..., format: str = ... + ) -> "Graph": ... + def query( + self, + query_object: Any, + processor: str = ..., + result: str = ..., + initNs: Optional[Any] = ..., + initBindings: Optional[Any] = ..., + use_store_provided: bool = ..., + **kwargs: Any, + ) -> query.Result: ... + def update( + self, + update_object: Any, + processor: str = ..., + initNs: Optional[Any] = ..., + initBindings: Optional[Any] = ..., + use_store_provided: bool = ..., + **kwargs: Any, + ) -> Any: ... + def n3(self) -> str: ... + def isomorphic(self, other: Any) -> bool: ... + def connected(self) -> bool: ... + def all_nodes(self) -> Set[Any]: ... + def collection(self, identifier: Any) -> Collection: ... + def resource(self, identifier: Any) -> Resource: ... + def skolemize( + self, + new_graph: Optional[Any] = ..., + bnode: Optional[Any] = ..., + authority: Optional[Any] = ..., + basepath: Optional[Any] = ..., + ) -> Graph: ... + def de_skolemize( + self, new_graph: Optional[Any] = ..., uriref: Optional[Any] = ... + ) -> Graph: ... + +class ConjunctiveGraph(Graph): + context_aware: bool = ... + default_union: bool = ... + default_context: Any = ... + def __init__( + self, + store: str = ..., + identifier: Optional[Any] = ..., + default_graph_base: Optional[Any] = ..., + ) -> None: ... + def add(self, triple_or_quad: Any) -> None: ... + def addN(self, quads: Any) -> None: ... + def remove(self, triple_or_quad: Any) -> None: ... + # def triples(self, triple_or_quad: Tuple[Optional[Union[str, BNode]], Optional[Union[str, BNode]], Optional[BNode]], context: Tuple[Optional[Union[str, BNode]], Optional[Union[str, BNode]], Optional[BNode]]) -> Iterator[Tuple[Identifier, Identifier, Identifier]]: ... + def quads(self, triple_or_quad: Optional[Any] = ...) -> None: ... + def triples_choices(self, triple: Any, context: Optional[Any] = ...) -> None: ... + def contexts(self, triple: Optional[Any] = ...) -> None: ... + def get_context( + self, + identifier: Node | str | None, + quoted: bool = ..., + base: Optional[str] = ..., + ) -> Graph: ... + def remove_context(self, context: Any) -> None: ... + def context_id(self, uri: Any, context_id: Optional[Any] = ...) -> Any: ... + def parse( + self, + source: Optional[Any] = ..., + publicID: Optional[Any] = ..., + format: Optional[str] = ..., + location: Optional[Any] = ..., + file: Optional[Any] = ..., + data: Optional[Any] = ..., + **args: Any, + ) -> Graph: ... + +class Seq: + def __init__(self, graph: Graph, subject: Any) -> None: ... + def toPython(self) -> Seq: ... diff --git a/mypy-stubs/rdflib/namespace/_CSVW.pyi b/mypy-stubs/rdflib/namespace/_CSVW.pyi new file mode 100644 index 00000000..aa1b137c --- /dev/null +++ b/mypy-stubs/rdflib/namespace/_CSVW.pyi @@ -0,0 +1,88 @@ +from rdflib.namespace import DefinedNamespace as DefinedNamespace +from rdflib.namespace import Namespace as Namespace +from rdflib.term import URIRef as URIRef + +class CSVW(DefinedNamespace): + aboutUrl: URIRef + base: URIRef + column: URIRef + columnReference: URIRef + commentPrefix: URIRef + datatype: URIRef + decimalChar: URIRef + default: URIRef + delimiter: URIRef + describes: URIRef + dialect: URIRef + doubleQuote: URIRef + encoding: URIRef + foreignKey: URIRef + format: URIRef + groupChar: URIRef + header: URIRef + headerRowCount: URIRef + lang: URIRef + length: URIRef + lineTerminators: URIRef + maxExclusive: URIRef + maxInclusive: URIRef + maxLength: URIRef + minExclusive: URIRef + minInclusive: URIRef + minLength: URIRef + name: URIRef + note: URIRef + null: URIRef + ordered: URIRef + pattern: URIRef + primaryKey: URIRef + propertyUrl: URIRef + quoteChar: URIRef + reference: URIRef + referencedRow: URIRef + required: URIRef + resource: URIRef + row: URIRef + rowTitle: URIRef + rownum: URIRef + schemaReference: URIRef + scriptFormat: URIRef + separator: URIRef + skipBlankRows: URIRef + skipColumns: URIRef + skipInitialSpace: URIRef + skipRows: URIRef + source: URIRef + suppressOutput: URIRef + table: URIRef + tableDirection: URIRef + tableSchema: URIRef + targetFormat: URIRef + textDirection: URIRef + title: URIRef + transformations: URIRef + trim: URIRef + url: URIRef + valueUrl: URIRef + virtual: URIRef + Cell: URIRef + Column: URIRef + Datatype: URIRef + Dialect: URIRef + Direction: URIRef + ForeignKey: URIRef + NumericFormat: URIRef + Row: URIRef + Schema: URIRef + Table: URIRef + TableGroup: URIRef + TableReference: URIRef + Transformation: URIRef + JSON: URIRef + uriTemplate: URIRef + auto: URIRef + inherit: URIRef + ltr: URIRef + rtl: URIRef + csvEncodedTabularData: URIRef + tabularMetadata: URIRef diff --git a/mypy-stubs/rdflib/namespace/_DC.pyi b/mypy-stubs/rdflib/namespace/_DC.pyi new file mode 100644 index 00000000..25d75e85 --- /dev/null +++ b/mypy-stubs/rdflib/namespace/_DC.pyi @@ -0,0 +1,20 @@ +from rdflib.namespace import DefinedNamespace as DefinedNamespace +from rdflib.namespace import Namespace as Namespace +from rdflib.term import URIRef as URIRef + +class DC(DefinedNamespace): + contributor: URIRef + coverage: URIRef + creator: URIRef + date: URIRef + description: URIRef + format: URIRef + identifier: URIRef + language: URIRef + publisher: URIRef + relation: URIRef + rights: URIRef + source: URIRef + subject: URIRef + title: URIRef + type: URIRef diff --git a/mypy-stubs/rdflib/namespace/_DCAT.pyi b/mypy-stubs/rdflib/namespace/_DCAT.pyi new file mode 100644 index 00000000..c920687e --- /dev/null +++ b/mypy-stubs/rdflib/namespace/_DCAT.pyi @@ -0,0 +1,41 @@ +from rdflib.namespace import DefinedNamespace as DefinedNamespace +from rdflib.namespace import Namespace as Namespace +from rdflib.term import URIRef as URIRef + +class DCAT(DefinedNamespace): + accessURL: URIRef + bbox: URIRef + byteSize: URIRef + centroid: URIRef + compressFormat: URIRef + contactPoint: URIRef + dataset: URIRef + distribution: URIRef + downloadURL: URIRef + endDate: URIRef + keyword: URIRef + landingPage: URIRef + mediaType: URIRef + packageFormat: URIRef + record: URIRef + startDate: URIRef + theme: URIRef + themeTaxonomy: URIRef + Catalog: URIRef + CatalogRecord: URIRef + Dataset: URIRef + Distribution: URIRef + DataService: URIRef + Relationship: URIRef + Resource: URIRef + Role: URIRef + spatialResolutionInMeters: URIRef + temporalResolution: URIRef + accessService: URIRef + catalog: URIRef + endpointDescription: URIRef + endpointURL: URIRef + hadRole: URIRef + qualifiedRelation: URIRef + servesDataset: URIRef + service: URIRef diff --git a/mypy-stubs/rdflib/namespace/_DCTERMS.pyi b/mypy-stubs/rdflib/namespace/_DCTERMS.pyi new file mode 100644 index 00000000..3c5d77f4 --- /dev/null +++ b/mypy-stubs/rdflib/namespace/_DCTERMS.pyi @@ -0,0 +1,101 @@ +from rdflib.namespace import DefinedNamespace as DefinedNamespace +from rdflib.namespace import Namespace as Namespace +from rdflib.term import URIRef as URIRef + +class DCTERMS(DefinedNamespace): + DCMIType: URIRef + DDC: URIRef + IMT: URIRef + LCC: URIRef + LCSH: URIRef + MESH: URIRef + NLM: URIRef + TGN: URIRef + UDC: URIRef + abstract: URIRef + accessRights: URIRef + accrualMethod: URIRef + accrualPeriodicity: URIRef + accrualPolicy: URIRef + alternative: URIRef + audience: URIRef + available: URIRef + bibliographicCitation: URIRef + conformsTo: URIRef + contributor: URIRef + coverage: URIRef + created: URIRef + creator: URIRef + date: URIRef + dateAccepted: URIRef + dateCopyrighted: URIRef + dateSubmitted: URIRef + description: URIRef + educationLevel: URIRef + extent: URIRef + format: URIRef + hasFormat: URIRef + hasPart: URIRef + hasVersion: URIRef + identifier: URIRef + instructionalMethod: URIRef + isFormatOf: URIRef + isPartOf: URIRef + isReferencedBy: URIRef + isReplacedBy: URIRef + isRequiredBy: URIRef + isVersionOf: URIRef + issued: URIRef + language: URIRef + license: URIRef + mediator: URIRef + medium: URIRef + modified: URIRef + provenance: URIRef + publisher: URIRef + references: URIRef + relation: URIRef + replaces: URIRef + requires: URIRef + rights: URIRef + rightsHolder: URIRef + source: URIRef + spatial: URIRef + subject: URIRef + tableOfContents: URIRef + temporal: URIRef + title: URIRef + type: URIRef + valid: URIRef + Agent: URIRef + AgentClass: URIRef + BibliographicResource: URIRef + FileFormat: URIRef + Frequency: URIRef + Jurisdiction: URIRef + LicenseDocument: URIRef + LinguisticSystem: URIRef + Location: URIRef + LocationPeriodOrJurisdiction: URIRef + MediaType: URIRef + MediaTypeOrExtent: URIRef + MethodOfAccrual: URIRef + MethodOfInstruction: URIRef + PeriodOfTime: URIRef + PhysicalMedium: URIRef + PhysicalResource: URIRef + Policy: URIRef + ProvenanceStatement: URIRef + RightsStatement: URIRef + SizeOrDuration: URIRef + Standard: URIRef + Box: URIRef + ISO3166: URIRef + Period: URIRef + Point: URIRef + RFC1766: URIRef + RFC3066: URIRef + RFC4646: URIRef + RFC5646: URIRef + URI: URIRef + W3CDTF: URIRef diff --git a/mypy-stubs/rdflib/namespace/_DOAP.pyi b/mypy-stubs/rdflib/namespace/_DOAP.pyi new file mode 100644 index 00000000..846f8be2 --- /dev/null +++ b/mypy-stubs/rdflib/namespace/_DOAP.pyi @@ -0,0 +1,47 @@ +from rdflib.namespace import DefinedNamespace as DefinedNamespace +from rdflib.namespace import Namespace as Namespace +from rdflib.term import URIRef as URIRef + +class DOAP(DefinedNamespace): + audience: URIRef + blog: URIRef + browse: URIRef + category: URIRef + created: URIRef + description: URIRef + developer: URIRef + documenter: URIRef + helper: URIRef + implements: URIRef + language: URIRef + license: URIRef + location: URIRef + maintainer: URIRef + module: URIRef + name: URIRef + os: URIRef + platform: URIRef + release: URIRef + repository: URIRef + repositoryOf: URIRef + revision: URIRef + screenshots: URIRef + shortdesc: URIRef + tester: URIRef + translator: URIRef + vendor: URIRef + wiki: URIRef + ArchRepository: URIRef + BKRepository: URIRef + BazaarBranch: URIRef + CVSRepository: URIRef + DarcsRepository: URIRef + GitBranch: URIRef + GitRepository: URIRef + HgRepository: URIRef + Project: URIRef + Repository: URIRef + SVNRepository: URIRef + Specification: URIRef + Version: URIRef + homepage: URIRef diff --git a/mypy-stubs/rdflib/namespace/_FOAF.pyi b/mypy-stubs/rdflib/namespace/_FOAF.pyi new file mode 100644 index 00000000..50923a16 --- /dev/null +++ b/mypy-stubs/rdflib/namespace/_FOAF.pyi @@ -0,0 +1,80 @@ +from rdflib.namespace import DefinedNamespace as DefinedNamespace +from rdflib.namespace import Namespace as Namespace +from rdflib.term import URIRef as URIRef + +class FOAF(DefinedNamespace): + account: URIRef + accountName: URIRef + accountServiceHomepage: URIRef + age: URIRef + based_near: URIRef + birthday: URIRef + currentProject: URIRef + depiction: URIRef + depicts: URIRef + dnaChecksum: URIRef + familyName: URIRef + family_name: URIRef + firstName: URIRef + focus: URIRef + fundedBy: URIRef + geekcode: URIRef + gender: URIRef + givenName: URIRef + givenname: URIRef + holdsAccount: URIRef + img: URIRef + interest: URIRef + knows: URIRef + lastName: URIRef + made: URIRef + maker: URIRef + member: URIRef + membershipClass: URIRef + myersBriggs: URIRef + name: URIRef + nick: URIRef + page: URIRef + pastProject: URIRef + phone: URIRef + plan: URIRef + primaryTopic: URIRef + publications: URIRef + schoolHomepage: URIRef + sha1: URIRef + skypeID: URIRef + status: URIRef + surname: URIRef + theme: URIRef + thumbnail: URIRef + tipjar: URIRef + title: URIRef + topic: URIRef + topic_interest: URIRef + workInfoHomepage: URIRef + workplaceHomepage: URIRef + Agent: URIRef + Document: URIRef + Group: URIRef + Image: URIRef + LabelProperty: URIRef + OnlineAccount: URIRef + OnlineChatAccount: URIRef + OnlineEcommerceAccount: URIRef + OnlineGamingAccount: URIRef + Organization: URIRef + Person: URIRef + PersonalProfileDocument: URIRef + Project: URIRef + aimChatID: URIRef + homepage: URIRef + icqChatID: URIRef + isPrimaryTopicOf: URIRef + jabberID: URIRef + logo: URIRef + mbox: URIRef + mbox_sha1sum: URIRef + msnChatID: URIRef + openid: URIRef + weblog: URIRef + yahooChatID: URIRef diff --git a/mypy-stubs/rdflib/namespace/_ODRL2.pyi b/mypy-stubs/rdflib/namespace/_ODRL2.pyi new file mode 100644 index 00000000..37e75565 --- /dev/null +++ b/mypy-stubs/rdflib/namespace/_ODRL2.pyi @@ -0,0 +1,209 @@ +from rdflib.namespace import DefinedNamespace as DefinedNamespace +from rdflib.namespace import Namespace as Namespace +from rdflib.term import URIRef as URIRef + +class ODRL2(DefinedNamespace): + action: URIRef + andSequence: URIRef + assignee: URIRef + assigneeOf: URIRef + assigner: URIRef + assignerOf: URIRef + attributedParty: URIRef + attributingParty: URIRef + compensatedParty: URIRef + compensatingParty: URIRef + conflict: URIRef + consentedParty: URIRef + consentingParty: URIRef + consequence: URIRef + constraint: URIRef + contractedParty: URIRef + contractingParty: URIRef + dataType: URIRef + duty: URIRef + failure: URIRef + function: URIRef + hasPolicy: URIRef + implies: URIRef + includedIn: URIRef + informedParty: URIRef + informingParty: URIRef + inheritAllowed: URIRef + inheritFrom: URIRef + inheritRelation: URIRef + leftOperand: URIRef + obligation: URIRef + operand: URIRef + operator: URIRef + output: URIRef + partOf: URIRef + payeeParty: URIRef + permission: URIRef + profile: URIRef + prohibition: URIRef + proximity: URIRef + refinement: URIRef + relation: URIRef + remedy: URIRef + rightOperand: URIRef + rightOperandReference: URIRef + scope: URIRef + source: URIRef + status: URIRef + target: URIRef + timedCount: URIRef + trackedParty: URIRef + trackingParty: URIRef + uid: URIRef + undefined: URIRef + unit: URIRef + xone: URIRef + All: URIRef + All2ndConnections: URIRef + AllConnections: URIRef + AllGroups: URIRef + Group: URIRef + Individual: URIRef + absolutePosition: URIRef + absoluteSize: URIRef + absoluteSpatialPosition: URIRef + absoluteTemporalPosition: URIRef + count: URIRef + dateTime: URIRef + delayPeriod: URIRef + deliveryChannel: URIRef + device: URIRef + elapsedTime: URIRef + eq: URIRef + event: URIRef + fileFormat: URIRef + gt: URIRef + gteq: URIRef + hasPart: URIRef + ignore: URIRef + industry: URIRef + invalid: URIRef + isA: URIRef + isAllOf: URIRef + isAnyOf: URIRef + isNoneOf: URIRef + isPartOf: URIRef + language: URIRef + lt: URIRef + lteq: URIRef + media: URIRef + meteredTime: URIRef + neq: URIRef + payAmount: URIRef + percentage: URIRef + perm: URIRef + policyUsage: URIRef + product: URIRef + prohibit: URIRef + purpose: URIRef + recipient: URIRef + relativePosition: URIRef + relativeSize: URIRef + relativeSpatialPosition: URIRef + relativeTemporalPosition: URIRef + resolution: URIRef + spatial: URIRef + spatialCoordinates: URIRef + support: URIRef + system: URIRef + systemDevice: URIRef + timeInterval: URIRef + unitOfCount: URIRef + version: URIRef + virtualLocation: URIRef + Action: URIRef + Agreement: URIRef + Assertion: URIRef + Asset: URIRef + AssetCollection: URIRef + AssetScope: URIRef + ConflictTerm: URIRef + Constraint: URIRef + Duty: URIRef + LeftOperand: URIRef + LogicalConstraint: URIRef + Offer: URIRef + Operator: URIRef + Party: URIRef + PartyCollection: URIRef + PartyScope: URIRef + Permission: URIRef + Policy: URIRef + Privacy: URIRef + Prohibition: URIRef + Request: URIRef + RightOperand: URIRef + Rule: URIRef + Set: URIRef + Ticket: URIRef + UndefinedTerm: URIRef + acceptTracking: URIRef + adHocShare: URIRef + aggregate: URIRef + annotate: URIRef + anonymize: URIRef + append: URIRef + appendTo: URIRef + archive: URIRef + attachPolicy: URIRef + attachSource: URIRef + attribute: URIRef + commercialize: URIRef + compensate: URIRef + concurrentUse: URIRef + copy: URIRef + core: URIRef + delete: URIRef + derive: URIRef + digitize: URIRef + display: URIRef + distribute: URIRef + ensureExclusivity: URIRef + execute: URIRef + export: URIRef + extract: URIRef + extractChar: URIRef + extractPage: URIRef + extractWord: URIRef + give: URIRef + grantUse: URIRef + include: URIRef + index: URIRef + inform: URIRef + install: URIRef + lease: URIRef + lend: URIRef + license: URIRef + modify: URIRef + move: URIRef + nextPolicy: URIRef + obtainConsent: URIRef + pay: URIRef + play: URIRef + present: URIRef + preview: URIRef + print: URIRef + read: URIRef + reproduce: URIRef + reviewPolicy: URIRef + secondaryUse: URIRef + sell: URIRef + share: URIRef + shareAlike: URIRef + stream: URIRef + synchronize: URIRef + textToSpeech: URIRef + transfer: URIRef + transform: URIRef + translate: URIRef + uninstall: URIRef + use: URIRef + watermark: URIRef + write: URIRef + writeTo: URIRef diff --git a/mypy-stubs/rdflib/namespace/_ORG.pyi b/mypy-stubs/rdflib/namespace/_ORG.pyi new file mode 100644 index 00000000..e7cd07f7 --- /dev/null +++ b/mypy-stubs/rdflib/namespace/_ORG.pyi @@ -0,0 +1,50 @@ +from rdflib.namespace import DefinedNamespace as DefinedNamespace +from rdflib.namespace import Namespace as Namespace +from rdflib.term import URIRef as URIRef + +class ORG(DefinedNamespace): + basedAt: URIRef + changedBy: URIRef + classification: URIRef + hasMember: URIRef + hasMembership: URIRef + hasPost: URIRef + hasPrimarySite: URIRef + hasRegisteredSite: URIRef + hasSite: URIRef + hasSubOrganization: URIRef + hasUnit: URIRef + headOf: URIRef + heldBy: URIRef + holds: URIRef + identifier: URIRef + linkedTo: URIRef + location: URIRef + member: URIRef + memberDuring: URIRef + memberOf: URIRef + organization: URIRef + originalOrganization: URIRef + postIn: URIRef + purpose: URIRef + remuneration: URIRef + reportsTo: URIRef + resultedFrom: URIRef + resultingOrganization: URIRef + role: URIRef + roleProperty: URIRef + siteAddress: URIRef + siteOf: URIRef + subOrganizationOf: URIRef + transitiveSubOrganizationOf: URIRef + unitOf: URIRef + ChangeEvent: URIRef + FormalOrganization: URIRef + Membership: URIRef + Organization: URIRef + OrganizationalCollaboration: URIRef + OrganizationalUnit: URIRef + Post: URIRef + Role: URIRef + Site: URIRef + Head: URIRef diff --git a/mypy-stubs/rdflib/namespace/_OWL.pyi b/mypy-stubs/rdflib/namespace/_OWL.pyi new file mode 100644 index 00000000..e7896633 --- /dev/null +++ b/mypy-stubs/rdflib/namespace/_OWL.pyi @@ -0,0 +1,82 @@ +from rdflib.namespace import DefinedNamespace as DefinedNamespace +from rdflib.namespace import Namespace as Namespace +from rdflib.term import URIRef as URIRef + +class OWL(DefinedNamespace): + allValuesFrom: URIRef + annotatedProperty: URIRef + annotatedSource: URIRef + annotatedTarget: URIRef + assertionProperty: URIRef + cardinality: URIRef + complementOf: URIRef + datatypeComplementOf: URIRef + differentFrom: URIRef + disjointUnionOf: URIRef + disjointWith: URIRef + distinctMembers: URIRef + equivalentClass: URIRef + equivalentProperty: URIRef + hasKey: URIRef + hasSelf: URIRef + hasValue: URIRef + intersectionOf: URIRef + inverseOf: URIRef + maxCardinality: URIRef + maxQualifiedCardinality: URIRef + members: URIRef + minCardinality: URIRef + minQualifiedCardinality: URIRef + onClass: URIRef + onDataRange: URIRef + onDatatype: URIRef + onProperties: URIRef + onProperty: URIRef + oneOf: URIRef + propertyChainAxiom: URIRef + propertyDisjointWith: URIRef + qualifiedCardinality: URIRef + sameAs: URIRef + someValuesFrom: URIRef + sourceIndividual: URIRef + targetIndividual: URIRef + targetValue: URIRef + unionOf: URIRef + withRestrictions: URIRef + AllDifferent: URIRef + AllDisjointClasses: URIRef + AllDisjointProperties: URIRef + Annotation: URIRef + AnnotationProperty: URIRef + AsymmetricProperty: URIRef + Axiom: URIRef + Class: URIRef + DataRange: URIRef + DatatypeProperty: URIRef + DeprecatedClass: URIRef + DeprecatedProperty: URIRef + FunctionalProperty: URIRef + InverseFunctionalProperty: URIRef + IrreflexiveProperty: URIRef + NamedIndividual: URIRef + NegativePropertyAssertion: URIRef + ObjectProperty: URIRef + Ontology: URIRef + OntologyProperty: URIRef + ReflexiveProperty: URIRef + Restriction: URIRef + SymmetricProperty: URIRef + TransitiveProperty: URIRef + backwardCompatibleWith: URIRef + deprecated: URIRef + incompatibleWith: URIRef + priorVersion: URIRef + versionInfo: URIRef + Nothing: URIRef + Thing: URIRef + bottomDataProperty: URIRef + topDataProperty: URIRef + bottomObjectProperty: URIRef + topObjectProperty: URIRef + imports: URIRef + versionIRI: URIRef diff --git a/mypy-stubs/rdflib/namespace/_PROF.pyi b/mypy-stubs/rdflib/namespace/_PROF.pyi new file mode 100644 index 00000000..69df2384 --- /dev/null +++ b/mypy-stubs/rdflib/namespace/_PROF.pyi @@ -0,0 +1,15 @@ +from rdflib.namespace import DefinedNamespace as DefinedNamespace +from rdflib.namespace import Namespace as Namespace +from rdflib.term import URIRef as URIRef + +class PROF(DefinedNamespace): + Profile: URIRef + ResourceDescriptor: URIRef + ResourceRole: URIRef + hasToken: URIRef + hasArtifact: URIRef + hasResource: URIRef + hasRole: URIRef + isInheritedFrom: URIRef + isProfileOf: URIRef + isTransitiveProfileOf: URIRef diff --git a/mypy-stubs/rdflib/namespace/_PROV.pyi b/mypy-stubs/rdflib/namespace/_PROV.pyi new file mode 100644 index 00000000..bfe1ad90 --- /dev/null +++ b/mypy-stubs/rdflib/namespace/_PROV.pyi @@ -0,0 +1,175 @@ +from rdflib.namespace import DefinedNamespace as DefinedNamespace +from rdflib.namespace import Namespace as Namespace +from rdflib.term import URIRef as URIRef + +class PROV(DefinedNamespace): + activityOfInfluence: URIRef + agentOfInfluence: URIRef + contributed: URIRef + ended: URIRef + entityOfInfluence: URIRef + generalizationOf: URIRef + generatedAsDerivation: URIRef + hadDelegate: URIRef + hadDerivation: URIRef + hadInfluence: URIRef + hadRevision: URIRef + informed: URIRef + locationOf: URIRef + qualifiedAssociationOf: URIRef + qualifiedAttributionOf: URIRef + qualifiedCommunicationOf: URIRef + qualifiedDelegationOf: URIRef + qualifiedDerivationOf: URIRef + qualifiedEndOf: URIRef + qualifiedGenerationOf: URIRef + qualifiedInfluenceOf: URIRef + qualifiedInvalidationOf: URIRef + qualifiedQuotationOf: URIRef + qualifiedSourceOf: URIRef + qualifiedStartOf: URIRef + qualifiedUsingActivity: URIRef + quotedAs: URIRef + revisedEntity: URIRef + started: URIRef + wasActivityOfInfluence: URIRef + wasAssociateFor: URIRef + wasMemberOf: URIRef + wasPlanOf: URIRef + wasPrimarySourceOf: URIRef + wasRoleIn: URIRef + wasUsedBy: URIRef + wasUsedInDerivation: URIRef + aq: URIRef + category: URIRef + component: URIRef + constraints: URIRef + definition: URIRef + dm: URIRef + editorialNote: URIRef + editorsDefinition: URIRef + inverse: URIRef + n: URIRef + order: URIRef + qualifiedForm: URIRef + sharesDefinitionWith: URIRef + specializationOf: URIRef + todo: URIRef + unqualifiedForm: URIRef + wasRevisionOf: URIRef + Accept: URIRef + Activity: URIRef + ActivityInfluence: URIRef + Agent: URIRef + AgentInfluence: URIRef + Association: URIRef + Attribution: URIRef + Bundle: URIRef + Collection: URIRef + Communication: URIRef + Contribute: URIRef + Contributor: URIRef + Copyright: URIRef + Create: URIRef + Creator: URIRef + Delegation: URIRef + Derivation: URIRef + Dictionary: URIRef + DirectQueryService: URIRef + EmptyDictionary: URIRef + End: URIRef + Entity: URIRef + EntityInfluence: URIRef + Generation: URIRef + Influence: URIRef + Insertion: URIRef + InstantaneousEvent: URIRef + Invalidation: URIRef + KeyEntityPair: URIRef + Location: URIRef + Modify: URIRef + Organization: URIRef + Person: URIRef + Plan: URIRef + PrimarySource: URIRef + Publish: URIRef + Publisher: URIRef + Quotation: URIRef + Removal: URIRef + Replace: URIRef + Revision: URIRef + RightsAssignment: URIRef + RightsHolder: URIRef + Role: URIRef + ServiceDescription: URIRef + SoftwareAgent: URIRef + Start: URIRef + Submit: URIRef + Usage: URIRef + atTime: URIRef + endedAtTime: URIRef + generatedAtTime: URIRef + invalidatedAtTime: URIRef + provenanceUriTemplate: URIRef + removedKey: URIRef + startedAtTime: URIRef + value: URIRef + pairEntity: URIRef + pairKey: URIRef + EmptyCollection: URIRef + actedOnBehalfOf: URIRef + activity: URIRef + agent: URIRef + alternateOf: URIRef + asInBundle: URIRef + atLocation: URIRef + derivedByInsertionFrom: URIRef + derivedByRemovalFrom: URIRef + describesService: URIRef + dictionary: URIRef + entity: URIRef + generated: URIRef + hadActivity: URIRef + hadDictionaryMember: URIRef + hadGeneration: URIRef + hadMember: URIRef + hadPlan: URIRef + hadPrimarySource: URIRef + hadRole: URIRef + hadUsage: URIRef + has_anchor: URIRef + has_provenance: URIRef + has_query_service: URIRef + influenced: URIRef + influencer: URIRef + insertedKeyEntityPair: URIRef + invalidated: URIRef + mentionOf: URIRef + pingback: URIRef + qualifiedAssociation: URIRef + qualifiedAttribution: URIRef + qualifiedCommunication: URIRef + qualifiedDelegation: URIRef + qualifiedDerivation: URIRef + qualifiedEnd: URIRef + qualifiedGeneration: URIRef + qualifiedInfluence: URIRef + qualifiedInsertion: URIRef + qualifiedInvalidation: URIRef + qualifiedPrimarySource: URIRef + qualifiedQuotation: URIRef + qualifiedRemoval: URIRef + qualifiedRevision: URIRef + qualifiedStart: URIRef + qualifiedUsage: URIRef + used: URIRef + wasAssociatedWith: URIRef + wasAttributedTo: URIRef + wasDerivedFrom: URIRef + wasEndedBy: URIRef + wasGeneratedBy: URIRef + wasInfluencedBy: URIRef + wasInformedBy: URIRef + wasInvalidatedBy: URIRef + wasQuotedFrom: URIRef + wasStartedBy: URIRef diff --git a/mypy-stubs/rdflib/namespace/_QB.pyi b/mypy-stubs/rdflib/namespace/_QB.pyi new file mode 100644 index 00000000..4b90460c --- /dev/null +++ b/mypy-stubs/rdflib/namespace/_QB.pyi @@ -0,0 +1,41 @@ +from rdflib.namespace import DefinedNamespace as DefinedNamespace +from rdflib.namespace import Namespace as Namespace +from rdflib.term import URIRef as URIRef + +class QB(DefinedNamespace): + attribute: URIRef + codeList: URIRef + component: URIRef + componentAttachment: URIRef + componentProperty: URIRef + componentRequired: URIRef + concept: URIRef + dataSet: URIRef + dimension: URIRef + hierarchyRoot: URIRef + measure: URIRef + measureDimension: URIRef + measureType: URIRef + observation: URIRef + observationGroup: URIRef + order: URIRef + parentChildProperty: URIRef + slice: URIRef + sliceKey: URIRef + sliceStructure: URIRef + structure: URIRef + Attachable: URIRef + AttributeProperty: URIRef + CodedProperty: URIRef + ComponentProperty: URIRef + ComponentSet: URIRef + ComponentSpecification: URIRef + DataSet: URIRef + DataStructureDefinition: URIRef + DimensionProperty: URIRef + HierarchicalCodeList: URIRef + MeasureProperty: URIRef + Observation: URIRef + ObservationGroup: URIRef + Slice: URIRef + SliceKey: URIRef diff --git a/mypy-stubs/rdflib/namespace/_RDF.pyi b/mypy-stubs/rdflib/namespace/_RDF.pyi new file mode 100644 index 00000000..e613019b --- /dev/null +++ b/mypy-stubs/rdflib/namespace/_RDF.pyi @@ -0,0 +1,27 @@ +from rdflib.namespace import DefinedNamespace as DefinedNamespace +from rdflib.namespace import Namespace as Namespace +from rdflib.term import URIRef as URIRef + +class RDF(DefinedNamespace): + nil: URIRef + direction: URIRef + first: URIRef + language: URIRef + object: URIRef + predicate: URIRef + rest: URIRef + subject: URIRef + type: URIRef + value: URIRef + Alt: URIRef + Bag: URIRef + CompoundLiteral: URIRef + List: URIRef + Property: URIRef + Seq: URIRef + Statement: URIRef + HTML: URIRef + JSON: URIRef + PlainLiteral: URIRef + XMLLiteral: URIRef + langString: URIRef diff --git a/mypy-stubs/rdflib/namespace/_RDFS.pyi b/mypy-stubs/rdflib/namespace/_RDFS.pyi new file mode 100644 index 00000000..e28d0849 --- /dev/null +++ b/mypy-stubs/rdflib/namespace/_RDFS.pyi @@ -0,0 +1,20 @@ +from rdflib.namespace import DefinedNamespace as DefinedNamespace +from rdflib.namespace import Namespace as Namespace +from rdflib.term import URIRef as URIRef + +class RDFS(DefinedNamespace): + comment: URIRef + domain: URIRef + isDefinedBy: URIRef + label: URIRef + member: URIRef + range: URIRef + seeAlso: URIRef + subClassOf: URIRef + subPropertyOf: URIRef + Class: URIRef + Container: URIRef + ContainerMembershipProperty: URIRef + Datatype: URIRef + Literal: URIRef + Resource: URIRef diff --git a/mypy-stubs/rdflib/namespace/_SDO.pyi b/mypy-stubs/rdflib/namespace/_SDO.pyi new file mode 100644 index 00000000..b974b4d2 --- /dev/null +++ b/mypy-stubs/rdflib/namespace/_SDO.pyi @@ -0,0 +1,1645 @@ +from rdflib.namespace import DefinedNamespace as DefinedNamespace +from rdflib.namespace import Namespace as Namespace +from rdflib.term import URIRef as URIRef + +class SDO(DefinedNamespace): + ActiveActionStatus: URIRef + CompletedActionStatus: URIRef + FailedActionStatus: URIRef + PotentialActionStatus: URIRef + Researcher: URIRef + GroupBoardingPolicy: URIRef + ZoneBoardingPolicy: URIRef + AudiobookFormat: URIRef + EBook: URIRef + Hardcover: URIRef + Paperback: URIRef + HearingImpairedSupported: URIRef + TollFree: URIRef + Friday: URIRef + Monday: URIRef + PublicHolidays: URIRef + Saturday: URIRef + Sunday: URIRef + Thursday: URIRef + Tuesday: URIRef + Wednesday: URIRef + OnSitePickup: URIRef + CommentPermission: URIRef + ReadPermission: URIRef + WritePermission: URIRef + AllWheelDriveConfiguration: URIRef + FourWheelDriveConfiguration: URIRef + FrontWheelDriveConfiguration: URIRef + RearWheelDriveConfiguration: URIRef + EventCancelled: URIRef + EventMovedOnline: URIRef + EventPostponed: URIRef + EventRescheduled: URIRef + EventScheduled: URIRef + CoOp: URIRef + MultiPlayer: URIRef + SinglePlayer: URIRef + OfflinePermanently: URIRef + OfflineTemporarily: URIRef + Online: URIRef + OnlineFull: URIRef + Female: URIRef + Male: URIRef + Discontinued: URIRef + InStock: URIRef + InStoreOnly: URIRef + LimitedAvailability: URIRef + OnlineOnly: URIRef + OutOfStock: URIRef + PreOrder: URIRef + PreSale: URIRef + SoldOut: URIRef + ItemListOrderAscending: URIRef + ItemListOrderDescending: URIRef + ItemListUnordered: URIRef + ParkingMap: URIRef + SeatingMap: URIRef + TransitMap: URIRef + VenueMap: URIRef + CompilationAlbum: URIRef + DJMixAlbum: URIRef + DemoAlbum: URIRef + LiveAlbum: URIRef + MixtapeAlbum: URIRef + RemixAlbum: URIRef + SoundtrackAlbum: URIRef + SpokenWordAlbum: URIRef + StudioAlbum: URIRef + AlbumRelease: URIRef + BroadcastRelease: URIRef + EPRelease: URIRef + SingleRelease: URIRef + CDFormat: URIRef + CassetteFormat: URIRef + DVDFormat: URIRef + DigitalAudioTapeFormat: URIRef + DigitalFormat: URIRef + LaserDiscFormat: URIRef + VinylFormat: URIRef + DamagedCondition: URIRef + NewCondition: URIRef + RefurbishedCondition: URIRef + UsedCondition: URIRef + OrderCancelled: URIRef + OrderDelivered: URIRef + OrderInTransit: URIRef + OrderPaymentDue: URIRef + OrderPickupAvailable: URIRef + OrderProblem: URIRef + OrderProcessing: URIRef + OrderReturned: URIRef + PaymentAutomaticallyApplied: URIRef + PaymentComplete: URIRef + PaymentDeclined: URIRef + PaymentDue: URIRef + PaymentPastDue: URIRef + ReservationCancelled: URIRef + ReservationConfirmed: URIRef + ReservationHold: URIRef + ReservationPending: URIRef + DiabeticDiet: URIRef + GlutenFreeDiet: URIRef + HalalDiet: URIRef + HinduDiet: URIRef + KosherDiet: URIRef + LowCalorieDiet: URIRef + LowFatDiet: URIRef + LowLactoseDiet: URIRef + LowSaltDiet: URIRef + VeganDiet: URIRef + VegetarianDiet: URIRef + RsvpResponseMaybe: URIRef + RsvpResponseNo: URIRef + RsvpResponseYes: URIRef + LeftHandDriving: URIRef + RightHandDriving: URIRef + about: URIRef + acceptedAnswer: URIRef + acceptedOffer: URIRef + acceptedPaymentMethod: URIRef + acceptsReservations: URIRef + accessCode: URIRef + accessMode: URIRef + accessModeSufficient: URIRef + accessibilityAPI: URIRef + accessibilityControl: URIRef + accessibilityFeature: URIRef + accessibilityHazard: URIRef + accessibilitySummary: URIRef + accountId: URIRef + accountablePerson: URIRef + acquiredFrom: URIRef + actionAccessibilityRequirement: URIRef + actionApplication: URIRef + actionOption: URIRef + actionPlatform: URIRef + actionStatus: URIRef + actor: URIRef + actors: URIRef + addOn: URIRef + additionalName: URIRef + additionalNumberOfGuests: URIRef + additionalProperty: URIRef + additionalType: URIRef + address: URIRef + addressCountry: URIRef + addressLocality: URIRef + addressRegion: URIRef + advanceBookingRequirement: URIRef + affiliation: URIRef + afterMedia: URIRef + agent: URIRef + aggregateRating: URIRef + aircraft: URIRef + album: URIRef + albumProductionType: URIRef + albumRelease: URIRef + albumReleaseType: URIRef + albums: URIRef + alignmentType: URIRef + alternateName: URIRef + alternativeHeadline: URIRef + alumni: URIRef + alumniOf: URIRef + amenityFeature: URIRef + amount: URIRef + amountOfThisGood: URIRef + annualPercentageRate: URIRef + answerCount: URIRef + application: URIRef + applicationCategory: URIRef + applicationSubCategory: URIRef + applicationSuite: URIRef + appliesToDeliveryMethod: URIRef + appliesToPaymentMethod: URIRef + area: URIRef + areaServed: URIRef + arrivalAirport: URIRef + arrivalBusStop: URIRef + arrivalGate: URIRef + arrivalPlatform: URIRef + arrivalStation: URIRef + arrivalTerminal: URIRef + arrivalTime: URIRef + artEdition: URIRef + artMedium: URIRef + artform: URIRef + articleBody: URIRef + articleSection: URIRef + artworkSurface: URIRef + assembly: URIRef + assemblyVersion: URIRef + associatedArticle: URIRef + associatedMedia: URIRef + athlete: URIRef + attendee: URIRef + attendees: URIRef + audience: URIRef + audienceType: URIRef + audio: URIRef + authenticator: URIRef + author: URIRef + availability: URIRef + availabilityEnds: URIRef + availabilityStarts: URIRef + availableAtOrFrom: URIRef + availableChannel: URIRef + availableDeliveryMethod: URIRef + availableFrom: URIRef + availableLanguage: URIRef + availableOnDevice: URIRef + availableThrough: URIRef + award: URIRef + awards: URIRef + awayTeam: URIRef + baseSalary: URIRef + bccRecipient: URIRef + bed: URIRef + beforeMedia: URIRef + benefits: URIRef + bestRating: URIRef + billingAddress: URIRef + billingIncrement: URIRef + billingPeriod: URIRef + birthDate: URIRef + birthPlace: URIRef + bitrate: URIRef + blogPost: URIRef + blogPosts: URIRef + boardingGroup: URIRef + boardingPolicy: URIRef + bookEdition: URIRef + bookFormat: URIRef + bookingAgent: URIRef + bookingTime: URIRef + borrower: URIRef + box: URIRef + branchCode: URIRef + branchOf: URIRef + brand: URIRef + breadcrumb: URIRef + broadcastAffiliateOf: URIRef + broadcastChannelId: URIRef + broadcastDisplayName: URIRef + broadcastFrequency: URIRef + broadcastFrequencyValue: URIRef + broadcastOfEvent: URIRef + broadcastServiceTier: URIRef + broadcastTimezone: URIRef + broadcaster: URIRef + broker: URIRef + browserRequirements: URIRef + busName: URIRef + busNumber: URIRef + businessFunction: URIRef + buyer: URIRef + byArtist: URIRef + calories: URIRef + candidate: URIRef + caption: URIRef + carbohydrateContent: URIRef + cargoVolume: URIRef + carrier: URIRef + carrierRequirements: URIRef + catalog: URIRef + catalogNumber: URIRef + category: URIRef + ccRecipient: URIRef + character: URIRef + characterAttribute: URIRef + characterName: URIRef + cheatCode: URIRef + checkinTime: URIRef + checkoutTime: URIRef + childMaxAge: URIRef + childMinAge: URIRef + children: URIRef + cholesterolContent: URIRef + circle: URIRef + citation: URIRef + claimReviewed: URIRef + clipNumber: URIRef + closes: URIRef + coach: URIRef + codeRepository: URIRef + codeSampleType: URIRef + colleague: URIRef + colleagues: URIRef + collection: URIRef + color: URIRef + comment: URIRef + commentCount: URIRef + commentText: URIRef + commentTime: URIRef + competitor: URIRef + composer: URIRef + confirmationNumber: URIRef + contactOption: URIRef + contactPoint: URIRef + contactPoints: URIRef + contactType: URIRef + containedIn: URIRef + containedInPlace: URIRef + containsPlace: URIRef + containsSeason: URIRef + contentLocation: URIRef + contentRating: URIRef + contentSize: URIRef + contentType: URIRef + contentUrl: URIRef + contributor: URIRef + cookTime: URIRef + cookingMethod: URIRef + copyrightHolder: URIRef + copyrightYear: URIRef + countriesNotSupported: URIRef + countriesSupported: URIRef + countryOfOrigin: URIRef + course: URIRef + courseCode: URIRef + courseMode: URIRef + coursePrerequisites: URIRef + coverageEndTime: URIRef + coverageStartTime: URIRef + creator: URIRef + creditedTo: URIRef + cssSelector: URIRef + currenciesAccepted: URIRef + currency: URIRef + customer: URIRef + dataFeedElement: URIRef + dataset: URIRef + datasetTimeInterval: URIRef + dateCreated: URIRef + dateDeleted: URIRef + dateIssued: URIRef + dateModified: URIRef + datePosted: URIRef + datePublished: URIRef + dateRead: URIRef + dateReceived: URIRef + dateSent: URIRef + dateVehicleFirstRegistered: URIRef + dateline: URIRef + dayOfWeek: URIRef + deathDate: URIRef + deathPlace: URIRef + defaultValue: URIRef + deliveryAddress: URIRef + deliveryLeadTime: URIRef + deliveryMethod: URIRef + deliveryStatus: URIRef + department: URIRef + departureAirport: URIRef + departureBusStop: URIRef + departureGate: URIRef + departurePlatform: URIRef + departureStation: URIRef + departureTerminal: URIRef + departureTime: URIRef + dependencies: URIRef + depth: URIRef + description: URIRef + device: URIRef + director: URIRef + directors: URIRef + disambiguatingDescription: URIRef + discount: URIRef + discountCode: URIRef + discountCurrency: URIRef + discusses: URIRef + discussionUrl: URIRef + dissolutionDate: URIRef + distance: URIRef + distribution: URIRef + doorTime: URIRef + downloadUrl: URIRef + downvoteCount: URIRef + driveWheelConfiguration: URIRef + dropoffLocation: URIRef + dropoffTime: URIRef + duns: URIRef + duration: URIRef + durationOfWarranty: URIRef + duringMedia: URIRef + editor: URIRef + educationalAlignment: URIRef + educationalCredentialAwarded: URIRef + educationalFramework: URIRef + educationalRole: URIRef + educationalUse: URIRef + elevation: URIRef + eligibleCustomerType: URIRef + eligibleDuration: URIRef + eligibleQuantity: URIRef + eligibleRegion: URIRef + eligibleTransactionVolume: URIRef + email: URIRef + embedUrl: URIRef + employee: URIRef + employees: URIRef + employmentType: URIRef + encodesCreativeWork: URIRef + encoding: URIRef + encodingFormat: URIRef + encodingType: URIRef + encodings: URIRef + endDate: URIRef + endTime: URIRef + endorsee: URIRef + entertainmentBusiness: URIRef + episode: URIRef + episodeNumber: URIRef + episodes: URIRef + equal: URIRef + error: URIRef + estimatedCost: URIRef + estimatedFlightDuration: URIRef + estimatedSalary: URIRef + event: URIRef + eventStatus: URIRef + events: URIRef + exampleOfWork: URIRef + executableLibraryName: URIRef + exerciseCourse: URIRef + exifData: URIRef + expectedArrivalFrom: URIRef + expectedArrivalUntil: URIRef + expectsAcceptanceOf: URIRef + experienceRequirements: URIRef + expires: URIRef + familyName: URIRef + fatContent: URIRef + faxNumber: URIRef + featureList: URIRef + feesAndCommissionsSpecification: URIRef + fiberContent: URIRef + fileFormat: URIRef + fileSize: URIRef + firstPerformance: URIRef + flightDistance: URIRef + flightNumber: URIRef + floorSize: URIRef + followee: URIRef + follows: URIRef + foodEstablishment: URIRef + foodEvent: URIRef + founder: URIRef + founders: URIRef + foundingDate: URIRef + foundingLocation: URIRef + free: URIRef + fromLocation: URIRef + fuelConsumption: URIRef + fuelEfficiency: URIRef + fuelType: URIRef + funder: URIRef + game: URIRef + gameItem: URIRef + gameLocation: URIRef + gamePlatform: URIRef + gameServer: URIRef + gameTip: URIRef + genre: URIRef + geo: URIRef + geoContains: URIRef + geoCoveredBy: URIRef + geoCovers: URIRef + geoCrosses: URIRef + geoDisjoint: URIRef + geoEquals: URIRef + geoIntersects: URIRef + geoMidpoint: URIRef + geoOverlaps: URIRef + geoRadius: URIRef + geoTouches: URIRef + geoWithin: URIRef + geographicArea: URIRef + givenName: URIRef + globalLocationNumber: URIRef + grantee: URIRef + greater: URIRef + greaterOrEqual: URIRef + gtin12: URIRef + gtin13: URIRef + gtin14: URIRef + gtin8: URIRef + hasBroadcastChannel: URIRef + hasCourseInstance: URIRef + hasDeliveryMethod: URIRef + hasDigitalDocumentPermission: URIRef + hasMap: URIRef + hasMenu: URIRef + hasMenuItem: URIRef + hasMenuSection: URIRef + hasOccupation: URIRef + hasOfferCatalog: URIRef + hasPOS: URIRef + hasPart: URIRef + headline: URIRef + height: URIRef + highPrice: URIRef + hiringOrganization: URIRef + homeLocation: URIRef + homeTeam: URIRef + honorificPrefix: URIRef + honorificSuffix: URIRef + hostingOrganization: URIRef + hoursAvailable: URIRef + httpMethod: URIRef + iataCode: URIRef + icaoCode: URIRef + identifier: URIRef + illustrator: URIRef + image: URIRef + inAlbum: URIRef + inBroadcastLineup: URIRef + inLanguage: URIRef + inPlaylist: URIRef + incentiveCompensation: URIRef + incentives: URIRef + includedComposition: URIRef + includedDataCatalog: URIRef + includedInDataCatalog: URIRef + includesObject: URIRef + industry: URIRef + ingredients: URIRef + installUrl: URIRef + instructor: URIRef + instrument: URIRef + interactionCount: URIRef + interactionService: URIRef + interactionStatistic: URIRef + interactionType: URIRef + interactivityType: URIRef + interestRate: URIRef + inventoryLevel: URIRef + isAccessibleForFree: URIRef + isAccessoryOrSparePartFor: URIRef + isBasedOn: URIRef + isBasedOnUrl: URIRef + isConsumableFor: URIRef + isFamilyFriendly: URIRef + isGift: URIRef + isLiveBroadcast: URIRef + isPartOf: URIRef + isRelatedTo: URIRef + isSimilarTo: URIRef + isVariantOf: URIRef + isbn: URIRef + isicV4: URIRef + isrcCode: URIRef + issn: URIRef + issueNumber: URIRef + issuedBy: URIRef + issuedThrough: URIRef + iswcCode: URIRef + item: URIRef + itemCondition: URIRef + itemListElement: URIRef + itemListOrder: URIRef + itemOffered: URIRef + itemReviewed: URIRef + itemShipped: URIRef + jobBenefits: URIRef + jobLocation: URIRef + keywords: URIRef + knownVehicleDamages: URIRef + knows: URIRef + landlord: URIRef + language: URIRef + lastReviewed: URIRef + latitude: URIRef + learningResourceType: URIRef + legalName: URIRef + leiCode: URIRef + lender: URIRef + lesser: URIRef + lesserOrEqual: URIRef + license: URIRef + line: URIRef + liveBlogUpdate: URIRef + loanTerm: URIRef + location: URIRef + locationCreated: URIRef + lodgingUnitDescription: URIRef + lodgingUnitType: URIRef + logo: URIRef + longitude: URIRef + loser: URIRef + lowPrice: URIRef + lyricist: URIRef + lyrics: URIRef + mainContentOfPage: URIRef + mainEntity: URIRef + mainEntityOfPage: URIRef + makesOffer: URIRef + manufacturer: URIRef + map: URIRef + mapType: URIRef + maps: URIRef + material: URIRef + maxPrice: URIRef + maxValue: URIRef + maximumAttendeeCapacity: URIRef + mealService: URIRef + median: URIRef + member: URIRef + memberOf: URIRef + members: URIRef + membershipNumber: URIRef + memoryRequirements: URIRef + mentions: URIRef + menu: URIRef + menuAddOn: URIRef + merchant: URIRef + messageAttachment: URIRef + mileageFromOdometer: URIRef + minPrice: URIRef + minValue: URIRef + minimumPaymentDue: URIRef + model: URIRef + modifiedTime: URIRef + mpn: URIRef + multipleValues: URIRef + musicArrangement: URIRef + musicBy: URIRef + musicCompositionForm: URIRef + musicGroupMember: URIRef + musicReleaseFormat: URIRef + musicalKey: URIRef + naics: URIRef + name: URIRef + namedPosition: URIRef + nationality: URIRef + netWorth: URIRef + nextItem: URIRef + nonEqual: URIRef + numAdults: URIRef + numChildren: URIRef + numTracks: URIRef + numberOfAirbags: URIRef + numberOfAxles: URIRef + numberOfBeds: URIRef + numberOfDoors: URIRef + numberOfEmployees: URIRef + numberOfEpisodes: URIRef + numberOfForwardGears: URIRef + numberOfItems: URIRef + numberOfPages: URIRef + numberOfPlayers: URIRef + numberOfPreviousOwners: URIRef + numberOfRooms: URIRef + numberOfSeasons: URIRef + numberedPosition: URIRef + nutrition: URIRef + object: URIRef + occupancy: URIRef + occupationLocation: URIRef + offerCount: URIRef + offeredBy: URIRef + offers: URIRef + openingHours: URIRef + openingHoursSpecification: URIRef + opens: URIRef + operatingSystem: URIRef + opponent: URIRef + option: URIRef + orderDate: URIRef + orderDelivery: URIRef + orderItemNumber: URIRef + orderItemStatus: URIRef + orderNumber: URIRef + orderQuantity: URIRef + orderStatus: URIRef + orderedItem: URIRef + organizer: URIRef + originAddress: URIRef + ownedFrom: URIRef + ownedThrough: URIRef + owns: URIRef + pageEnd: URIRef + pageStart: URIRef + pagination: URIRef + parent: URIRef + parentItem: URIRef + parentOrganization: URIRef + parentService: URIRef + parents: URIRef + partOfEpisode: URIRef + partOfInvoice: URIRef + partOfOrder: URIRef + partOfSeason: URIRef + partOfSeries: URIRef + partOfTVSeries: URIRef + participant: URIRef + partySize: URIRef + passengerPriorityStatus: URIRef + passengerSequenceNumber: URIRef + paymentAccepted: URIRef + paymentDue: URIRef + paymentDueDate: URIRef + paymentMethod: URIRef + paymentMethodId: URIRef + paymentStatus: URIRef + paymentUrl: URIRef + percentile10: URIRef + percentile25: URIRef + percentile75: URIRef + percentile90: URIRef + performTime: URIRef + performer: URIRef + performerIn: URIRef + performers: URIRef + permissionType: URIRef + permissions: URIRef + permitAudience: URIRef + permittedUsage: URIRef + petsAllowed: URIRef + photo: URIRef + photos: URIRef + pickupLocation: URIRef + pickupTime: URIRef + playMode: URIRef + playerType: URIRef + playersOnline: URIRef + polygon: URIRef + position: URIRef + postOfficeBoxNumber: URIRef + postalCode: URIRef + potentialAction: URIRef + predecessorOf: URIRef + prepTime: URIRef + previousItem: URIRef + previousStartDate: URIRef + price: URIRef + priceComponent: URIRef + priceCurrency: URIRef + priceRange: URIRef + priceSpecification: URIRef + priceType: URIRef + priceValidUntil: URIRef + primaryImageOfPage: URIRef + printColumn: URIRef + printEdition: URIRef + printPage: URIRef + printSection: URIRef + processingTime: URIRef + processorRequirements: URIRef + producer: URIRef + produces: URIRef + productID: URIRef + productSupported: URIRef + productionCompany: URIRef + productionDate: URIRef + proficiencyLevel: URIRef + programMembershipUsed: URIRef + programName: URIRef + programmingLanguage: URIRef + programmingModel: URIRef + propertyID: URIRef + proteinContent: URIRef + provider: URIRef + providerMobility: URIRef + providesBroadcastService: URIRef + providesService: URIRef + publicAccess: URIRef + publication: URIRef + publishedOn: URIRef + publisher: URIRef + publishingPrinciples: URIRef + purchaseDate: URIRef + query: URIRef + quest: URIRef + question: URIRef + ratingCount: URIRef + ratingValue: URIRef + readonlyValue: URIRef + realEstateAgent: URIRef + recipe: URIRef + recipeCategory: URIRef + recipeCuisine: URIRef + recipeIngredient: URIRef + recipeInstructions: URIRef + recipeYield: URIRef + recipient: URIRef + recordLabel: URIRef + recordedAs: URIRef + recordedAt: URIRef + recordedIn: URIRef + recordingOf: URIRef + referenceQuantity: URIRef + referencesOrder: URIRef + regionsAllowed: URIRef + relatedLink: URIRef + relatedTo: URIRef + releaseDate: URIRef + releaseNotes: URIRef + releaseOf: URIRef + releasedEvent: URIRef + relevantOccupation: URIRef + remainingAttendeeCapacity: URIRef + replacee: URIRef + replacer: URIRef + replyToUrl: URIRef + reportNumber: URIRef + representativeOfPage: URIRef + requiredCollateral: URIRef + requiredGender: URIRef + requiredMaxAge: URIRef + requiredMinAge: URIRef + requiredQuantity: URIRef + requirements: URIRef + requiresSubscription: URIRef + reservationFor: URIRef + reservationId: URIRef + reservationStatus: URIRef + reservedTicket: URIRef + responsibilities: URIRef + result: URIRef + resultComment: URIRef + resultReview: URIRef + review: URIRef + reviewAspect: URIRef + reviewBody: URIRef + reviewCount: URIRef + reviewRating: URIRef + reviewedBy: URIRef + reviews: URIRef + roleName: URIRef + rsvpResponse: URIRef + runtime: URIRef + runtimePlatform: URIRef + salaryCurrency: URIRef + sameAs: URIRef + sampleType: URIRef + saturatedFatContent: URIRef + scheduledPaymentDate: URIRef + scheduledTime: URIRef + schemaVersion: URIRef + screenCount: URIRef + screenshot: URIRef + season: URIRef + seasonNumber: URIRef + seasons: URIRef + seatNumber: URIRef + seatRow: URIRef + seatSection: URIRef + seatingType: URIRef + securityScreening: URIRef + seeks: URIRef + seller: URIRef + sender: URIRef + serialNumber: URIRef + serverStatus: URIRef + servesCuisine: URIRef + serviceArea: URIRef + serviceAudience: URIRef + serviceLocation: URIRef + serviceOperator: URIRef + serviceOutput: URIRef + servicePhone: URIRef + servicePostalAddress: URIRef + serviceSmsNumber: URIRef + serviceType: URIRef + serviceUrl: URIRef + servingSize: URIRef + sharedContent: URIRef + sibling: URIRef + siblings: URIRef + significantLink: URIRef + significantLinks: URIRef + skills: URIRef + sku: URIRef + slogan: URIRef + smokingAllowed: URIRef + sodiumContent: URIRef + softwareAddOn: URIRef + softwareHelp: URIRef + softwareRequirements: URIRef + softwareVersion: URIRef + sourceOrganization: URIRef + spatial: URIRef + spatialCoverage: URIRef + speakable: URIRef + specialCommitments: URIRef + specialOpeningHoursSpecification: URIRef + specialty: URIRef + sponsor: URIRef + sportsActivityLocation: URIRef + sportsEvent: URIRef + sportsTeam: URIRef + spouse: URIRef + starRating: URIRef + startDate: URIRef + startTime: URIRef + steeringPosition: URIRef + step: URIRef + stepValue: URIRef + steps: URIRef + storageRequirements: URIRef + streetAddress: URIRef + subEvent: URIRef + subEvents: URIRef + subOrganization: URIRef + subReservation: URIRef + subjectOf: URIRef + successorOf: URIRef + sugarContent: URIRef + suggestedAnswer: URIRef + suggestedGender: URIRef + suggestedMaxAge: URIRef + suggestedMinAge: URIRef + suitableForDiet: URIRef + superEvent: URIRef + supply: URIRef + supportingData: URIRef + surface: URIRef + target: URIRef + targetCollection: URIRef + targetDescription: URIRef + targetName: URIRef + targetPlatform: URIRef + targetProduct: URIRef + targetUrl: URIRef + taxID: URIRef + telephone: URIRef + temporal: URIRef + temporalCoverage: URIRef + text: URIRef + thumbnail: URIRef + thumbnailUrl: URIRef + tickerSymbol: URIRef + ticketNumber: URIRef + ticketToken: URIRef + ticketedSeat: URIRef + timeRequired: URIRef + title: URIRef + toLocation: URIRef + toRecipient: URIRef + tool: URIRef + totalPaymentDue: URIRef + totalPrice: URIRef + totalTime: URIRef + touristType: URIRef + track: URIRef + trackingNumber: URIRef + trackingUrl: URIRef + tracks: URIRef + trailer: URIRef + trainName: URIRef + trainNumber: URIRef + transFatContent: URIRef + transcript: URIRef + translator: URIRef + typeOfBed: URIRef + typeOfGood: URIRef + typicalAgeRange: URIRef + underName: URIRef + unitCode: URIRef + unitText: URIRef + unsaturatedFatContent: URIRef + uploadDate: URIRef + upvoteCount: URIRef + url: URIRef + urlTemplate: URIRef + userInteractionCount: URIRef + validFor: URIRef + validFrom: URIRef + validIn: URIRef + validThrough: URIRef + validUntil: URIRef + value: URIRef + valueAddedTaxIncluded: URIRef + valueMaxLength: URIRef + valueMinLength: URIRef + valueName: URIRef + valuePattern: URIRef + valueReference: URIRef + valueRequired: URIRef + vatID: URIRef + vehicleConfiguration: URIRef + vehicleEngine: URIRef + vehicleIdentificationNumber: URIRef + vehicleInteriorColor: URIRef + vehicleInteriorType: URIRef + vehicleModelDate: URIRef + vehicleSeatingCapacity: URIRef + vehicleTransmission: URIRef + vendor: URIRef + version: URIRef + video: URIRef + videoFormat: URIRef + videoFrameSize: URIRef + videoQuality: URIRef + volumeNumber: URIRef + warranty: URIRef + warrantyPromise: URIRef + warrantyScope: URIRef + webCheckinTime: URIRef + weight: URIRef + width: URIRef + winner: URIRef + wordCount: URIRef + workExample: URIRef + workFeatured: URIRef + workHours: URIRef + workLocation: URIRef + workPerformed: URIRef + workPresented: URIRef + worksFor: URIRef + worstRating: URIRef + xpath: URIRef + yearlyRevenue: URIRef + yearsInOperation: URIRef + AMRadioChannel: URIRef + APIReference: URIRef + AboutPage: URIRef + AcceptAction: URIRef + Accommodation: URIRef + AccountingService: URIRef + AchieveAction: URIRef + Action: URIRef + ActionAccessSpecification: URIRef + ActionStatusType: URIRef + ActivateAction: URIRef + AddAction: URIRef + AdministrativeArea: URIRef + AdultEntertainment: URIRef + AggregateOffer: URIRef + AggregateRating: URIRef + AgreeAction: URIRef + Airline: URIRef + Airport: URIRef + AlignmentObject: URIRef + AllocateAction: URIRef + AmusementPark: URIRef + AnimalShelter: URIRef + Answer: URIRef + Apartment: URIRef + ApartmentComplex: URIRef + AppendAction: URIRef + ApplyAction: URIRef + Aquarium: URIRef + ArriveAction: URIRef + ArtGallery: URIRef + Article: URIRef + AskAction: URIRef + AssessAction: URIRef + AssignAction: URIRef + Attorney: URIRef + Audience: URIRef + AudioObject: URIRef + AuthorizeAction: URIRef + AutoBodyShop: URIRef + AutoDealer: URIRef + AutoPartsStore: URIRef + AutoRental: URIRef + AutoRepair: URIRef + AutoWash: URIRef + AutomatedTeller: URIRef + AutomotiveBusiness: URIRef + Bakery: URIRef + BankAccount: URIRef + BankOrCreditUnion: URIRef + BarOrPub: URIRef + Barcode: URIRef + Beach: URIRef + BeautySalon: URIRef + BedAndBreakfast: URIRef + BedDetails: URIRef + BedType: URIRef + BefriendAction: URIRef + BikeStore: URIRef + Blog: URIRef + BlogPosting: URIRef + BoardingPolicyType: URIRef + BodyOfWater: URIRef + Book: URIRef + BookFormatType: URIRef + BookSeries: URIRef + BookStore: URIRef + BookmarkAction: URIRef + Boolean: URIRef + BorrowAction: URIRef + BowlingAlley: URIRef + Brand: URIRef + BreadcrumbList: URIRef + Brewery: URIRef + Bridge: URIRef + BroadcastChannel: URIRef + BroadcastEvent: URIRef + BroadcastFrequencySpecification: URIRef + BroadcastService: URIRef + BuddhistTemple: URIRef + BusReservation: URIRef + BusStation: URIRef + BusStop: URIRef + BusTrip: URIRef + BusinessAudience: URIRef + BusinessEntityType: URIRef + BusinessEvent: URIRef + BusinessFunction: URIRef + BuyAction: URIRef + CableOrSatelliteService: URIRef + CafeOrCoffeeShop: URIRef + Campground: URIRef + CampingPitch: URIRef + Canal: URIRef + CancelAction: URIRef + Car: URIRef + Casino: URIRef + CatholicChurch: URIRef + Cemetery: URIRef + CheckAction: URIRef + CheckInAction: URIRef + CheckOutAction: URIRef + CheckoutPage: URIRef + ChildCare: URIRef + ChildrensEvent: URIRef + ChooseAction: URIRef + Church: URIRef + City: URIRef + CityHall: URIRef + CivicStructure: URIRef + ClaimReview: URIRef + Clip: URIRef + ClothingStore: URIRef + Code: URIRef + CollectionPage: URIRef + CollegeOrUniversity: URIRef + ComedyClub: URIRef + ComedyEvent: URIRef + Comment: URIRef + CommentAction: URIRef + CommunicateAction: URIRef + CompoundPriceSpecification: URIRef + ComputerLanguage: URIRef + ComputerStore: URIRef + ConfirmAction: URIRef + ConsumeAction: URIRef + ContactPage: URIRef + ContactPoint: URIRef + ContactPointOption: URIRef + Continent: URIRef + ControlAction: URIRef + ConvenienceStore: URIRef + Conversation: URIRef + CookAction: URIRef + Corporation: URIRef + Country: URIRef + Course: URIRef + CourseInstance: URIRef + Courthouse: URIRef + CreateAction: URIRef + CreativeWork: URIRef + CreativeWorkSeason: URIRef + CreativeWorkSeries: URIRef + CreditCard: URIRef + Crematorium: URIRef + CurrencyConversionService: URIRef + DanceEvent: URIRef + DanceGroup: URIRef + DataCatalog: URIRef + DataDownload: URIRef + DataFeed: URIRef + DataFeedItem: URIRef + DataType: URIRef + Dataset: URIRef + Date: URIRef + DateTime: URIRef + DatedMoneySpecification: URIRef + DayOfWeek: URIRef + DaySpa: URIRef + DeactivateAction: URIRef + DefenceEstablishment: URIRef + DeleteAction: URIRef + DeliveryChargeSpecification: URIRef + DeliveryEvent: URIRef + DeliveryMethod: URIRef + Demand: URIRef + Dentist: URIRef + DepartAction: URIRef + DepartmentStore: URIRef + DepositAccount: URIRef + DigitalDocument: URIRef + DigitalDocumentPermission: URIRef + DigitalDocumentPermissionType: URIRef + DisagreeAction: URIRef + DiscoverAction: URIRef + DiscussionForumPosting: URIRef + DislikeAction: URIRef + Distance: URIRef + Distillery: URIRef + DonateAction: URIRef + DownloadAction: URIRef + DrawAction: URIRef + DrinkAction: URIRef + DriveWheelConfigurationValue: URIRef + DryCleaningOrLaundry: URIRef + Duration: URIRef + EatAction: URIRef + EducationEvent: URIRef + EducationalAudience: URIRef + EducationalOrganization: URIRef + Electrician: URIRef + ElectronicsStore: URIRef + ElementarySchool: URIRef + EmailMessage: URIRef + Embassy: URIRef + EmergencyService: URIRef + EmployeeRole: URIRef + EmployerAggregateRating: URIRef + EmploymentAgency: URIRef + EndorseAction: URIRef + EndorsementRating: URIRef + Energy: URIRef + EngineSpecification: URIRef + EntertainmentBusiness: URIRef + EntryPoint: URIRef + Enumeration: URIRef + Episode: URIRef + Event: URIRef + EventReservation: URIRef + EventStatusType: URIRef + EventVenue: URIRef + ExerciseAction: URIRef + ExerciseGym: URIRef + ExhibitionEvent: URIRef + FAQPage: URIRef + FMRadioChannel: URIRef + FastFoodRestaurant: URIRef + Festival: URIRef + FilmAction: URIRef + FinancialProduct: URIRef + FinancialService: URIRef + FindAction: URIRef + FireStation: URIRef + Flight: URIRef + FlightReservation: URIRef + Float: URIRef + Florist: URIRef + FollowAction: URIRef + FoodEstablishment: URIRef + FoodEstablishmentReservation: URIRef + FoodEvent: URIRef + FoodService: URIRef + FurnitureStore: URIRef + Game: URIRef + GamePlayMode: URIRef + GameServer: URIRef + GameServerStatus: URIRef + GardenStore: URIRef + GasStation: URIRef + GatedResidenceCommunity: URIRef + GenderType: URIRef + GeneralContractor: URIRef + GeoCircle: URIRef + GeoCoordinates: URIRef + GeoShape: URIRef + GiveAction: URIRef + GolfCourse: URIRef + GovernmentBuilding: URIRef + GovernmentOffice: URIRef + GovernmentOrganization: URIRef + GovernmentPermit: URIRef + GovernmentService: URIRef + GroceryStore: URIRef + HVACBusiness: URIRef + HairSalon: URIRef + HardwareStore: URIRef + HealthAndBeautyBusiness: URIRef + HealthClub: URIRef + HighSchool: URIRef + HinduTemple: URIRef + HobbyShop: URIRef + HomeAndConstructionBusiness: URIRef + HomeGoodsStore: URIRef + Hospital: URIRef + Hostel: URIRef + Hotel: URIRef + HotelRoom: URIRef + House: URIRef + HousePainter: URIRef + HowTo: URIRef + HowToDirection: URIRef + HowToItem: URIRef + HowToSection: URIRef + HowToStep: URIRef + HowToSupply: URIRef + HowToTip: URIRef + HowToTool: URIRef + IceCreamShop: URIRef + IgnoreAction: URIRef + ImageGallery: URIRef + ImageObject: URIRef + IndividualProduct: URIRef + InformAction: URIRef + InsertAction: URIRef + InstallAction: URIRef + InsuranceAgency: URIRef + Intangible: URIRef + Integer: URIRef + InteractAction: URIRef + InteractionCounter: URIRef + InternetCafe: URIRef + InvestmentOrDeposit: URIRef + InviteAction: URIRef + Invoice: URIRef + ItemAvailability: URIRef + ItemList: URIRef + ItemListOrderType: URIRef + ItemPage: URIRef + JewelryStore: URIRef + JobPosting: URIRef + JoinAction: URIRef + LakeBodyOfWater: URIRef + Landform: URIRef + LandmarksOrHistoricalBuildings: URIRef + Language: URIRef + LeaveAction: URIRef + LegalService: URIRef + LegislativeBuilding: URIRef + LendAction: URIRef + Library: URIRef + LikeAction: URIRef + LiquorStore: URIRef + ListItem: URIRef + ListenAction: URIRef + LiteraryEvent: URIRef + LiveBlogPosting: URIRef + LoanOrCredit: URIRef + LocalBusiness: URIRef + LocationFeatureSpecification: URIRef + LockerDelivery: URIRef + Locksmith: URIRef + LodgingBusiness: URIRef + LodgingReservation: URIRef + LoseAction: URIRef + Map: URIRef + MapCategoryType: URIRef + MarryAction: URIRef + Mass: URIRef + MediaGallery: URIRef + MediaObject: URIRef + MediaSubscription: URIRef + MedicalOrganization: URIRef + MeetingRoom: URIRef + MensClothingStore: URIRef + Menu: URIRef + MenuItem: URIRef + MenuSection: URIRef + Message: URIRef + MiddleSchool: URIRef + MobileApplication: URIRef + MobilePhoneStore: URIRef + MonetaryAmount: URIRef + MonetaryAmountDistribution: URIRef + Mosque: URIRef + Motel: URIRef + MotorcycleDealer: URIRef + MotorcycleRepair: URIRef + Mountain: URIRef + MoveAction: URIRef + Movie: URIRef + MovieClip: URIRef + MovieRentalStore: URIRef + MovieSeries: URIRef + MovieTheater: URIRef + MovingCompany: URIRef + Museum: URIRef + MusicAlbum: URIRef + MusicAlbumProductionType: URIRef + MusicAlbumReleaseType: URIRef + MusicComposition: URIRef + MusicEvent: URIRef + MusicGroup: URIRef + MusicPlaylist: URIRef + MusicRecording: URIRef + MusicRelease: URIRef + MusicReleaseFormatType: URIRef + MusicStore: URIRef + MusicVenue: URIRef + MusicVideoObject: URIRef + NGO: URIRef + NailSalon: URIRef + NewsArticle: URIRef + NightClub: URIRef + Notary: URIRef + NoteDigitalDocument: URIRef + Number: URIRef + NutritionInformation: URIRef + Occupation: URIRef + OceanBodyOfWater: URIRef + Offer: URIRef + OfferCatalog: URIRef + OfferItemCondition: URIRef + OfficeEquipmentStore: URIRef + OnDemandEvent: URIRef + OpeningHoursSpecification: URIRef + Order: URIRef + OrderAction: URIRef + OrderItem: URIRef + OrderStatus: URIRef + Organization: URIRef + OrganizationRole: URIRef + OrganizeAction: URIRef + OutletStore: URIRef + OwnershipInfo: URIRef + PaintAction: URIRef + Painting: URIRef + ParcelDelivery: URIRef + ParcelService: URIRef + ParentAudience: URIRef + Park: URIRef + ParkingFacility: URIRef + PawnShop: URIRef + PayAction: URIRef + PaymentCard: URIRef + PaymentChargeSpecification: URIRef + PaymentMethod: URIRef + PaymentService: URIRef + PaymentStatusType: URIRef + PeopleAudience: URIRef + PerformAction: URIRef + PerformanceRole: URIRef + PerformingArtsTheater: URIRef + PerformingGroup: URIRef + Periodical: URIRef + Permit: URIRef + Person: URIRef + PetStore: URIRef + Pharmacy: URIRef + Photograph: URIRef + PhotographAction: URIRef + Physician: URIRef + Place: URIRef + PlaceOfWorship: URIRef + PlanAction: URIRef + PlayAction: URIRef + Playground: URIRef + Plumber: URIRef + PoliceStation: URIRef + Pond: URIRef + PostOffice: URIRef + PostalAddress: URIRef + PreOrderAction: URIRef + PrependAction: URIRef + Preschool: URIRef + PresentationDigitalDocument: URIRef + PriceSpecification: URIRef + Product: URIRef + ProductModel: URIRef + ProfessionalService: URIRef + ProfilePage: URIRef + ProgramMembership: URIRef + PropertyValue: URIRef + PropertyValueSpecification: URIRef + PublicSwimmingPool: URIRef + PublicationEvent: URIRef + PublicationIssue: URIRef + PublicationVolume: URIRef + QAPage: URIRef + QualitativeValue: URIRef + QuantitativeValue: URIRef + QuantitativeValueDistribution: URIRef + Quantity: URIRef + Question: URIRef + QuoteAction: URIRef + RVPark: URIRef + RadioChannel: URIRef + RadioClip: URIRef + RadioEpisode: URIRef + RadioSeason: URIRef + RadioSeries: URIRef + RadioStation: URIRef + Rating: URIRef + ReactAction: URIRef + ReadAction: URIRef + RealEstateAgent: URIRef + ReceiveAction: URIRef + Recipe: URIRef + RecyclingCenter: URIRef + RegisterAction: URIRef + RejectAction: URIRef + RentAction: URIRef + RentalCarReservation: URIRef + ReplaceAction: URIRef + ReplyAction: URIRef + Report: URIRef + Reservation: URIRef + ReservationPackage: URIRef + ReservationStatusType: URIRef + ReserveAction: URIRef + Reservoir: URIRef + Residence: URIRef + Resort: URIRef + Restaurant: URIRef + RestrictedDiet: URIRef + ResumeAction: URIRef + ReturnAction: URIRef + Review: URIRef + ReviewAction: URIRef + RiverBodyOfWater: URIRef + Role: URIRef + RoofingContractor: URIRef + Room: URIRef + RsvpAction: URIRef + RsvpResponseType: URIRef + SaleEvent: URIRef + ScheduleAction: URIRef + ScholarlyArticle: URIRef + School: URIRef + ScreeningEvent: URIRef + Sculpture: URIRef + SeaBodyOfWater: URIRef + SearchAction: URIRef + SearchResultsPage: URIRef + Season: URIRef + Seat: URIRef + SelfStorage: URIRef + SellAction: URIRef + SendAction: URIRef + Series: URIRef + Service: URIRef + ServiceChannel: URIRef + ShareAction: URIRef + ShoeStore: URIRef + ShoppingCenter: URIRef + SingleFamilyResidence: URIRef + SiteNavigationElement: URIRef + SkiResort: URIRef + SocialEvent: URIRef + SocialMediaPosting: URIRef + SoftwareApplication: URIRef + SoftwareSourceCode: URIRef + SomeProducts: URIRef + SpeakableSpecification: URIRef + Specialty: URIRef + SportingGoodsStore: URIRef + SportsActivityLocation: URIRef + SportsClub: URIRef + SportsEvent: URIRef + SportsOrganization: URIRef + SportsTeam: URIRef + SpreadsheetDigitalDocument: URIRef + StadiumOrArena: URIRef + State: URIRef + SteeringPositionValue: URIRef + Store: URIRef + StructuredValue: URIRef + SubscribeAction: URIRef + SubwayStation: URIRef + Suite: URIRef + SuspendAction: URIRef + Synagogue: URIRef + TVClip: URIRef + TVEpisode: URIRef + TVSeason: URIRef + TVSeries: URIRef + Table: URIRef + TakeAction: URIRef + TattooParlor: URIRef + Taxi: URIRef + TaxiReservation: URIRef + TaxiService: URIRef + TaxiStand: URIRef + TechArticle: URIRef + TelevisionChannel: URIRef + TelevisionStation: URIRef + TennisComplex: URIRef + Text: URIRef + TextDigitalDocument: URIRef + TheaterEvent: URIRef + TheaterGroup: URIRef + Thing: URIRef + Ticket: URIRef + TieAction: URIRef + Time: URIRef + TipAction: URIRef + TireShop: URIRef + TouristAttraction: URIRef + TouristInformationCenter: URIRef + ToyStore: URIRef + TrackAction: URIRef + TradeAction: URIRef + TrainReservation: URIRef + TrainStation: URIRef + TrainTrip: URIRef + TransferAction: URIRef + TravelAction: URIRef + TravelAgency: URIRef + Trip: URIRef + TypeAndQuantityNode: URIRef + URL: URIRef + UnRegisterAction: URIRef + UnitPriceSpecification: URIRef + UpdateAction: URIRef + UseAction: URIRef + UserBlocks: URIRef + UserCheckins: URIRef + UserComments: URIRef + UserDownloads: URIRef + UserInteraction: URIRef + UserLikes: URIRef + UserPageVisits: URIRef + UserPlays: URIRef + UserPlusOnes: URIRef + UserTweets: URIRef + Vehicle: URIRef + VideoGallery: URIRef + VideoGame: URIRef + VideoGameClip: URIRef + VideoGameSeries: URIRef + VideoObject: URIRef + ViewAction: URIRef + VisualArtsEvent: URIRef + VisualArtwork: URIRef + Volcano: URIRef + VoteAction: URIRef + WPAdBlock: URIRef + WPFooter: URIRef + WPHeader: URIRef + WPSideBar: URIRef + WantAction: URIRef + WarrantyPromise: URIRef + WarrantyScope: URIRef + WatchAction: URIRef + Waterfall: URIRef + WearAction: URIRef + WebApplication: URIRef + WebPage: URIRef + WebPageElement: URIRef + WebSite: URIRef + WholesaleStore: URIRef + WinAction: URIRef + Winery: URIRef + WorkersUnion: URIRef + WriteAction: URIRef + Zoo: URIRef diff --git a/mypy-stubs/rdflib/namespace/_SH.pyi b/mypy-stubs/rdflib/namespace/_SH.pyi new file mode 100644 index 00000000..d755656c --- /dev/null +++ b/mypy-stubs/rdflib/namespace/_SH.pyi @@ -0,0 +1,183 @@ +from rdflib.namespace import DefinedNamespace as DefinedNamespace +from rdflib.namespace import Namespace as Namespace +from rdflib.term import URIRef as URIRef + +class SH(DefinedNamespace): + alternativePath: URIRef + annotationProperty: URIRef + annotationValue: URIRef + annotationVarName: URIRef + ask: URIRef + closed: URIRef + condition: URIRef + conforms: URIRef + construct: URIRef + datatype: URIRef + deactivated: URIRef + declare: URIRef + defaultValue: URIRef + description: URIRef + detail: URIRef + disjoint: URIRef + entailment: URIRef + equals: URIRef + expression: URIRef + filterShape: URIRef + flags: URIRef + focusNode: URIRef + group: URIRef + hasValue: URIRef + ignoredProperties: URIRef + intersection: URIRef + inversePath: URIRef + js: URIRef + jsFunctionName: URIRef + jsLibrary: URIRef + jsLibraryURL: URIRef + labelTemplate: URIRef + languageIn: URIRef + lessThan: URIRef + lessThanOrEquals: URIRef + maxCount: URIRef + maxExclusive: URIRef + maxInclusive: URIRef + maxLength: URIRef + message: URIRef + minCount: URIRef + minExclusive: URIRef + minInclusive: URIRef + minLength: URIRef + name: URIRef + namespace: URIRef + node: URIRef + nodeKind: URIRef + nodeValidator: URIRef + nodes: URIRef + object: URIRef + oneOrMorePath: URIRef + optional: URIRef + order: URIRef + parameter: URIRef + path: URIRef + pattern: URIRef + predicate: URIRef + prefix: URIRef + prefixes: URIRef + property: URIRef + propertyValidator: URIRef + qualifiedMaxCount: URIRef + qualifiedMinCount: URIRef + qualifiedValueShape: URIRef + qualifiedValueShapesDisjoint: URIRef + result: URIRef + resultAnnotation: URIRef + resultMessage: URIRef + resultPath: URIRef + resultSeverity: URIRef + returnType: URIRef + rule: URIRef + select: URIRef + severity: URIRef + shapesGraph: URIRef + shapesGraphWellFormed: URIRef + sourceConstraint: URIRef + sourceConstraintComponent: URIRef + sourceShape: URIRef + sparql: URIRef + subject: URIRef + suggestedShapesGraph: URIRef + target: URIRef + targetClass: URIRef + targetNode: URIRef + targetObjectsOf: URIRef + targetSubjectsOf: URIRef + union: URIRef + uniqueLang: URIRef + update: URIRef + validator: URIRef + value: URIRef + xone: URIRef + zeroOrMorePath: URIRef + zeroOrOnePath: URIRef + AbstractResult: URIRef + ConstraintComponent: URIRef + Function: URIRef + JSConstraint: URIRef + JSExecutable: URIRef + JSFunction: URIRef + JSLibrary: URIRef + JSRule: URIRef + JSTarget: URIRef + JSTargetType: URIRef + JSValidator: URIRef + NodeKind: URIRef + NodeShape: URIRef + Parameter: URIRef + Parameterizable: URIRef + PrefixDeclaration: URIRef + PropertyGroup: URIRef + PropertyShape: URIRef + ResultAnnotation: URIRef + Rule: URIRef + SPARQLAskExecutable: URIRef + SPARQLAskValidator: URIRef + SPARQLConstraint: URIRef + SPARQLConstructExecutable: URIRef + SPARQLExecutable: URIRef + SPARQLFunction: URIRef + SPARQLRule: URIRef + SPARQLSelectExecutable: URIRef + SPARQLSelectValidator: URIRef + SPARQLTarget: URIRef + SPARQLTargetType: URIRef + SPARQLUpdateExecutable: URIRef + Severity: URIRef + Shape: URIRef + Target: URIRef + TargetType: URIRef + TripleRule: URIRef + ValidationReport: URIRef + ValidationResult: URIRef + Validator: URIRef + this: URIRef + AndConstraintComponent: URIRef + ClassConstraintComponent: URIRef + ClosedConstraintComponent: URIRef + DatatypeConstraintComponent: URIRef + DisjointConstraintComponent: URIRef + EqualsConstraintComponent: URIRef + ExpressionConstraintComponent: URIRef + HasValueConstraintComponent: URIRef + InConstraintComponent: URIRef + JSConstraintComponent: URIRef + LanguageInConstraintComponent: URIRef + LessThanConstraintComponent: URIRef + LessThanOrEqualsConstraintComponent: URIRef + MaxCountConstraintComponent: URIRef + MaxExclusiveConstraintComponent: URIRef + MaxInclusiveConstraintComponent: URIRef + MaxLengthConstraintComponent: URIRef + MinCountConstraintComponent: URIRef + MinExclusiveConstraintComponent: URIRef + MinInclusiveConstraintComponent: URIRef + MinLengthConstraintComponent: URIRef + NodeConstraintComponent: URIRef + NodeKindConstraintComponent: URIRef + NotConstraintComponent: URIRef + OrConstraintComponent: URIRef + PatternConstraintComponent: URIRef + PropertyConstraintComponent: URIRef + QualifiedMaxCountConstraintComponent: URIRef + QualifiedMinCountConstraintComponent: URIRef + SPARQLConstraintComponent: URIRef + UniqueLangConstraintComponent: URIRef + XoneConstraintComponent: URIRef + BlankNode: URIRef + BlankNodeOrIRI: URIRef + BlankNodeOrLiteral: URIRef + IRI: URIRef + IRIOrLiteral: URIRef + Literal: URIRef + Info: URIRef + Violation: URIRef + Warning: URIRef diff --git a/mypy-stubs/rdflib/namespace/_SKOS.pyi b/mypy-stubs/rdflib/namespace/_SKOS.pyi new file mode 100644 index 00000000..a52fcc46 --- /dev/null +++ b/mypy-stubs/rdflib/namespace/_SKOS.pyi @@ -0,0 +1,37 @@ +from rdflib.namespace import DefinedNamespace as DefinedNamespace +from rdflib.namespace import Namespace as Namespace +from rdflib.term import URIRef as URIRef + +class SKOS(DefinedNamespace): + altLabel: URIRef + broadMatch: URIRef + broader: URIRef + broaderTransitive: URIRef + changeNote: URIRef + closeMatch: URIRef + definition: URIRef + editorialNote: URIRef + exactMatch: URIRef + example: URIRef + hasTopConcept: URIRef + hiddenLabel: URIRef + historyNote: URIRef + inScheme: URIRef + mappingRelation: URIRef + member: URIRef + memberList: URIRef + narrowMatch: URIRef + narrower: URIRef + narrowerTransitive: URIRef + notation: URIRef + note: URIRef + prefLabel: URIRef + related: URIRef + relatedMatch: URIRef + scopeNote: URIRef + semanticRelation: URIRef + topConceptOf: URIRef + Collection: URIRef + Concept: URIRef + ConceptScheme: URIRef + OrderedCollection: URIRef diff --git a/mypy-stubs/rdflib/namespace/_SOSA.pyi b/mypy-stubs/rdflib/namespace/_SOSA.pyi new file mode 100644 index 00000000..465a7296 --- /dev/null +++ b/mypy-stubs/rdflib/namespace/_SOSA.pyi @@ -0,0 +1,41 @@ +from rdflib.namespace import DefinedNamespace as DefinedNamespace +from rdflib.namespace import Namespace as Namespace +from rdflib.term import URIRef as URIRef + +class SOSA(DefinedNamespace): + ActuatableProperty: URIRef + Actuation: URIRef + Actuator: URIRef + FeatureOfInterest: URIRef + ObservableProperty: URIRef + Observation: URIRef + Platform: URIRef + Procedure: URIRef + Result: URIRef + Sample: URIRef + Sampler: URIRef + Sampling: URIRef + Sensor: URIRef + hasSimpleResult: URIRef + resultTime: URIRef + actsOnProperty: URIRef + hasFeatureOfInterest: URIRef + hasResult: URIRef + hasSample: URIRef + hosts: URIRef + isActedOnBy: URIRef + isFeatureOfInterestOf: URIRef + isHostedBy: URIRef + isObservedBy: URIRef + isResultOf: URIRef + isSampleOf: URIRef + madeActuation: URIRef + madeByActuator: URIRef + madeBySampler: URIRef + madeBySensor: URIRef + madeObservation: URIRef + madeSampling: URIRef + observedProperty: URIRef + observes: URIRef + phenomenonTime: URIRef + usedProcedure: URIRef diff --git a/mypy-stubs/rdflib/namespace/_SSN.pyi b/mypy-stubs/rdflib/namespace/_SSN.pyi new file mode 100644 index 00000000..aa82b50a --- /dev/null +++ b/mypy-stubs/rdflib/namespace/_SSN.pyi @@ -0,0 +1,26 @@ +from rdflib.namespace import DefinedNamespace as DefinedNamespace +from rdflib.namespace import Namespace as Namespace +from rdflib.term import URIRef as URIRef + +class SSN(DefinedNamespace): + Deployment: URIRef + Input: URIRef + Output: URIRef + Property: URIRef + Stimulus: URIRef + System: URIRef + wasOriginatedBy: URIRef + deployedOnPlatform: URIRef + deployedSystem: URIRef + detects: URIRef + forProperty: URIRef + hasDeployment: URIRef + hasInput: URIRef + hasOutput: URIRef + hasProperty: URIRef + hasSubSystem: URIRef + implementedBy: URIRef + implements: URIRef + inDeployment: URIRef + isPropertyOf: URIRef + isProxyFor: URIRef diff --git a/mypy-stubs/rdflib/namespace/_TIME.pyi b/mypy-stubs/rdflib/namespace/_TIME.pyi new file mode 100644 index 00000000..2321ca3b --- /dev/null +++ b/mypy-stubs/rdflib/namespace/_TIME.pyi @@ -0,0 +1,100 @@ +from rdflib.namespace import DefinedNamespace as DefinedNamespace +from rdflib.namespace import Namespace as Namespace +from rdflib.term import URIRef as URIRef + +class TIME(DefinedNamespace): + generalDay: URIRef + generalMonth: URIRef + generalYear: URIRef + DateTimeDescription: URIRef + DateTimeInterval: URIRef + DayOfWeek: URIRef + Duration: URIRef + DurationDescription: URIRef + GeneralDateTimeDescription: URIRef + GeneralDurationDescription: URIRef + Instant: URIRef + Interval: URIRef + MonthOfYear: URIRef + ProperInterval: URIRef + TRS: URIRef + TemporalDuration: URIRef + TemporalEntity: URIRef + TemporalPosition: URIRef + TemporalUnit: URIRef + TimePosition: URIRef + TimeZone: URIRef + day: URIRef + dayOfYear: URIRef + days: URIRef + hasXSDDuration: URIRef + hour: URIRef + hours: URIRef + inXSDDate: URIRef + inXSDDateTimeStamp: URIRef + inXSDgYear: URIRef + inXSDgYearMonth: URIRef + minute: URIRef + minutes: URIRef + month: URIRef + months: URIRef + nominalPosition: URIRef + numericDuration: URIRef + numericPosition: URIRef + second: URIRef + seconds: URIRef + week: URIRef + weeks: URIRef + year: URIRef + years: URIRef + January: URIRef + Year: URIRef + inXSDDateTime: URIRef + xsdDateTime: URIRef + hasTRS: URIRef + after: URIRef + dayOfWeek: URIRef + hasBeginning: URIRef + hasDateTimeDescription: URIRef + hasDuration: URIRef + hasDurationDescription: URIRef + hasEnd: URIRef + hasTemporalDuration: URIRef + hasTime: URIRef + inDateTime: URIRef + inTemporalPosition: URIRef + inTimePosition: URIRef + inside: URIRef + intervalAfter: URIRef + intervalBefore: URIRef + intervalContains: URIRef + intervalDisjoint: URIRef + intervalDuring: URIRef + intervalEquals: URIRef + intervalFinishedBy: URIRef + intervalFinishes: URIRef + intervalIn: URIRef + intervalMeets: URIRef + intervalMetBy: URIRef + intervalOverlappedBy: URIRef + intervalOverlaps: URIRef + intervalStartedBy: URIRef + intervalStarts: URIRef + monthOfYear: URIRef + timeZone: URIRef + unitType: URIRef + before: URIRef + Friday: URIRef + Monday: URIRef + Saturday: URIRef + Sunday: URIRef + Thursday: URIRef + Tuesday: URIRef + Wednesday: URIRef + unitDay: URIRef + unitHour: URIRef + unitMinute: URIRef + unitMonth: URIRef + unitSecond: URIRef + unitWeek: URIRef + unitYear: URIRef diff --git a/mypy-stubs/rdflib/namespace/_VOID.pyi b/mypy-stubs/rdflib/namespace/_VOID.pyi new file mode 100644 index 00000000..90c00d89 --- /dev/null +++ b/mypy-stubs/rdflib/namespace/_VOID.pyi @@ -0,0 +1,35 @@ +from rdflib.namespace import DefinedNamespace as DefinedNamespace +from rdflib.namespace import Namespace as Namespace +from rdflib.term import URIRef as URIRef + +class VOID(DefinedNamespace): + classPartition: URIRef + classes: URIRef + dataDump: URIRef + distinctObjects: URIRef + distinctSubjects: URIRef + documents: URIRef + entities: URIRef + exampleResource: URIRef + feature: URIRef + inDataset: URIRef + linkPredicate: URIRef + objectsTarget: URIRef + openSearchDescription: URIRef + properties: URIRef + property: URIRef + propertyPartition: URIRef + rootResource: URIRef + sparqlEndpoint: URIRef + subjectsTarget: URIRef + subset: URIRef + target: URIRef + triples: URIRef + uriLookupEndpoint: URIRef + uriRegexPattern: URIRef + uriSpace: URIRef + vocabulary: URIRef + Dataset: URIRef + DatasetDescription: URIRef + Linkset: URIRef + TechnicalFeature: URIRef diff --git a/mypy-stubs/rdflib/namespace/_XSD.pyi b/mypy-stubs/rdflib/namespace/_XSD.pyi new file mode 100644 index 00000000..d9f948f7 --- /dev/null +++ b/mypy-stubs/rdflib/namespace/_XSD.pyi @@ -0,0 +1,77 @@ +from rdflib.namespace import DefinedNamespace as DefinedNamespace +from rdflib.namespace import Namespace as Namespace +from rdflib.term import URIRef as URIRef + +class XSD(DefinedNamespace): + ENTITIES: URIRef + ENTITY: URIRef + ID: URIRef + IDREF: URIRef + IDREFS: URIRef + NCName: URIRef + NMTOKEN: URIRef + NMTOKENS: URIRef + NOTATION: URIRef + Name: URIRef + QName: URIRef + anyURI: URIRef + base64Binary: URIRef + boolean: URIRef + byte: URIRef + date: URIRef + dateTime: URIRef + dateTimeStamp: URIRef + dayTimeDuration: URIRef + decimal: URIRef + double: URIRef + duration: URIRef + float: URIRef + gDay: URIRef + gMonth: URIRef + gMonthDay: URIRef + gYear: URIRef + gYearMonth: URIRef + hexBinary: URIRef + int: URIRef + integer: URIRef + language: URIRef + long: URIRef + negativeInteger: URIRef + nonNegativeInteger: URIRef + nonPositiveInteger: URIRef + normalizedString: URIRef + positiveInteger: URIRef + short: URIRef + string: URIRef + time: URIRef + token: URIRef + unsignedByte: URIRef + unsignedInt: URIRef + unsignedLong: URIRef + unsignedShort: URIRef + yearMonthDuration: URIRef + ordered: URIRef + bounded: URIRef + cardinality: URIRef + numeric: URIRef + length: URIRef + minLength: URIRef + maxLength: URIRef + pattern: URIRef + enumeration: URIRef + whiteSpace: URIRef + maxExclusive: URIRef + maxInclusive: URIRef + minExclusive: URIRef + minInclusive: URIRef + totalDigits: URIRef + fractionDigits: URIRef + Assertions: URIRef + explicitTimezone: URIRef + year: URIRef + month: URIRef + day: URIRef + hour: URIRef + minute: URIRef + second: URIRef + timezoneOffset: URIRef diff --git a/mypy-stubs/rdflib/namespace/__init__.pyi b/mypy-stubs/rdflib/namespace/__init__.pyi new file mode 100644 index 00000000..63af9297 --- /dev/null +++ b/mypy-stubs/rdflib/namespace/__init__.pyi @@ -0,0 +1,85 @@ +from typing import Any, Tuple + +from rdflib.term import URIRef + +__all__ = [ + "split_uri", + "Namespace", + "ClosedNamespace", + "RDF", + "RDFS", + "CSVW", + "DC", + "DCAT", + "DCTERMS", + "DOAP", + "FOAF", + "ODRL2", + "ORG", + "OWL", + "PROF", + "PROV", + "QB", + "SDO", + "SH", + "SKOS", + "SOSA", + "SSN", + "TIME", + "VOID", + "XSD", + "OWL", +] + +class Namespace(str): + @property + def title(self) -> URIRef: ... # type: ignore[override] + def term(self, name: Any) -> URIRef: ... + def __getitem__(self, key: Any) -> URIRef: ... + def __getattr__(self, name: str) -> URIRef: ... + +class URIPattern(str): + def format(self, *args: Any, **kwargs: Any) -> str: ... + +class DefinedNamespaceMeta(type): + def __getitem__(cls, name: Any, default: Any | None = ...) -> URIRef: ... + def __getattr__(cls, name: Any) -> URIRef: ... + def __contains__(cls, item: Any) -> bool: ... + +class DefinedNamespace(metaclass=DefinedNamespaceMeta): + def __init__(self) -> None: ... + +class ClosedNamespace(Namespace): + def __new__(cls, uri: Any, terms: Any) -> ClosedNamespace: ... + @property + def uri(self) -> str: ... + +NAME_START_CATEGORIES = ["Ll", "Lu", "Lo", "Lt", "Nl"] +SPLIT_START_CATEGORIES = NAME_START_CATEGORIES + ["Nd"] + +XMLNS = "http://www.w3.org/XML/1998/namespace" + +def split_uri(uri: Any, split_start: Any = ...) -> Tuple[str, str]: ... + +from rdflib.namespace._CSVW import CSVW +from rdflib.namespace._DC import DC +from rdflib.namespace._DCAT import DCAT +from rdflib.namespace._DCTERMS import DCTERMS +from rdflib.namespace._DOAP import DOAP +from rdflib.namespace._FOAF import FOAF +from rdflib.namespace._ODRL2 import ODRL2 +from rdflib.namespace._ORG import ORG +from rdflib.namespace._OWL import OWL +from rdflib.namespace._PROF import PROF +from rdflib.namespace._PROV import PROV +from rdflib.namespace._QB import QB +from rdflib.namespace._RDF import RDF +from rdflib.namespace._RDFS import RDFS +from rdflib.namespace._SDO import SDO +from rdflib.namespace._SH import SH +from rdflib.namespace._SKOS import SKOS +from rdflib.namespace._SOSA import SOSA +from rdflib.namespace._SSN import SSN +from rdflib.namespace._TIME import TIME +from rdflib.namespace._VOID import VOID +from rdflib.namespace._XSD import XSD diff --git a/mypy-stubs/rdflib/parser.pyi b/mypy-stubs/rdflib/parser.pyi new file mode 100644 index 00000000..4c628bec --- /dev/null +++ b/mypy-stubs/rdflib/parser.pyi @@ -0,0 +1,5 @@ +from typing import Any + +class Parser: + def __init__(self) -> None: ... + def parse(self, source: Any, sink: Any) -> None: ... diff --git a/mypy-stubs/rdflib/paths.pyi b/mypy-stubs/rdflib/paths.pyi new file mode 100644 index 00000000..9bea1795 --- /dev/null +++ b/mypy-stubs/rdflib/paths.pyi @@ -0,0 +1,24 @@ +from collections.abc import Generator +from typing import Any, Callable, Union + +from rdflib.term import Node as Node +from rdflib.term import URIRef as URIRef + +ZeroOrMore: str +OneOrMore: str +ZeroOrOne: str + +class Path: + __or__: Callable[[Path, Union["URIRef", "Path"]], "AlternativePath"] + __invert__: Callable[[Path], "InvPath"] + __neg__: Callable[[Path], "NegatedPath"] + __truediv__: Callable[[Path, Union["URIRef", "Path"]], "SequencePath"] + __mul__: Callable[[Path, str], "MulPath"] + def __hash__(self) -> int: ... + def __lt__(self, other: Any) -> bool: ... + +class InvPath(Path): ... +class SequencePath(Path): ... +class AlternativePath(Path): ... +class MulPath(Path): ... +class NegatedPath(Path): ... diff --git a/mypy-stubs/rdflib/plugin.pyi b/mypy-stubs/rdflib/plugin.pyi new file mode 100644 index 00000000..d6f840d4 --- /dev/null +++ b/mypy-stubs/rdflib/plugin.pyi @@ -0,0 +1,8 @@ +from typing import Any, Type, TypeVar + +def register(name: str, kind: Any, module_path: str, class_name: str) -> None: ... + +PluginT = TypeVar("PluginT") + +def get(name: str, kind: Type[PluginT]) -> Type[PluginT]: ... +def plugins(name: Any | None = ..., kind: Any | None = ...) -> None: ... diff --git a/typeshed/2and3/rdflib/plugins/__init__.pyi b/mypy-stubs/rdflib/plugins/__init__.pyi similarity index 99% rename from typeshed/2and3/rdflib/plugins/__init__.pyi rename to mypy-stubs/rdflib/plugins/__init__.pyi index e856e17d..fc4e2d17 100644 --- a/typeshed/2and3/rdflib/plugins/__init__.pyi +++ b/mypy-stubs/rdflib/plugins/__init__.pyi @@ -1,4 +1,3 @@ # Stubs for rdflib.plugins (Python 3.5) # # NOTE: This dynamically typed stub was automatically generated by stubgen. - diff --git a/typeshed/2and3/rdflib/plugins/parsers/__init__.pyi b/mypy-stubs/rdflib/plugins/parsers/__init__.pyi similarity index 99% rename from typeshed/2and3/rdflib/plugins/parsers/__init__.pyi rename to mypy-stubs/rdflib/plugins/parsers/__init__.pyi index 3f187100..589759a0 100644 --- a/typeshed/2and3/rdflib/plugins/parsers/__init__.pyi +++ b/mypy-stubs/rdflib/plugins/parsers/__init__.pyi @@ -1,4 +1,3 @@ # Stubs for rdflib.plugins.parsers (Python 3.5) # # NOTE: This dynamically typed stub was automatically generated by stubgen. - diff --git a/mypy-stubs/rdflib/plugins/parsers/notation3.pyi b/mypy-stubs/rdflib/plugins/parsers/notation3.pyi new file mode 100644 index 00000000..40932a78 --- /dev/null +++ b/mypy-stubs/rdflib/plugins/parsers/notation3.pyi @@ -0,0 +1 @@ +class BadSyntax(SyntaxError): ... diff --git a/mypy-stubs/rdflib/query.pyi b/mypy-stubs/rdflib/query.pyi new file mode 100644 index 00000000..981fe12d --- /dev/null +++ b/mypy-stubs/rdflib/query.pyi @@ -0,0 +1,42 @@ +from typing import IO, Any, Dict, Iterator, List, Mapping, Optional, Tuple, overload + +from rdflib import URIRef, Variable +from rdflib.term import Identifier +from typing_extensions import SupportsIndex + +class ResultRow(Tuple["Identifier", ...]): + def __new__( + cls, values: Mapping[Variable, Identifier], labels: List[Variable] + ) -> ResultRow: ... + def __getattr__(self, name: str) -> Identifier: ... + @overload + def __getitem__(self, name: str) -> Identifier: ... + @overload + def __getitem__(self, __x: SupportsIndex) -> Identifier: ... + @overload + def __getitem__(self, __x: slice) -> Tuple[Identifier, ...]: ... + def get(self, name: str, default: Any | None = ...) -> Identifier: ... + def asdict(self) -> Dict[str, Identifier]: ... + +class Result: + type: Any + vars: Any + askAnswer: Any + graph: Any + def __init__(self, type_: str) -> None: ... + bindings: Any + def __iter__(self) -> Iterator[bool | ResultRow]: ... + @staticmethod + def parse( + source: IO[Any] | None = ..., + format: str | None = ..., + content_type: str | None = ..., + **kwargs: Any, + ) -> Result: ... + def serialize( + self, + destination: str | IO[Any] | None = ..., + encoding: str = ..., + format: str = ..., + **args: Any, + ) -> Optional[bytes]: ... diff --git a/mypy-stubs/rdflib/resource.pyi b/mypy-stubs/rdflib/resource.pyi new file mode 100644 index 00000000..e520dbe6 --- /dev/null +++ b/mypy-stubs/rdflib/resource.pyi @@ -0,0 +1,33 @@ +from typing import Any, Iterable, Iterator, Tuple + +from _typeshed import Incomplete +from rdflib.graph import Graph, Seq +from rdflib.term import Node + +class Resource: + def __init__(self, graph: Graph, subject: Node) -> None: ... + graph: Incomplete + identifier: Incomplete + def add(self, p: Node, o: Node) -> None: ... + def remove(self, p: Node, o: Node | None = ...) -> None: ... + def set(self, p: Node, o: Node) -> None: ... + def subjects(self, predicate: Any | None = ...) -> Iterable[Node]: ... + def predicates(self, o: Incomplete | None = ...) -> Iterable[Node]: ... + def objects(self, predicate: Any | None = ...) -> Iterable[Node]: ... + def subject_predicates(self) -> Iterator[Tuple[Node, Node]]: ... + def subject_objects(self) -> Iterator[Tuple[Node, Node]]: ... + def predicate_objects(self) -> Iterator[Tuple[Node, Node]]: ... + def value( + self, p: Node, o: Node | None = ..., default: Any | None = ..., any: bool = ... + ) -> Any: ... + def label(self) -> Any: ... + def comment(self) -> Any: ... + def items(self) -> Iterator[Any]: ... + def transitive_objects( + self, predicate: Node, remember: Any | None = ... + ) -> Iterator[Any]: ... + def transitive_subjects( + self, predicate: Node, remember: Any | None = ... + ) -> Iterator[Any]: ... + def seq(self) -> Seq | None: ... + def qname(self) -> Any: ... diff --git a/mypy-stubs/rdflib/term.pyi b/mypy-stubs/rdflib/term.pyi new file mode 100644 index 00000000..0830bdc2 --- /dev/null +++ b/mypy-stubs/rdflib/term.pyi @@ -0,0 +1,43 @@ +from typing import Any, Callable, Union + +class Node: ... + +class Identifier(Node, str): + def __new__(cls, value: Union[Any, str, None]) -> "Identifier": ... + def eq(self, other: Any) -> bool: ... + def neq(self, other: Any) -> bool: ... + +class IdentifiedNode(Identifier): ... + +class URIRef(IdentifiedNode): + def toPython(self) -> str: ... + def n3(self, namespace_manager: Any | None = ...) -> str: ... + def defrag(self) -> "URIRef": ... + def de_skolemize(self) -> "BNode": ... + +class Genid(URIRef): ... +class RDFLibGenid(Genid): ... + +class BNode(IdentifiedNode): + def toPython(self) -> str: ... + def n3(self, namespace_manager: Any | None = ...) -> str: ... + def skolemize( + self, authority: Any | None = ..., basepath: Any | None = ... + ) -> "RDFLibGenid": ... + +class Literal(Identifier): + def normalize(self) -> "Literal": ... + @property + def value(self) -> Any: ... + @property + def language(self) -> str | None: ... + @property + def datatype(self) -> Any: ... + def eq(self, other: Any) -> bool: ... + def neq(self, other: Any) -> bool: ... + def n3(self, namespace_manager: Any | None = ...) -> str: ... + def toPython(self) -> str: ... + +class Variable(Identifier): + def toPython(self) -> str: ... + def n3(self, namespace_manager: Any | None = ...) -> str: ... diff --git a/cwltest/tests/test-data/return-0.cwl b/mypy-stubs/ruamel/__init__.pyi similarity index 100% rename from cwltest/tests/test-data/return-0.cwl rename to mypy-stubs/ruamel/__init__.pyi diff --git a/mypy.ini b/mypy.ini index 2d48495f..11917ac7 100644 --- a/mypy.ini +++ b/mypy.ini @@ -1,25 +1,10 @@ [mypy] -# --strict options as of mypy 0.720 -warn_unused_configs = True -disallow_subclassing_any = True -disallow_any_generics = True -disallow_untyped_calls = True -disallow_untyped_defs = True -disallow_incomplete_defs = True -check_untyped_defs = True -disallow_untyped_decorators = True -no_implicit_optional = True -warn_redundant_casts = True -warn_unused_ignores = True -warn_return_any = True -implicit_reexport = True - -[mypy-schema_salad.tests.*] -ignore_errors = True +strict = True +show_error_context = true +show_column_numbers = true +show_error_codes = true +pretty = true +warn_unreachable = True [mypy-ruamel.*] ignore_errors = True - -[mypy-cwltest.tests.*] -ignore_errors = True - diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..da2775fb --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,72 @@ +[build-system] +requires = [ + "setuptools>=61.2", + "setuptools_scm>=8.0.4,<10", +] +build-backend = "setuptools.build_meta" + +[project] +name = "cwltest" +authors = [{name = "Common workflow language working group", email = "common-workflow-language@googlegroups.com"}] +license = {text = "Apache 2.0"} +description = "Common Workflow Language testing framework" +classifiers = [ + "Environment :: Console", + "Framework :: Pytest", + "License :: OSI Approved :: Apache Software License", + "Operating System :: POSIX", + "Operating System :: MacOS :: MacOS X", + "Development Status :: 5 - Production/Stable", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", + "Typing :: Typed", +] +requires-python = ">=3.9,<3.15" +dynamic = ["version", "dependencies"] + +[project.readme] +file = "README.rst" +content-type = "text/x-rst" + +[project.urls] +Homepage = "https://github.com/common-workflow-language/cwltest" +Download = "https://github.com/common-workflow-language/cwltest" + +[project.entry-points.pytest11] +cwl = "cwltest.plugin" + +[project.optional-dependencies] +pytest-plugin = ["pytest"] + +[project.scripts] +cwltest = "cwltest.main:main" + +[tool.aliases] +test = "pytest" + +[tool.setuptools] +package-dir = {"cwltest.tests" = "tests"} +packages = ["cwltest", "cwltest.tests"] +zip-safe = true +include-package-data = true + +[tool.setuptools.package-data] +cwltest = ["py.typed"] +tests = ["test-data/*"] + +[tool.setuptools.dynamic] +dependencies = {file = ["requirements.txt"]} + +[tool.isort] +multi_line_output = "3" +include_trailing_comma = "True" +force_grid_wrap = "0" +use_parentheses = "True" +line_length = "88" + +[tool.setuptools_scm] +write_to = "cwltest/_version.py" diff --git a/release-test.sh b/release-test.sh index a44e7c32..1eb6004e 100755 --- a/release-test.sh +++ b/release-test.sh @@ -3,86 +3,96 @@ set -e set -x +export LC_ALL=C + package=cwltest module=cwltest -slug=${TRAVIS_PULL_REQUEST_SLUG:=common-workflow-language/${module}} -repo=https://github.com/${slug}.git -run_tests="bin/py.test --pyargs ${module}" -pipver=18 # minimum required version of pip -setupver=40.3 # minimum required version of setuptools -PYVER=${PYVER:=3} +extras="" + +if [ "$GITHUB_ACTIONS" = "true" ]; then + # We are running as a GH Action + repo=${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git + HEAD=${GITHUB_REF} +else + repo=https://github.com/common-workflow-language/cwltest.git + HEAD=$(git rev-parse HEAD) +fi +run_tests="bin/py.test -p pytester --pyargs ${module}" +pipver=23.1 # minimum required version of pip for Python 3.12 +setuptoolsver=67.6.1 # required for Python 3.12 +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )" -rm -Rf "testenv${PYVER}_"? || /bin/true +rm -Rf testenv? || /bin/true -export HEAD=${TRAVIS_PULL_REQUEST_SHA:-$(git rev-parse HEAD)} if [ "${RELEASE_SKIP}" != "head" ] then - virtualenv "testenv${PYVER}_1" -p "python${PYVER}" + python3 -m venv testenv1 # First we test the head # shellcheck source=/dev/null - source "testenv${PYVER}_1/bin/activate" - rm -f "testenv${PYVER}_1/lib/python-wheels/setuptools"* - pip install --force-reinstall -U pip==${pipver} - pip install setuptools==${setupver} wheel - make install-dependencies + source testenv1/bin/activate + rm -Rf testenv1/local + rm -f testenv1/lib/python-wheels/setuptools* \ + && pip install --force-reinstall -U pip==${pipver} \ + && pip install setuptools==${setuptoolsver} wheel + pip install -rtest-requirements.txt ".${extras}" make test - pip uninstall -y ${package} || true; pip uninstall -y ${package} \ - || true; make install - mkdir "testenv${PYVER}_1/not-${module}" + pip uninstall -y ${package} || true; pip uninstall -y ${package} || true; make install + mkdir testenv1/not-${module} # if there is a subdir named '${module}' py.test will execute tests # there instead of the installed module's tests - - pushd "testenv${PYVER}_1/not-${module}" + pushd testenv1/not-${module} # shellcheck disable=SC2086 ../${run_tests}; popd fi - -virtualenv "testenv${PYVER}_2" -p "python${PYVER}" -virtualenv "testenv${PYVER}_3" -p "python${PYVER}" -virtualenv "testenv${PYVER}_4" -p "python${PYVER}" -virtualenv "testenv${PYVER}_5" -p "python${PYVER}" - +python3 -m venv testenv2 +python3 -m venv testenv3 +python3 -m venv testenv4 +python3 -m venv testenv5 +rm -Rf testenv[2345]/local # Secondly we test via pip -pushd "testenv${PYVER}_2" +pushd testenv2 # shellcheck source=/dev/null source bin/activate -rm lib/python-wheels/setuptools* \ +rm -f lib/python-wheels/setuptools* \ && pip install --force-reinstall -U pip==${pipver} \ - && pip install setuptools==${setupver} wheel + && pip install setuptools==${setuptoolsver} wheel # The following can fail if you haven't pushed your commits to ${repo} -pip install -e "git+${repo}@${HEAD}#egg=${package}" +pip install -e "git+${repo}@${HEAD}#egg=${package}${extras}" pushd src/${package} -make install-dependencies +pip install -rtest-requirements.txt build make dist make test -cp dist/${package}*tar.gz "../../../testenv${PYVER}_3/" -cp dist/${module}*whl "../../../testenv${PYVER}_4/" +cp dist/${package}*tar.gz ../../../testenv3/ +cp dist/${module}*whl ../../../testenv4/ pip uninstall -y ${package} || true; pip uninstall -y ${package} || true; make install popd # ../.. no subdir named ${proj} here, safe for py.testing the installed module # shellcheck disable=SC2086 ${run_tests} popd -# Is the source distribution in testenv${PYVER}_2 complete enough to build +# Is the source distribution in testenv2 complete enough to build # another functional distribution? -pushd "testenv${PYVER}_3/" +pushd testenv3/ # shellcheck source=/dev/null source bin/activate -rm lib/python-wheels/setuptools* \ +rm -f lib/python-wheels/setuptools* \ && pip install --force-reinstall -U pip==${pipver} \ - && pip install setuptools==${setupver} wheel -pip install ${package}*tar.gz -pip install pytest\<5 + && pip install setuptools==${setuptoolsver} wheel +package_tar=$(find . -name "${package}*tar.gz") +pip install "-r${DIR}/test-requirements.txt" build +pip install "${package_tar}${extras}" mkdir out tar --extract --directory=out -z -f ${package}*.tar.gz pushd out/${package}* make dist make test +pip install "-r${DIR}/mypy-requirements.txt" +make mypy pip uninstall -y ${package} || true; pip uninstall -y ${package} || true; make install mkdir ../not-${module} pushd ../not-${module} @@ -91,16 +101,16 @@ pushd ../not-${module} popd popd -# Is the wheel in testenv${PYVER}_2 installable and will it pass the tests +# Is the wheel in testenv2 installable and will it pass the tests -pushd "testenv${PYVER}_4/" +pushd testenv4/ # shellcheck source=/dev/null source bin/activate -rm lib/python-wheels/setuptools* \ +rm -f lib/python-wheels/setuptools* \ && pip install --force-reinstall -U pip==${pipver} \ - && pip install setuptools==${setupver} wheel -pip install ${module}*.whl -pip install pytest\<5 + && pip install setuptools==${setuptoolsver} wheel +pip install "$(ls ${module}*.whl)${extras}" +pip install "-r${DIR}/test-requirements.txt" mkdir not-${module} pushd not-${module} # shellcheck disable=SC2086 diff --git a/requirements.txt b/requirements.txt index 672abb0e..832cc529 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,4 @@ -schema-salad >= 5.0.20200220195218, <8 +schema-salad >= 5.0.20200220195218, < 9 junit-xml >= 1.8 -pytest < 6 +pytest >= 7, < 9 +defusedxml diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 6c900c54..00000000 --- a/setup.cfg +++ /dev/null @@ -1,10 +0,0 @@ -[flake8] -ignore = E124,E128,E129,E201,E202,E225,E226,E231,E265,E271,E302,E303,F401,E402,E501,W503,E731,F811,F821,F841 - -[easy_install] - -[tool:pytest] -testpaths = cwltest/tests - -[aliases] -test=pytest diff --git a/setup.py b/setup.py deleted file mode 100755 index 58663c65..00000000 --- a/setup.py +++ /dev/null @@ -1,50 +0,0 @@ -#!/usr/bin/env python3 -import os -import sys - -import setuptools.command.egg_info as egg_info_cmd -from setuptools import setup - -SETUP_DIR = os.path.dirname(__file__) -README = os.path.join(SETUP_DIR, "README.rst") - -try: - import gittaggers - - tagger = gittaggers.EggInfoFromGit -except ImportError: - tagger = egg_info_cmd.egg_info - -install_requires = ["schema-salad >= 5.0.20200220195218, < 8", "junit-xml >= 1.8"] - -needs_pytest = {"pytest", "test", "ptr"}.intersection(sys.argv) -pytest_runner = ["pytest < 6", "pytest-runner < 5"] if needs_pytest else [] - -setup( - name="cwltest", - version="2.0", - description="Common workflow language testing framework", - long_description=open(README).read(), - long_description_content_type="text/x-rst", - author="Common workflow language working group", - author_email="common-workflow-language@googlegroups.com", - url="https://github.com/common-workflow-language/cwltest", - download_url="https://github.com/common-workflow-language/cwltest", - license="Apache 2.0", - packages=["cwltest", "cwltest.tests"], - package_data={"cwltest.tests": ["test-data/*"]}, - include_package_data=True, - install_requires=install_requires, - test_suite="tests", - setup_requires=[] + pytest_runner, - tests_require=["pytest<5"], - entry_points={ - "console_scripts": [ - "cwltest=cwltest:main", - "mock-cwl-runner=cwltest.tests.mock_cwl_runner:main", - ] - }, - zip_safe=True, - cmdclass={"egg_info": tagger}, - python_requires=">=3.5, <4", -) diff --git a/test-requirements.txt b/test-requirements.txt new file mode 100644 index 00000000..c186dac4 --- /dev/null +++ b/test-requirements.txt @@ -0,0 +1,5 @@ +cwlref-runner +cwltool +pytest >= 7, < 9 +pytest-cov +pytest-xdist diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 00000000..198807df --- /dev/null +++ b/tests/__init__.py @@ -0,0 +1 @@ +"""Tests for cwltest.""" diff --git a/tests/test-data/badgedir.yaml b/tests/test-data/badgedir.yaml new file mode 100644 index 00000000..ea6e5514 --- /dev/null +++ b/tests/test-data/badgedir.yaml @@ -0,0 +1,39 @@ +- output: {} + job: empty.yml + tool: return-0.cwl + id: success_w_job + doc: Successful test with a job file + tags: [ command_line_tool ] + +- output: {} + tool: return-0.cwl + id: success_wo_job + doc: Successful test without a job file + tags: [ command_line_tool ] + +- output: {} + job: empty.yml + tool: return-1.cwl + id: failure_w_job + doc: Failed test with a job file + tags: [ command_line_tool ] + +- output: {} + tool: return-1.cwl + id: failure_wo_job + doc: Failed test without a job file + tags: [ command_line_tool ] + +- output: {} + job: empty.yml + tool: return-unsupported.cwl + id: unsupported_w_job + doc: Unsupported test with a job file + tags: [ command_line_tool ] + +- output: {} + job: null + tool: return-unsupported.cwl + id: unsupported_wo_job + doc: Unsupported test without a job file + tags: [ command_line_tool ] diff --git a/tests/test-data/conformance_test_v1.0.cwltest.yml b/tests/test-data/conformance_test_v1.0.cwltest.yml new file mode 100644 index 00000000..75f70860 --- /dev/null +++ b/tests/test-data/conformance_test_v1.0.cwltest.yml @@ -0,0 +1,17 @@ +- output: + args: [cat, hello.txt] + job: v1.0/cat-job.json + tool: v1.0/cat1-testcli.cwl + label: cl_optional_inputs_missing + id: 4 + doc: Test command line with optional input (missing) + tags: [ required, command_line_tool ] + +- output: + args: [cat, -n, hello.txt] + job: v1.0/cat-n-job.json + tool: v1.0/cat1-testcli.cwl + label: cl_optional_bindings_provided + id: 5 + doc: Test command line with optional input (provided) + tags: [ command_line_tool ] \ No newline at end of file diff --git a/tests/test-data/conformance_test_v1.2.cwltest.yaml b/tests/test-data/conformance_test_v1.2.cwltest.yaml new file mode 100644 index 00000000..3f7a6059 --- /dev/null +++ b/tests/test-data/conformance_test_v1.2.cwltest.yaml @@ -0,0 +1,21 @@ +- output: + args: [cat, hello.txt] + job: v1.0/cat-job.json + tool: v1.0/cat1-testcli.cwl + id: cl_optional_inputs_missing + doc: Test command line with optional input (missing) + tags: [ required, command_line_tool ] + +- output: + args: [cat, -n, hello.txt] + job: v1.0/cat-n-job.json + tool: v1.0/cat1-testcli.cwl + id: cl_optional_bindings_provided + doc: Test command line with optional input (provided) + tags: [ command_line_tool ] + +- tool: v1.0/null-expression2-tool.cwl + should_fail: true + id: expression_any_nodefaultany + doc: Test Any without defaults cannot be unspecified. + tags: [ required, inline_javascript, expression_tool ] diff --git a/cwltest/tests/test-data/cores.txt b/tests/test-data/cores.txt similarity index 100% rename from cwltest/tests/test-data/cores.txt rename to tests/test-data/cores.txt diff --git a/tests/test-data/cwltool-conftest.py b/tests/test-data/cwltool-conftest.py new file mode 100644 index 00000000..061b9943 --- /dev/null +++ b/tests/test-data/cwltool-conftest.py @@ -0,0 +1,37 @@ +""" +Example configuration for pytest-cwl plugin using cwltool directly. + +Calls cwltool via Python, instead of a subprocess via `--cwl-runner cwltool`. +""" +import json +from io import StringIO +from typing import Any, Dict, List, Optional, Tuple + +from cwltest import utils + + +def pytest_cwl_execute_test( + config: utils.CWLTestConfig, + processfile: str, + jobfile: Optional[str] +) -> Tuple[int, Optional[Dict[str, Any]]]: + """Use the CWL reference runner (cwltool) to execute tests.""" + from cwltool import main + from cwltool.errors import WorkflowException + + stdout = StringIO() + argsl: List[str] = [f"--outdir={config.outdir}"] + if config.runner_quiet: + argsl.append("--quiet") + elif config.verbose: + argsl.append("--debug") + argsl.extend(config.args) + argsl.append(processfile) + if jobfile: + argsl.append(jobfile) + try: + result = main.main(argsl=argsl, stdout=stdout) + except WorkflowException: + return 1, {} + out = stdout.getvalue() + return result, json.loads(out) if out else {} diff --git a/tests/test-data/dummy-executor.sh b/tests/test-data/dummy-executor.sh new file mode 100755 index 00000000..ca3a674e --- /dev/null +++ b/tests/test-data/dummy-executor.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +echo "it is not JSON format!" diff --git a/tests/test-data/empty.yml b/tests/test-data/empty.yml new file mode 100644 index 00000000..0967ef42 --- /dev/null +++ b/tests/test-data/empty.yml @@ -0,0 +1 @@ +{} diff --git a/tests/test-data/exclude-tags.yml b/tests/test-data/exclude-tags.yml new file mode 100644 index 00000000..106d5c2b --- /dev/null +++ b/tests/test-data/exclude-tags.yml @@ -0,0 +1,24 @@ +- job: v1.0/cat-job.json + output: {} + tool: return-0.cwl + doc: | + Test with + label + id: opt-error1 + tags: [ command_line_tool ] +- job: v1.0/cat-job.json + id: opt-error2 + output: {} + tool: return-0.cwl + doc: | + Test without + label + tags: [ command_line_tool, workflow ] +- job: v1.0/cat-job.json + id: opt-error3 + output: {} + tool: return-0.cwl + doc: | + Test without + label + tags: [ workflow ] diff --git a/tests/test-data/integer-id.yml b/tests/test-data/integer-id.yml new file mode 100644 index 00000000..8223cef8 --- /dev/null +++ b/tests/test-data/integer-id.yml @@ -0,0 +1,5 @@ +- job: v1.0/cat1-job.json + output: {} + tool: return-0.cwl + doc: Test with an integer id + id: 1 diff --git a/cwltest/tests/mock_cwl_runner.py b/tests/test-data/mock_cwl_runner.py old mode 100644 new mode 100755 similarity index 61% rename from cwltest/tests/mock_cwl_runner.py rename to tests/test-data/mock_cwl_runner.py index a352f7d3..98d668ed --- a/cwltest/tests/mock_cwl_runner.py +++ b/tests/test-data/mock_cwl_runner.py @@ -1,15 +1,21 @@ +#!/usr/bin/env python3 +"""Mock implementation of the cwlref-runner command line.""" + import argparse +import sys +from time import sleep from cwltest import UNSUPPORTED_FEATURE UNSUPPORTED_FEATURE_TOOL = "return-unsupported.cwl" ERROR_TOOL = "return-1.cwl" +TIMEOUT_TOOL = "timeout.cwl" -def main(): # type: ()->int +def main() -> int: parser = argparse.ArgumentParser() parser.add_argument("processfile") - parser.add_argument("jobfile") + parser.add_argument("jobfile", nargs='?', default=None) parser.add_argument("--version", action="https://github.com/version", version="%(prog)s 1.0") parser.add_argument("--outdir") parser.add_argument("--quiet", action="https://github.com/store_true") @@ -20,6 +26,11 @@ def main(): # type: ()->int exit(UNSUPPORTED_FEATURE) elif args.processfile.endswith(ERROR_TOOL): exit(1) + elif args.processfile.endswith(TIMEOUT_TOOL): + print("timeout stderr", file=sys.stderr) + sys.stderr.flush() + sleep(100000) + exit(1) exit(0) diff --git a/tests/test-data/multi-lined-doc.yml b/tests/test-data/multi-lined-doc.yml new file mode 100644 index 00000000..af219287 --- /dev/null +++ b/tests/test-data/multi-lined-doc.yml @@ -0,0 +1,15 @@ +- job: v1.0/cat-job.json + output: {} + tool: return-0.cwl + doc: | + Test with + label + label: opt-error + tags: [ js, init_work_dir ] +- job: v1.0/cat-job.json + output: {} + tool: return-0.cwl + doc: | + Test without + label + tags: [ js, init_work_dir ] diff --git a/tests/test-data/nothing.yml b/tests/test-data/nothing.yml new file mode 100644 index 00000000..1e860a71 --- /dev/null +++ b/tests/test-data/nothing.yml @@ -0,0 +1,10 @@ +- job: empty.yml + tool: true.cwl + output: {} + id: do_nothing + doc: Example of doing nothing +- job: empty.yml + tool: true.cwl + output: {} + id: do_nothing2 + doc: Example of doing nothing more diff --git a/cwltest/tests/test-data/optional-error.yml b/tests/test-data/optional-error.yml similarity index 100% rename from cwltest/tests/test-data/optional-error.yml rename to tests/test-data/optional-error.yml diff --git a/cwltest/tests/test-data/optional-unsupported.yml b/tests/test-data/optional-unsupported.yml similarity index 100% rename from cwltest/tests/test-data/optional-unsupported.yml rename to tests/test-data/optional-unsupported.yml diff --git a/cwltest/tests/test-data/required-unsupported.yml b/tests/test-data/required-unsupported.yml similarity index 100% rename from cwltest/tests/test-data/required-unsupported.yml rename to tests/test-data/required-unsupported.yml diff --git a/cwltest/tests/test-data/return-1.cwl b/tests/test-data/return-0.cwl similarity index 100% rename from cwltest/tests/test-data/return-1.cwl rename to tests/test-data/return-0.cwl diff --git a/cwltest/tests/test-data/return-unsupported.cwl b/tests/test-data/return-1.cwl similarity index 100% rename from cwltest/tests/test-data/return-unsupported.cwl rename to tests/test-data/return-1.cwl diff --git a/cwltest/tests/test-data/v1.0/cat-job.json b/tests/test-data/return-unsupported.cwl similarity index 100% rename from cwltest/tests/test-data/v1.0/cat-job.json rename to tests/test-data/return-unsupported.cwl diff --git a/cwltest/tests/test-data/short-names.yml b/tests/test-data/short-names.yml similarity index 100% rename from cwltest/tests/test-data/short-names.yml rename to tests/test-data/short-names.yml diff --git a/tests/test-data/string-id.yml b/tests/test-data/string-id.yml new file mode 100644 index 00000000..0fd21eb3 --- /dev/null +++ b/tests/test-data/string-id.yml @@ -0,0 +1,5 @@ +- job: v1.0/cat1-job.json + output: {} + tool: return-0.cwl + doc: Test with a string label + id: test-string-id diff --git a/tests/test-data/timeout.cwl b/tests/test-data/timeout.cwl new file mode 100644 index 00000000..a487298f --- /dev/null +++ b/tests/test-data/timeout.cwl @@ -0,0 +1,5 @@ +class: CommandLineTool +cwlVersion: v1.0 +inputs: [] +outputs: [] +baseCommand: [sleep, "15"] diff --git a/tests/test-data/timeout.yml b/tests/test-data/timeout.yml new file mode 100644 index 00000000..30231d68 --- /dev/null +++ b/tests/test-data/timeout.yml @@ -0,0 +1,9 @@ +- job: v1.0/empty.json + output: + output_txt: + class: File + checksum: sha1$47a013e660d408619d894b20806b1d5086aab03b + location: output.txt + size: 13 + tool: timeout.cwl + doc: Test of timeout stdout and stderr capture diff --git a/tests/test-data/true.cwl b/tests/test-data/true.cwl new file mode 100644 index 00000000..f8e5e7a6 --- /dev/null +++ b/tests/test-data/true.cwl @@ -0,0 +1,5 @@ +class: CommandLineTool +cwlVersion: v1.0 +inputs: {} +outputs: {} +baseCommand: ["true"] diff --git a/tests/test-data/v1.0/args.py b/tests/test-data/v1.0/args.py new file mode 100644 index 00000000..190fd5c6 --- /dev/null +++ b/tests/test-data/v1.0/args.py @@ -0,0 +1,7 @@ +#!/usr/bin/env python +import sys +import json +import os +args = [os.path.basename(a) for a in sys.argv[1:]] +with open("cwl.output.json", "w") as f: + json.dump({"args": args}, f) \ No newline at end of file diff --git a/tests/test-data/v1.0/cat-job.json b/tests/test-data/v1.0/cat-job.json new file mode 100644 index 00000000..b4b3b6b5 --- /dev/null +++ b/tests/test-data/v1.0/cat-job.json @@ -0,0 +1,6 @@ +{ + "file1": { + "class": "File", + "location": "hello.txt" + } +} \ No newline at end of file diff --git a/tests/test-data/v1.0/cat-n-job.json b/tests/test-data/v1.0/cat-n-job.json new file mode 100644 index 00000000..77e35374 --- /dev/null +++ b/tests/test-data/v1.0/cat-n-job.json @@ -0,0 +1,7 @@ +{ + "file1": { + "class": "File", + "location": "hello.txt" + }, + "numbering": true +} \ No newline at end of file diff --git a/cwltest/tests/test-data/v1.0/cat1-job.json b/tests/test-data/v1.0/cat1-job.json similarity index 100% rename from cwltest/tests/test-data/v1.0/cat1-job.json rename to tests/test-data/v1.0/cat1-job.json diff --git a/tests/test-data/v1.0/cat1-testcli.cwl b/tests/test-data/v1.0/cat1-testcli.cwl new file mode 100644 index 00000000..311cd860 --- /dev/null +++ b/tests/test-data/v1.0/cat1-testcli.cwl @@ -0,0 +1,45 @@ +#!/usr/bin/env cwl-runner +{ + "class": "CommandLineTool", + "cwlVersion": "v1.0", + "doc": "Print the contents of a file to stdout using 'cat' running in a docker container.", + "hints": [ + { + "class": "DockerRequirement", + "dockerPull": "python:2-slim" + }, + { + "class": "ResourceRequirement", + "ramMin": 128 + } + ], + "inputs": [ + { + "id": "file1", + "type": "File", + "inputBinding": {"position": 1} + }, + { + "id": "numbering", + "type": ["null", "boolean"], + "inputBinding": { + "position": 0, + "prefix": "-n" + } + }, + { + id: "args.py", + type: File, + default: { + class: File, + location: args.py + }, + inputBinding: { + position: -1 + } + } + ], + "outputs": [{"id": "args", "type": "string[]"}], + "baseCommand": "python", + "arguments": ["cat"] +} \ No newline at end of file diff --git a/cwltest/tests/test-data/v1.0/cat2-job.json b/tests/test-data/v1.0/cat2-job.json similarity index 100% rename from cwltest/tests/test-data/v1.0/cat2-job.json rename to tests/test-data/v1.0/cat2-job.json diff --git a/tests/test-data/v1.0/empty.json b/tests/test-data/v1.0/empty.json new file mode 100644 index 00000000..0967ef42 --- /dev/null +++ b/tests/test-data/v1.0/empty.json @@ -0,0 +1 @@ +{} diff --git a/tests/test-data/v1.0/hello.txt b/tests/test-data/v1.0/hello.txt new file mode 100644 index 00000000..6769dd60 --- /dev/null +++ b/tests/test-data/v1.0/hello.txt @@ -0,0 +1 @@ +Hello world! \ No newline at end of file diff --git a/tests/test-data/v1.0/null-expression2-tool.cwl b/tests/test-data/v1.0/null-expression2-tool.cwl new file mode 100644 index 00000000..2b09ec04 --- /dev/null +++ b/tests/test-data/v1.0/null-expression2-tool.cwl @@ -0,0 +1,14 @@ +#!/usr/bin/env cwl-runner + +class: ExpressionTool +requirements: + - class: InlineJavascriptRequirement +cwlVersion: v1.2 + +inputs: + i1: Any + +outputs: + output: int + +expression: "$({'output': (inputs.i1 == 'the-default' ? 1 : 2)})" \ No newline at end of file diff --git a/cwltest/tests/test-data/with-and-without-short-names.yml b/tests/test-data/with-and-without-short-names.yml similarity index 100% rename from cwltest/tests/test-data/with-and-without-short-names.yml rename to tests/test-data/with-and-without-short-names.yml diff --git a/tests/test_argparse.py b/tests/test_argparse.py new file mode 100644 index 00000000..948ddd1d --- /dev/null +++ b/tests/test_argparse.py @@ -0,0 +1,13 @@ +from cwltest.argparser import arg_parser + + +def test_arg() -> None: + """Basic test of the argparse.""" + parser = arg_parser() + parsed = parser.parse_args( + ["--test", "test_name", "-n", "52", "--tool", "cwltool", "-j", "4"] + ) + assert parsed.test == "test_name" + assert parsed.n == "52" + assert parsed.tool == "cwltool" + assert parsed.j == 4 diff --git a/tests/test_badgedir.py b/tests/test_badgedir.py new file mode 100644 index 00000000..e1516d6d --- /dev/null +++ b/tests/test_badgedir.py @@ -0,0 +1,107 @@ +import json +import os +from pathlib import Path +from textwrap import dedent + +import schema_salad.ref_resolver + +from .util import get_data, run_with_mock_cwl_runner + + +def test_badgedir(tmp_path: Path) -> None: + badgedir = tmp_path / "badgedir" + + args = [ + "--test", + schema_salad.ref_resolver.file_uri( + get_data("tests/test-data/conformance_test_v1.2.cwltest.yaml") + ), + "--badgedir", + str(badgedir), + ] + cwd = os.getcwd() + try: + os.chdir(get_data("tests/test-data/")) + error_code, stdout, stderr = run_with_mock_cwl_runner(args) + finally: + os.chdir(cwd) + + assert error_code == 1 + required_json = badgedir / "required.json" + assert required_json.exists() + with open(required_json) as file: + obj = json.load(file) + assert obj.get("subject", "") == "required" + assert obj.get("status", "") == "0%" + assert obj.get("color", "") == "red" + + required_md = badgedir / "required.md" + assert required_md.exists() + with open(required_md) as file: + s = file.read() + assert "file://" in s + assert "tests/test-data/conformance_test_v1.2.cwltest.yaml" in s + assert "v1.0/cat-job.json" in s + assert "v1.0/cat1-testcli.cwl" in s + + clt = badgedir / "command_line_tool.json" + assert clt.exists() + with open(clt) as file: + obj = json.load(file) + assert obj.get("subject", "") == "command_line_tool" + assert obj.get("status", "") == "0%" + assert obj.get("color", "") == "yellow" + assert (badgedir / "command_line_tool.md").exists() + + all_tests = badgedir / "all.json" + assert all_tests.exists() + with open(all_tests) as file: + obj = json.load(file) + assert obj.get("subject", "") == "all" + assert obj.get("status", "") == "0%" + assert obj.get("color", "") == "yellow" + assert (badgedir / "all.md").exists() + + +def test_badgedir_report_with_baseuri(tmp_path: Path) -> None: + badgedir = tmp_path / "badgedir" + + baseuri = "https://example.com/specified/uri" + + args = [ + "--test", + schema_salad.ref_resolver.file_uri(get_data("tests/test-data/badgedir.yaml")), + "--badgedir", + str(badgedir), + "--baseuri", + baseuri, + ] + cwd = os.getcwd() + try: + os.chdir(get_data("tests/test-data/")) + error_code, stdout, stderr = run_with_mock_cwl_runner(args) + finally: + os.chdir(cwd) + + clt_md = badgedir / "command_line_tool.md" + assert clt_md.exists() + with open(clt_md) as file: + contents = file.read() + assert contents == markdown_report_with(baseuri) + + +def markdown_report_with(baseuri: str) -> str: + return dedent( + f""" + # `command_line_tool` tests + ## List of passed tests + - [success_w_job]({baseuri}/badgedir.yaml#L0) ([tool]({baseuri}/return-0.cwl), [job]({baseuri}/empty.yml)) + - [success_wo_job]({baseuri}/badgedir.yaml#L7) ([tool]({baseuri}/return-0.cwl)) + ## List of failed tests + - [failure_w_job]({baseuri}/badgedir.yaml#L13) ([tool]({baseuri}/return-1.cwl), [job]({baseuri}/empty.yml)) + - [failure_wo_job]({baseuri}/badgedir.yaml#L20) ([tool]({baseuri}/return-1.cwl)) + ## List of unsupported tests + - [unsupported_w_job]({baseuri}/badgedir.yaml#L26) ([tool]({baseuri}/return-unsupported.cwl), [job]({baseuri}/empty.yml)) + - [unsupported_wo_job]({baseuri}/badgedir.yaml#L33) ([tool]({baseuri}/return-unsupported.cwl)) + """ + )[1:] diff --git a/tests/test_categories.py b/tests/test_categories.py new file mode 100644 index 00000000..ba08407e --- /dev/null +++ b/tests/test_categories.py @@ -0,0 +1,113 @@ +import os +import re +from os import linesep as n +from os import sep as p +from pathlib import Path + +import defusedxml.ElementTree as ET +import schema_salad.ref_resolver + +from .util import get_data, run_with_mock_cwl_runner + + +def test_unsupported_with_required_tests() -> None: + cwl_runner = get_data("tests/test-data/mock_cwl_runner.py") + cwd = os.getcwd() + os.chdir(get_data("tests/test-data/")) + args = ["--test", "required-unsupported.yml"] + try: + error_code, stdout, stderr = run_with_mock_cwl_runner(args) + finally: + os.chdir(cwd) + + assert error_code == 1 + print(stderr) + stderr = re.sub(r" '?--outdir=[^ ]*", "", stderr) + if os.name == "nt": + q = "'" + else: + q = "" + assert ( + f"The `id` field is missing.{n}" + f"The `id` field is missing.{n}" + f"Test [1/2] Required test that is unsupported (without tags){n}" + f"{n}" + f"Test 1 failed: {cwl_runner} --quiet return-unsupported.cwl {q}v1.0{p}cat-job.json{q}{n}" + f"Required test that is unsupported (without tags){n}" + f"Does not support required feature{n}" + f"Test [2/2] Required test that is unsupported (with tags){n}" + f"{n}" + f"Test 2 failed: {cwl_runner} --quiet return-unsupported.cwl {q}v1.0{p}cat-job.json{q}{n}" + f"Required test that is unsupported (with tags){n}" + f"Does not support required feature{n}" + f"0 tests passed, 2 failures, 0 unsupported features{n}" + ) == stderr + + +def test_unsupported_with_optional_tests() -> None: + args = [ + "--test", + schema_salad.ref_resolver.file_uri( + get_data("tests/test-data/optional-unsupported.yml") + ), + ] + error_code, stdout, stderr = run_with_mock_cwl_runner(args) + stderr = re.sub(r" '?--outdir=[^ ]*", "", stderr) + assert error_code == 0 + assert ( + "The `id` field is missing.{n}" + "Test [1/1] Optional test that is unsupported{n}{n}" + "0 tests passed, 1 unsupported " + "features{n}".format(n=n) + ) == stderr + + +def test_error_with_optional_tests() -> None: + args = [ + "--test", + schema_salad.ref_resolver.file_uri( + get_data("tests/test-data/optional-error.yml") + ), + ] + error_code, stdout, stderr = run_with_mock_cwl_runner(args) + assert error_code == 1 + assert "1 failures" in stderr + + +def test_category_in_junit_xml(tmp_path: Path) -> None: + junit_xml_report = tmp_path / "junit-report.xml" + args = [ + "--test", + schema_salad.ref_resolver.file_uri( + get_data("tests/test-data/optional-error.yml") + ), + "--junit-xml", + str(junit_xml_report), + ] + run_with_mock_cwl_runner(args) + tree = ET.parse(junit_xml_report) + assert (root := tree.getroot()) is not None + assert (testsuite_el := root.find("testsuite")) is not None + assert (testcase_el := testsuite_el.find("testcase")) is not None + category = testcase_el.attrib["class"] + assert category == "js, init_work_dir" + + +def test_list_all_tags() -> None: + args = [ + "--test", + schema_salad.ref_resolver.file_uri( + get_data("tests/test-data/conformance_test_v1.2.cwltest.yaml") + ), + "--show-tags", + ] + error_code, stdout, stderr = run_with_mock_cwl_runner(args) + assert error_code == 0, stderr + assert ( + stdout + == """command_line_tool +expression_tool +inline_javascript +required +""" + ) diff --git a/tests/test_compare.py b/tests/test_compare.py new file mode 100644 index 00000000..8149d92c --- /dev/null +++ b/tests/test_compare.py @@ -0,0 +1,592 @@ +import os +from pathlib import Path +from typing import Any + +import pytest + +from cwltest.compare import CompareFail, _compare_directory, _compare_file, compare + +from .util import get_data + + +def test_compare_any_success() -> None: + expected = "Any" + actual: dict[str, Any] = {} + compare(expected, actual) + + +def test_compare_contents_failure() -> None: + expected = { + "location": "cores.txt", + "size": 2, + "class": "File", + "contents": "2", + } + actual = { + "basename": "cores.txt", + "checksum": "sha1$7448d8798a4380162d4b56f9b452e2f6f9e24e7a", + "class": "File", + "location": "file:///var/folders/8x/2df05_7j20j6r8y81w4qf43r0000gn/T/tmpG0EkrS/cores.txt", + "path": get_data("tests/test-data/cores.txt"), + "size": 2, + } + with pytest.raises(CompareFail): + compare(expected, actual) + + +def test_compare_contents_success() -> None: + expected = { + "location": "cores.txt", + "size": 2, + "class": "File", + "contents": "2\n", + "checksum": "sha1$7448d8798a4380162d4b56f9b452e2f6f9e24e7a", + } + actual = { + "basename": "cores.txt", + "checksum": "sha1$7448d8798a4380162d4b56f9b452e2f6f9e24e7a", + "class": "File", + "location": "file:///var/folders/8x/2df05_7j20j6r8y81w4qf43r0000gn/T/tmpG0EkrS/cores.txt", + "path": get_data("tests/test-data/cores.txt"), + "size": 2, + } + compare(expected, actual) + + +def test_compare_contents_not_exist() -> None: + expected = { + "location": "cores.txt", + "class": "File", + } + actual = { + "basename": "cores.txt", + "class": "File", + "location": "file:///var/folders/8x/2df05_7j20j6r8y81w4qf43r0000gn/T/tmpG0EkrS/cores.txt", + "path": "/none/exist/path/to/cores.txt", + "size": 2, + } + with pytest.raises(CompareFail): + _compare_file(expected, actual, False) + + +def test_compare_file_different_size(tmp_path: Path) -> None: + expected = { + "location": "cores.txt", + "size": 2, + "class": "File", + } + + path = tmp_path / "cores.txt" + with open(path, "w") as f: + f.write("hello") + + actual = { + "basename": "cores.txt", + "class": "File", + "location": path.as_uri(), + } + with pytest.raises(CompareFail): + _compare_file(expected, actual, False) + + +def test_compare_file_different_checksum(tmp_path: Path) -> None: + expected = { + "location": "cores.txt", + "class": "File", + "checksum": "sha1$7448d8798a4380162d4b56f9b452e2f6f9e24e7a", + } + + path = tmp_path / "cores.txt" + with open(path, "w") as f: + f.write("hello") + + actual = { + "basename": "cores.txt", + "class": "File", + "location": path.as_uri(), + } + with pytest.raises(CompareFail): + _compare_file(expected, actual, False) + + +def test_compare_file_inconsistent_size(tmp_path: Path) -> None: + expected = { + "location": "cores.txt", + "class": "File", + } + + path = tmp_path / "cores.txt" + with open(path, "w") as f: + f.write("hello") + + actual = { + "basename": "cores.txt", + "class": "File", + "location": path.as_uri(), + "size": 65535, + } + with pytest.raises(CompareFail): + _compare_file(expected, actual, False) + + +def test_compare_file_inconsistent_checksum(tmp_path: Path) -> None: + expected = { + "location": "cores.txt", + "class": "File", + } + + path = tmp_path / "cores.txt" + with open(path, "w") as f: + f.write("hello") + + actual = { + "basename": "cores.txt", + "checksum": "inconsistent-checksum", + "class": "File", + "location": path.as_uri(), + } + with pytest.raises(CompareFail): + _compare_file(expected, actual, False) + + +def test_compare_directory(tmp_path: Path) -> None: + expected = { + "location": "dir", + "class": "Directory", + "listing": [], + } + + path = tmp_path / "dir" + os.makedirs(path) + + actual = { + "class": "Directory", + "location": path.as_uri(), + "listing": [], + } + _compare_directory(expected, actual, False) + + +def test_compare_directory_path(tmp_path: Path) -> None: + expected = { + "location": "dir", + "class": "Directory", + "listing": [], + } + + path = tmp_path / "dir" + os.makedirs(path) + + actual = { + "class": "Directory", + "path": str(path), + "listing": [], + } + _compare_directory(expected, actual, False) + + +def test_compare_directory_success() -> None: + expected = { + "stuff": { + "class": "Directory", + "listing": [ + { + "basename": "baz.txt", + "checksum": "sha1$da39a3ee5e6b4b0d3255bfef95601890afd80709", + "class": "File", + "size": 0, + }, + { + "basename": "foo", + "class": "Directory", + "listing": [ + { + "basename": "bar.txt", + "checksum": "sha1$da39a3ee5e6b4b0d3255bfef95601890afd80709", + "class": "File", + "size": 0, + } + ], + }, + ], + } + } + actual = { + "stuff": { + "class": "Directory", + "listing": [ + { + "basename": "baz.txt", + "checksum": "sha1$da39a3ee5e6b4b0d3255bfef95601890afd80709", + "class": "File", + "size": 0, + }, + { + "basename": "foo", + "class": "Directory", + "listing": [ + { + "basename": "bar.txt", + "checksum": "sha1$da39a3ee5e6b4b0d3255bfef95601890afd80709", + "class": "File", + "size": 0, + } + ], + }, + ], + } + } + compare(expected, actual, skip_details=True) + + +def test_compare_directory_failure_different_listing() -> None: + expected = { + "stuff": { + "class": "Directory", + "listing": [ + { + "basename": "baz.txt", + "checksum": "sha1$da39a3ee5e6b4b0d3255bfef95601890afd80709", + "class": "File", + "size": 0, + }, + { + "basename": "foo", + "class": "Directory", + "listing": [ + { + "basename": "bar.txt", + "checksum": "sha1$da39a3ee5e6b4b0d3255bfef95601890afd80709", + "class": "File", + "size": 0, + } + ], + }, + ], + } + } + actual = { + "stuff": { + "class": "Directory", + "location": "file:///var/folders/8x/2df05_7j20j6r8y81w4qf43r0000gn/T/tmpG0EkrS/stuff", + "path": "/var/folders/8x/2df05_7j20j6r8y81w4qf43r0000gn/T/tmpG0EkrS/stuff", + "listing": [ + { + "basename": "baz.txt", + "checksum": "sha1$da39a3ee5e6b4b0d3255bfef95601890afd80709", + "class": "File", + "location": "file:///var/folders/8x/" + "2df05_7j20j6r8y81w4qf43r0000gn/T/tmpG0EkrS/stuff/baz.txt", + "path": "/var/folders/8x/2df05_7j20j6r8y81w4qf43r0000gn/T/tmpG0EkrS/stuff/baz.txt", + "size": 0, + }, + { + "basename": "foo", + "class": "Directory", + "location": "file:///var/folders/8x/" + "2df05_7j20j6r8y81w4qf43r0000gn/T/tmpG0EkrS/stuff/foo", + "path": "/var/folders/8x/2df05_7j20j6r8y81w4qf43r0000gn/T/tmpG0EkrS/stuff/foo", + "listing": [ + { + "basename": "bar.txt", + "checksum": "sha1$da39a3ee5e6b4b0d3255bfef95601890afd80775", + "class": "File", + "location": "file:///var/folders/8x/" + "2df05_7j20j6r8y81w4qf43r0000gn/T/tmpG0EkrS/stuff/foo/bar.txt", + "path": "/var/folders/8x/" + "2df05_7j20j6r8y81w4qf43r0000gn/T/tmpG0EkrS/stuff/foo/bar.txt", + "size": 0, + } + ], + }, + ], + } + } + with pytest.raises(CompareFail): + compare(expected, actual) + + +def test_compare_directory_failure_no_listing() -> None: + expected = { + "stuff": { + "class": "Directory", + "listing": [ + { + "basename": "baz.txt", + "checksum": "sha1$da39a3ee5e6b4b0d3255bfef95601890afd80709", + "class": "File", + "size": 0, + }, + { + "basename": "foo", + "class": "Directory", + "listing": [ + { + "basename": "bar.txt", + "checksum": "sha1$da39a3ee5e6b4b0d3255bfef95601890afd80709", + "class": "File", + "size": 0, + } + ], + }, + ], + } + } + actual = { + "stuff": { + "class": "Directory", + "location": "file:///var/folders/8x/2df05_7j20j6r8y81w4qf43r0000gn/T/tmpG0EkrS/stuff", + "path": "/var/folders/8x/2df05_7j20j6r8y81w4qf43r0000gn/T/tmpG0EkrS/stuff", + "listing": [ + { + "basename": "baz.txt", + "checksum": "sha1$da39a3ee5e6b4b0d3255bfef95601890afd80709", + "class": "File", + "location": "file:///var/folders/8x/" + "2df05_7j20j6r8y81w4qf43r0000gn/T/tmpG0EkrS/stuff/baz.txt", + "path": "/var/folders/8x/2df05_7j20j6r8y81w4qf43r0000gn/T/tmpG0EkrS/stuff/baz.txt", + "size": 0, + }, + { + "basename": "foo", + "class": "Directory", + "location": "file:///var/folders/8x/2df05_7j20j6r8y81w4qf43r0000gn/T/tmpG0EkrS/stuff/foo", + "path": "/var/folders/8x/2df05_7j20j6r8y81w4qf43r0000gn/T/tmpG0EkrS/stuff/foo", + }, + ], + } + } + with pytest.raises(CompareFail): + compare(expected, actual) + + +def test_compare_file_failure_different() -> None: + expected = { + "location": "cores.txt", + "size": 2, + "class": "File", + "checksum": "sha1$7448d8798a4380162d4b56f9b452e2f6f9e24e7b", + } + actual = { + "basename": "cores.txt", + "checksum": "sha1$7448d8798a4380162d4b56f9b452e2f6f9e24e7a", + "class": "File", + "location": "file:///var/folders/8x/2df05_7j20j6r8y81w4qf43r0000gn/T/tmpG0EkrS/cores.txt", + "path": "/var/folders/8x/2df05_7j20j6r8y81w4qf43r0000gn/T/tmpG0EkrS/cores.txt", + "size": 2, + } + with pytest.raises(CompareFail): + compare(expected, actual) + + +def test_compare_file_failure_none() -> None: + expected = { + "location": "cores.txt", + "size": 2, + "class": "File", + "checksum": "sha1$7448d8798a4380162d4b56f9b452e2f6f9e24e7b", + } + actual: dict[str, Any] = {} + with pytest.raises(CompareFail): + compare(expected, actual) + + +def test_compare_file_success() -> None: + expected = { + "location": "cores.txt", + "size": 2, + "class": "File", + "checksum": "sha1$7448d8798a4380162d4b56f9b452e2f6f9e24e7a", + } + actual = { + "basename": "cores.txt", + "checksum": "sha1$7448d8798a4380162d4b56f9b452e2f6f9e24e7a", + "class": "File", + "location": "file:///var/folders/8x/2df05_7j20j6r8y81w4qf43r0000gn/T/tmpG0EkrS/cores.txt", + "path": "/var/folders/8x/2df05_7j20j6r8y81w4qf43r0000gn/T/tmpG0EkrS/cores.txt", + "size": 2, + } + compare(expected, actual, skip_details=True) + + +def test_compare_list_failure_missing() -> None: + expected = { + "args": [ + "tmap", + "mapall", + "stage1", + "map1", + "--min-seq-length", + "20", + "map2", + "--min-seq-length", + "20", + "stage2", + "map1", + "--max-seq-length", + "20", + "--min-seq-length", + "10", + "--seed-length", + "16", + "map2", + "--max-seed-hits", + "-1", + "--max-seq-length", + "20", + "--min-seq-length", + "10", + ] + } + actual = { + "args": [ + "tmap", + "mapall", + "stage1", + "map1", + "stage2", + "map1", + "--max-seq-length", + "20", + "--min-seq-length", + "10", + "--seed-length", + "16", + "map2", + "--max-seed-hits", + "-1", + "--max-seq-length", + "20", + "--min-seq-length", + "10", + ] + } + with pytest.raises(CompareFail): + compare(expected, actual) + + +def test_compare_list_failure_order() -> None: + expected = { + "args": [ + "tmap", + "mapall", + "stage1", + "map1", + "--min-seq-length", + "20", + "map2", + "--min-seq-length", + "20", + "stage2", + "map1", + "--max-seq-length", + "20", + "--min-seq-length", + "10", + "--seed-length", + "16", + "map2", + "--max-seed-hits", + "-1", + "--max-seq-length", + "20", + "--min-seq-length", + "10", + ] + } + actual = { + "args": [ + "tmap", + "mapall", + "stage1", + "map1", + "--min-seq-length", + "20", + "map2", + "--min-seq-length", + "20", + "stage2", + "map2", + "--max-seed-hits", + "-1", + "--max-seq-length", + "20", + "--min-seq-length", + "10", + "map1", + "--max-seq-length", + "20", + "--min-seq-length", + "10", + "--seed-length", + "16", + ] + } + with pytest.raises(CompareFail): + compare(expected, actual) + + +def test_compare_list_failure_type() -> None: + expected = { + "args": [ + "tmap", + "mapall", + "stage1", + "map1", + "--min-seq-length", + "20", + "map2", + "--min-seq-length", + "20", + "stage2", + "map1", + "--max-seq-length", + "20", + "--min-seq-length", + "10", + "--seed-length", + "16", + "map2", + "--max-seed-hits", + "-1", + "--max-seq-length", + "20", + "--min-seq-length", + "10", + ] + } + actual: dict[str, Any] = {"args": {}} + with pytest.raises(CompareFail): + compare(expected, actual) + + +def test_compare_list_success() -> None: + expected = { + "args": [ + "tmap", + "mapall", + "stage1", + "map1", + "--min-seq-length", + "20", + "map2", + "--min-seq-length", + "20", + "stage2", + "map1", + "--max-seq-length", + "20", + "--min-seq-length", + "10", + "--seed-length", + "16", + "map2", + "--max-seed-hits", + "-1", + "--max-seq-length", + "20", + "--min-seq-length", + "10", + ] + } + compare(expected, expected) diff --git a/tests/test_exclude_tags.py b/tests/test_exclude_tags.py new file mode 100644 index 00000000..f17ae48d --- /dev/null +++ b/tests/test_exclude_tags.py @@ -0,0 +1,30 @@ +from os import linesep as n + +from .util import get_data, run_with_mock_cwl_runner + + +def test_list_only_exclude() -> None: + args = [ + "--test", + get_data("tests/test-data/exclude-tags.yml"), + "-l", + "--exclude-tags=workflow", + ] + error_code, stdout, stderr = run_with_mock_cwl_runner(args) + assert f"[1] opt-error1: Test with label{n}" in stdout + assert "opt-error2" not in stdout + assert "opt-error3" not in stdout + + +def test_list_include_and_exclude() -> None: + args = [ + "--test", + get_data("tests/test-data/exclude-tags.yml"), + "-l", + "--tags=command_line_tool", + "--exclude-tags=workflow", + ] + error_code, stdout, stderr = run_with_mock_cwl_runner(args) + assert f"[1] opt-error1: Test with label{n}" in stdout + assert "opt-error2" not in stdout + assert "opt-error3" not in stdout diff --git a/tests/test_integer_id.py b/tests/test_integer_id.py new file mode 100644 index 00000000..64343e39 --- /dev/null +++ b/tests/test_integer_id.py @@ -0,0 +1,14 @@ +from .util import get_data, run_with_mock_cwl_runner + + +def test_warning_with_integer_id() -> None: + args = [ + "--test", + get_data("tests/test-data/integer-id.yml"), + "-l", + ] + error_code, stdout, stderr = run_with_mock_cwl_runner(args) + assert ( + "The `id` field with integer is deprecated. Use string identifier instead." + in stderr + ) diff --git a/tests/test_invalid_outputs.py b/tests/test_invalid_outputs.py new file mode 100644 index 00000000..d57182d5 --- /dev/null +++ b/tests/test_invalid_outputs.py @@ -0,0 +1,17 @@ +from pathlib import Path + +import schema_salad.ref_resolver + +from .util import get_data, run_with_mock_cwl_runner + + +def test_invalid_outputs(tmp_path: Path) -> None: + args = [ + "--test", + schema_salad.ref_resolver.file_uri(get_data("tests/test-data/nothing.yml")), + ] + error_code, stdout, stderr = run_with_mock_cwl_runner( + args, get_data("tests/test-data/dummy-executor.sh") + ) + assert error_code == 1 + assert "0 tests passed, 2 failures, 0 unsupported features" in stderr diff --git a/tests/test_multi_lined_doc.py b/tests/test_multi_lined_doc.py new file mode 100644 index 00000000..51ba2f97 --- /dev/null +++ b/tests/test_multi_lined_doc.py @@ -0,0 +1,18 @@ +from os import linesep as n + +from .util import get_data, run_with_mock_cwl_runner + + +def test_run() -> None: + args = ["--test", get_data("tests/test-data/multi-lined-doc.yml")] + error_code, stdout, stderr = run_with_mock_cwl_runner(args) + assert "The `label` field is deprecated. Use `id` field instead." in stderr + assert f"Test [1/2] opt-error: Test with label{n}" in stderr + assert f"Test [2/2] Test without label{n}" in stderr + + +def test_list() -> None: + args = ["--test", get_data("tests/test-data/multi-lined-doc.yml"), "-l"] + error_code, stdout, stderr = run_with_mock_cwl_runner(args) + assert f"[1] opt-error: Test with label{n}" in stdout + assert f"[2] Test without label{n}" in stdout diff --git a/tests/test_numeric_id.py b/tests/test_numeric_id.py new file mode 100644 index 00000000..64a21289 --- /dev/null +++ b/tests/test_numeric_id.py @@ -0,0 +1,15 @@ +from os import linesep as n + +from .util import get_data, run_with_mock_cwl_runner + + +def test_include_by_number() -> None: + args = [ + "--test", + get_data("tests/test-data/exclude-tags.yml"), + "-n1", + ] + error_code, stdout, stderr = run_with_mock_cwl_runner(args) + assert f"[1/3] opt-error1: Test with label{n}" in stderr + assert "opt-error2" not in stderr + assert "opt-error3" not in stderr diff --git a/tests/test_plugin.py b/tests/test_plugin.py new file mode 100644 index 00000000..d0e3d0cd --- /dev/null +++ b/tests/test_plugin.py @@ -0,0 +1,156 @@ +import os +import shutil +from pathlib import Path + +import pytest + +from .util import get_data + + +def _load_v1_0_dir(path: Path) -> None: + inner_dir = os.path.join(path.parent, "v1.0") + os.mkdir(inner_dir) + shutil.copy(get_data("tests/test-data/v1.0/cat1-testcli.cwl"), inner_dir) + shutil.copy(get_data("tests/test-data/v1.0/null-expression2-tool.cwl"), inner_dir) + shutil.copy(get_data("tests/test-data/v1.0/cat-job.json"), inner_dir) + shutil.copy(get_data("tests/test-data/v1.0/cat-n-job.json"), inner_dir) + shutil.copy(get_data("tests/test-data/v1.0/hello.txt"), inner_dir) + shutil.copy(get_data("tests/test-data/v1.0/args.py"), inner_dir) + + +def test_include(pytester: pytest.Pytester) -> None: + """Test the pytest plugin using cwltool as cwl-runner.""" + path = pytester.copy_example("conformance_test_v1.0.cwltest.yml") + shutil.copy( + get_data("tests/test-data/cwltool-conftest.py"), path.parent / "conftest.py" + ) + _load_v1_0_dir(path) + result = pytester.runpytest( + "-k", + "conformance_test_v1.0.cwltest.yml", + "--cwl-include", + "cl_optional_inputs_missing", + ) + result.assert_outcomes(passed=1, skipped=1) + + +def test_exclude(pytester: pytest.Pytester) -> None: + """Test the pytest plugin using cwltool as cwl-runner.""" + path = pytester.copy_example("conformance_test_v1.0.cwltest.yml") + shutil.copy( + get_data("tests/test-data/cwltool-conftest.py"), path.parent / "conftest.py" + ) + _load_v1_0_dir(path) + result = pytester.runpytest( + "-k", + "conformance_test_v1.0.cwltest.yml", + "--cwl-exclude", + "cl_optional_inputs_missing,cl_optional_bindings_provided", + ) + result.assert_outcomes(passed=0, skipped=2) + + +def test_tags(pytester: pytest.Pytester) -> None: + """Test the pytest plugin using cwltool as cwl-runner.""" + path = pytester.copy_example("conformance_test_v1.0.cwltest.yml") + shutil.copy( + get_data("tests/test-data/cwltool-conftest.py"), path.parent / "conftest.py" + ) + _load_v1_0_dir(path) + result = pytester.runpytest( + "-k", "conformance_test_v1.0.cwltest.yml", "--cwl-tags", "required" + ) + result.assert_outcomes(passed=1, skipped=1) + + +def test_exclude_tags(pytester: pytest.Pytester) -> None: + """Test the pytest plugin using cwltool as cwl-runner.""" + path = pytester.copy_example("conformance_test_v1.0.cwltest.yml") + shutil.copy( + get_data("tests/test-data/cwltool-conftest.py"), path.parent / "conftest.py" + ) + _load_v1_0_dir(path) + result = pytester.runpytest( + "-k", + "conformance_test_v1.0.cwltest.yml", + "--cwl-exclude-tags", + "command_line_tool", + ) + result.assert_outcomes(skipped=2) + + +def test_badgedir(pytester: pytest.Pytester) -> None: + """Test the pytest plugin creates the badges directory.""" + path = pytester.copy_example("conformance_test_v1.0.cwltest.yml") + shutil.copy( + get_data("tests/test-data/cwltool-conftest.py"), path.parent / "conftest.py" + ) + _load_v1_0_dir(path) + badge_path = path.parent / "cwl-badges" + assert not badge_path.exists() + result = pytester.runpytest_inprocess( + "-k", "conformance_test_v1.0.cwltest.yml", "--cwl-badgedir", str(badge_path) + ) + result.assert_outcomes(passed=2) + assert badge_path.exists() + assert (badge_path / "command_line_tool.json").exists() + assert (badge_path / "command_line_tool.md").exists() + assert (badge_path / "required.json").exists() + assert (badge_path / "required.md").exists() + + +def test_badgedir_xdist(pytester: pytest.Pytester) -> None: + """Test the pytest plugin creates the badges directory even with xdist.""" + path = pytester.copy_example("conformance_test_v1.0.cwltest.yml") + shutil.copy( + get_data("tests/test-data/cwltool-conftest.py"), path.parent / "conftest.py" + ) + _load_v1_0_dir(path) + badge_path = path.parent / "cwl-badges" + assert not badge_path.exists() + result = pytester.runpytest_inprocess( + "-n", + "2", + "-k", + "conformance_test_v1.0.cwltest.yml", + "--cwl-badgedir", + str(badge_path), + ) + result.assert_outcomes(passed=2) + assert badge_path.exists() + assert (badge_path / "command_line_tool.json").exists() + assert (badge_path / "command_line_tool.md").exists() + assert (badge_path / "required.json").exists() + assert (badge_path / "required.md").exists() + + +def test_no_label(pytester: pytest.Pytester) -> None: + """Test the pytest plugin correctly extracts test names from the id field when label is missing.""" + path = pytester.copy_example("conformance_test_v1.2.cwltest.yaml") + shutil.copy( + get_data("tests/test-data/cwltool-conftest.py"), path.parent / "conftest.py" + ) + _load_v1_0_dir(path) + result = pytester.runpytest( + "-k", "conformance_test_v1.2.cwltest.yaml", "--cwl-tags", "required" + ) + result.assert_outcomes(passed=2, skipped=1) + + +def test_cwltool_hook(pytester: pytest.Pytester) -> None: + """Test the pytest plugin using cwltool as cwl-runner.""" + path = pytester.copy_example("conformance_test_v1.0.cwltest.yml") + shutil.copy( + get_data("tests/test-data/cwltool-conftest.py"), path.parent / "conftest.py" + ) + _load_v1_0_dir(path) + result = pytester.runpytest("-k", "conformance_test_v1.0.cwltest.yml") + result.assert_outcomes(passed=2) + + +def test_no_hook(pytester: pytest.Pytester) -> None: + """Test the pytest plugin using the default cwl-runner.""" + path = pytester.copy_example("conformance_test_v1.0.cwltest.yml") + _load_v1_0_dir(path) + result = pytester.runpytest("-k", "conformance_test_v1.0.cwltest.yml") + result.assert_outcomes(passed=2) diff --git a/tests/test_prepare.py b/tests/test_prepare.py new file mode 100644 index 00000000..8112ef6d --- /dev/null +++ b/tests/test_prepare.py @@ -0,0 +1,28 @@ +"""Test prepare_test_command()""" + +import os + +from cwltest import utils + + +def test_unix_relative_path() -> None: + """Confirm unix style to windows style path corrections.""" + command = utils.prepare_test_command( + tool="cwl-runner", + args=[], + testargs=None, + test={ + "doc": "General test of command line generation", + "output": {"args": ["echo"]}, + "tool": "v1.0/bwa-mem-tool.cwl", + "job": "v1.0/bwa-mem-job.json", + "tags": ["required"], + }, + cwd=os.getcwd(), + ) + if os.name == "nt": + assert command[3] == "v1.0\\bwa-mem-tool.cwl" + assert command[4] == "v1.0\\bwa-mem-job.json" + else: + assert command[3] == "v1.0/bwa-mem-tool.cwl" + assert command[4] == "v1.0/bwa-mem-job.json" diff --git a/tests/test_short_names.py b/tests/test_short_names.py new file mode 100644 index 00000000..fbd2f19e --- /dev/null +++ b/tests/test_short_names.py @@ -0,0 +1,54 @@ +from os import linesep as n +from pathlib import Path + +import defusedxml.ElementTree as ET + +from .util import get_data, run_with_mock_cwl_runner + + +def test_stderr_output() -> None: + args = ["--test", get_data("tests/test-data/short-names.yml")] + error_code, stdout, stderr = run_with_mock_cwl_runner(args) + assert f"Test [1/1] opt-error: Test with a short name{n}" in stderr + + +def test_run_by_short_name() -> None: + short_name = "opt-error" + args = [ + "--test", + get_data("tests/test-data/with-and-without-short-names.yml"), + "-s", + short_name, + ] + error_code, stdout, stderr = run_with_mock_cwl_runner(args) + assert "Test [2/2] opt-error: Test with a short name" in stderr + assert "Test [1/2]" not in stderr + + +def test_list_tests() -> None: + args = [ + "--test", + get_data("tests/test-data/with-and-without-short-names.yml"), + "-l", + ] + error_code, stdout, stderr = run_with_mock_cwl_runner(args) + assert ( + f"[1] Test without a short name{n}" f"[2] opt-error: Test with a short name{n}" + ) in stdout + + +def test_short_name_in_junit_xml(tmp_path: Path) -> None: + junit_xml_report = tmp_path / "junit-report.xml" + args = [ + "--test", + get_data("tests/test-data/short-names.yml"), + "--junit-xml", + str(junit_xml_report), + ] + run_with_mock_cwl_runner(args) + tree = ET.parse(junit_xml_report) + assert (root := tree.getroot()) is not None + assert (testsuite_el := root.find("testsuite")) is not None + assert (testcase_el := testsuite_el.find("testcase")) is not None + category = testcase_el.attrib["file"] + assert category == "opt-error" diff --git a/tests/test_string_id.py b/tests/test_string_id.py new file mode 100644 index 00000000..8a9eb1f0 --- /dev/null +++ b/tests/test_string_id.py @@ -0,0 +1,9 @@ +from os import linesep as n + +from .util import get_data, run_with_mock_cwl_runner + + +def test_list() -> None: + args = ["--test", get_data("tests/test-data/string-id.yml"), "-l"] + error_code, stdout, stderr = run_with_mock_cwl_runner(args) + assert f"[1] test-string-id: Test with a string label{n}" in stdout diff --git a/tests/test_timeout.py b/tests/test_timeout.py new file mode 100644 index 00000000..ad852197 --- /dev/null +++ b/tests/test_timeout.py @@ -0,0 +1,43 @@ +import os +from pathlib import Path + +import defusedxml.ElementTree as ET +import schema_salad.ref_resolver + +from .util import get_data, run_with_mock_cwl_runner + + +def test_timeout_stderr_stdout(tmp_path: Path) -> None: + junit_xml_report = tmp_path / "junit-report.xml" + + args = [ + "--test", + schema_salad.ref_resolver.file_uri(get_data("tests/test-data/timeout.yml")), + "--timeout", + "5", + "--junit-xml", + str(junit_xml_report), + ] + cwd = os.getcwd() + try: + os.chdir(get_data("tests/test-data/")) + error_code, stdout, stderr = run_with_mock_cwl_runner(args) + finally: + os.chdir(cwd) + + assert error_code == 1 + assert "Test 1 timed out" in stderr + tree = ET.parse(junit_xml_report) + try: + assert (root := tree.getroot()) is not None + assert (testsuite_el := root.find("testsuite")) is not None + assert (testcase_el := testsuite_el.find("testcase")) is not None + assert (failure_el := testcase_el.find("failure")) is not None + timeout_text = failure_el.text + assert timeout_text is not None and "Test timed out" in timeout_text + assert (system_err_el := testcase_el.find("system-err")) is not None + timeout_stderr = system_err_el.text + assert timeout_stderr is not None and "timeout stderr" in timeout_stderr + except AttributeError as e: + print(junit_xml_report.read_text()) + raise e diff --git a/tests/util.py b/tests/util.py new file mode 100644 index 00000000..937b777c --- /dev/null +++ b/tests/util.py @@ -0,0 +1,43 @@ +"""Test functions.""" + +import atexit +import os +import subprocess # nosec +from contextlib import ExitStack +from importlib.resources import as_file, files +from pathlib import Path +from typing import Optional + + +def get_data(filename: str) -> str: + """Return the absolute path starting from a file name.""" + filename = os.path.normpath(filename) + # normalizing path depending on OS or else it will cause problem when + # joining path + filepath = None + try: + file_manager = ExitStack() + atexit.register(file_manager.close) + traversable = files("cwltest") / filename + filepath = file_manager.enter_context(as_file(traversable)) + except ModuleNotFoundError: + pass + if not filepath or not os.path.isfile(filepath): + filepath = Path(os.path.dirname(__file__)) / ".." / filename + return str(filepath.resolve()) + + +def run_with_mock_cwl_runner( + args: list[str], cwl_runner: Optional[str] = None +) -> tuple[int, str, str]: + """Bind a mock cwlref-runner implementation to cwltest.""" + if cwl_runner is None: + cwl_runner = get_data("tests/test-data/mock_cwl_runner.py") + process = subprocess.Popen( # nosec + ["cwltest", "--tool", cwl_runner] + args, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + ) + + stdout, stderr = process.communicate() + return process.returncode, stdout.decode(), stderr.decode() diff --git a/tox.ini b/tox.ini index 179e6408..5bb9fae3 100644 --- a/tox.ini +++ b/tox.ini @@ -1,77 +1,93 @@ [tox] envlist = - py{36,37,38}-lint, - py{35,36,37,38}-unit, - py{35,36,37,38}-mypy, - py37-pipconflictchecker, - py37-lint-readme, - py37-pydocstyle + py3{9,10,11,12,13,14}-lint, + py3{9,10,11,12,13,14}-unit, + py3{9,10,11,12,13,14}-bandit, + py3{9,10,11,12,13,14}-mypy, + py312-lintreadme, + py312-pydocstyle -skipsdist = True skip_missing_interpreters = True +isolated_build = True -[travis] -os = - linux: py35-{unit,mypy}, py{36,38}-{lint,unit,mypy}, py37-{unit,mypy,pipconflictchecker,lint-readme,pydocstyle} - osx: py{35,36,38}-{unit,mypy}, py37-{unit,mypy} +[pytest] +addopts = -p pytester -n auto +pytester_example_dir = tests/test-data +testpaths = tests + +[gh-actions] python = - 3.4: py34 - 3.5: py35 - 3.6: py36 - 3.7: py37 - 3.8: py38 + 3.9: py39 + 3.10: py310 + 3.11: py311 + 3.12: py312 + 3.13: py313 + 3.14: py314 [testenv] +skipsdist = + py3{9,10,11,12,13,14}-!{unit,mypy,lintreadme} = True + +description = + py3{9,10,11,12,13,14}-unit: Run the unit tests + py3{9,10,11,12,13,14}-lint: Lint the Python code + py3{9,10,11,12,13,14}-bandit: Search for common security issues + py3{9,10,11,12,13,14}-mypy: Check for type safety + py313-pydocstyle: docstring style checker + py313-lintreadme: Lint the README.rst->.md conversion + passenv = CI - TRAVIS - TRAVIS_* + GITHUB_* + deps = - -rrequirements.txt - py{35,36,37,38}-unit: codecov - py{35,36,37,38}-unit: pytest-xdist - py{35,36,37,38}-unit: pytest-cov - py{36,37,38}-lint: flake8 - py{35,36,37,38}-mypy: mypy==0.782 + py3{9,10,11,12,13,14}-{unit,mypy}: -rrequirements.txt + py3{9,10,11,12,13,14}-{unit,mypy}: -rtest-requirements.txt + py3{9,10,11,12,13,14}-lint: flake8-bugbear + py3{9,10,11,12,13,14}-lint: black~=23.1 + py3{9,10,11,12,13,14}-bandit: bandit + py3{9,10,11,12,13,14}-mypy: -rmypy-requirements.txt -setenv = - py{35,36,37,38}-unit: LC_ALL = C +set_env = + py3{9,10,11,12,13,14}-unit: LC_ALL = C.UTF-8 + COV_CORE_SOURCE=cwltest + COV_CORE_CONFIG={toxinidir}/.coveragerc + COV_CORE_DATAFILE={toxinidir}/.coverage.eager commands = - py{35,36,37,38}-unit: python -m pip install -U pip setuptools wheel - py{35,36,37,38}-unit: python -m pip install -e . - py{35,36,37,38}-unit: coverage run --parallel-mode -m pytest --strict {posargs} - py{35,36,37,38}-unit: coverage combine - py{35,36,37,38}-unit: coverage report - py{35,36,37,38}-unit: coverage xml - py{35,36,37,38}-unit: codecov --file coverage.xml - py{36,37,38}-lint: flake8 cwltest setup.py - py{35,36,37,38}-mypy: make mypy + py3{9,10,11,12,13,14}-unit: python -m pip install -U pip setuptools wheel + py3{9,10,11,12,13,14}-unit: python -m pytest --cov --cov-config={toxinidir}/.coveragerc --cov-append {posargs} + py3{9,10,11,12,13,14}-unit: coverage xml + py3{9,10,11,12,13,14}-bandit: bandit --recursive cwltest + py3{9,10,11,12,13,14}-lint: make flake8 + py3{9,10,11,12,13,14}-lint: make format-check + py3{9,10,11,12,13,14}-mypy: make mypy -whitelist_externals = - py{36,37,38}-lint: flake8 - py{35,36,37,38}-mypy: make +allowlist_externals = + py3{9,10,11,12,13,14}-lint: flake8 + py3{9,10,11,12,13,14}-lint: black + py3{9,10,11,12,13,14}-{mypy,shellcheck,lint,unit}: make -[testenv:py37-pipconflictchecker] -commands = pipconflictchecker -whitelist_externals = pipconflictchecker -deps = - pip-conflict-checker - pip==9.0.3 +skip_install = + py3{9,10,11,12,13,14}-lint: true + py3{9,10,11,12,13,14}-bandit: true -[testenv:py37-lint-readme] -commands = - python setup.py sdist - python setup.py bdist_wheel - twine check dist/* -deps = - twine - wheel - readme_renderer[md] -[testenv:py37-pydocstyle] -whitelist_externals = make +[testenv:py313-pydocstyle] +allowlist_externals = make commands = make diff_pydocstyle_report deps = pydocstyle diff-cover +skip_install = true + +[testenv:py313-lintreadme] +description = Lint the README.rst->.md conversion +commands = + python -m build --outdir dist + twine check dist/* +deps = + twine + build + readme_renderer[rst] +skip_install = true diff --git a/travis/os_install.sh b/travis/os_install.sh deleted file mode 100644 index 13366997..00000000 --- a/travis/os_install.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash - -if [[ $TRAVIS_OS_NAME == 'linux' ]]; then - echo No special install needed on Linux - #wget -O- http://neuro.debian.net/lists/trusty.us-nh.full | sudo tee /etc/apt/sources.list.d/neurodebian.sources.list; - #sudo apt-key add .travis.singularity_key.txt; - #sudo apt-get update; - #sudo apt-get install -y singularity-container; -elif [[ $TRAVIS_OS_NAME == "osx" ]]; then - pyenv install $PYENV_VERSION -s; - eval "$(pyenv init -)"; - pyenv global $PYENV_VERSION; - pip install -U virtualenv; - VIRTUAL_ENV="$HOME/ve-pyenv-$PYENV_VERSION"; - virtualenv -p "$(which python)" ${VIRTUALENV_EXTRA_ARGS:-} "$VIRTUAL_ENV"; - source "$VIRTUAL_ENV/bin/activate"; -fi diff --git a/typeshed/2and3/avro/__init__.pyi b/typeshed/2and3/avro/__init__.pyi deleted file mode 100644 index 39efba5a..00000000 --- a/typeshed/2and3/avro/__init__.pyi +++ /dev/null @@ -1,10 +0,0 @@ -# Stubs for avro (Python 2) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -# Names in __all__ with no definition: -# datafile -# io -# ipc -# protocol -# schema diff --git a/typeshed/2and3/avro/schema.pyi b/typeshed/2and3/avro/schema.pyi deleted file mode 100644 index 05f48e51..00000000 --- a/typeshed/2and3/avro/schema.pyi +++ /dev/null @@ -1,117 +0,0 @@ -# Stubs for avro.schema (Python 2) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any, Union, Dict, List, Text - -PRIMITIVE_TYPES = ... # type: Any -NAMED_TYPES = ... # type: Any -VALID_TYPES = ... # type: Any -SCHEMA_RESERVED_PROPS = ... # type: Any -FIELD_RESERVED_PROPS = ... # type: Any -VALID_FIELD_SORT_ORDERS = ... # type: Any - -class AvroException(Exception): ... -class SchemaParseException(AvroException): ... - -class Schema: - type = ... # type: Any - def __init__(self, type, other_props=None): ... - props = ... # type: Any - other_props = ... # type: Any - def get_prop(self, key): ... - def set_prop(self, key, value): ... - def to_json(self, names): ... - -class Name: - def __init__(self, name_attr, space_attr, default_space): ... - def __eq__(self, other): ... - fullname = ... # type: Any - def get_space(self): ... - -class Names: - names = ... # type: Any - default_namespace = ... # type: Any - def __init__(self, default_namespace: Union[str, Text] = None) -> None: ... - def has_name(self, name_attr: Union[str, Text], space_attr: Union[str, Text]) -> bool: ... - def get_name(self, name_attr: Union[str, Text], space_attr: Union[str, Text]) -> Schema: ... - def prune_namespace(self, properties): ... - def add_name(self, name_attr, space_attr, new_schema): ... - -class NamedSchema(Schema): - def __init__(self, type, name, namespace=None, names=None, other_props=None): ... - def name_ref(self, names): ... - name = ... # type: Any - namespace = ... # type: Any - fullname = ... # type: Any - -class Field: - type = ... # type: Any - name = ... # type: Any - def __init__(self, type, name, has_default, default=None, order=None, names=None, doc=None, other_props=None): ... - default = ... # type: Any - has_default = ... # type: Any - order = ... # type: Any - doc = ... # type: Any - props = ... # type: Any - other_props = ... # type: Any - def get_prop(self, key): ... - def set_prop(self, key, value): ... - def to_json(self, names=None): ... - def __eq__(self, that): ... - -class PrimitiveSchema(Schema): - fullname = ... # type: Any - def __init__(self, type, other_props=None): ... - def to_json(self, names=None): ... - def __eq__(self, that): ... - -class FixedSchema(NamedSchema): - def __init__(self, name, namespace, size, names=None, other_props=None): ... - size = ... # type: Any - def to_json(self, names=None): ... - def __eq__(self, that): ... - -class EnumSchema(NamedSchema): - def __init__(self, name, namespace, symbols, names=None, doc=None, other_props=None): ... - symbols = ... # type: Any - doc = ... # type: Any - def to_json(self, names=None): ... - def __eq__(self, that): ... - -class ArraySchema(Schema): - def __init__(self, items, names=None, other_props=None): ... - items = ... # type: Any - def to_json(self, names=None): ... - def __eq__(self, that): ... - -class MapSchema(Schema): - def __init__(self, values, names=None, other_props=None): ... - values = ... # type: Any - def to_json(self, names=None): ... - def __eq__(self, that): ... - -class UnionSchema(Schema): - def __init__(self, schemas, names=None): ... - schemas = ... # type: Any - def to_json(self, names=None): ... - def __eq__(self, that): ... - -class ErrorUnionSchema(UnionSchema): - def __init__(self, schemas, names=None): ... - def to_json(self, names=None): ... - -class RecordSchema(NamedSchema): - @staticmethod - def make_field_objects(field_data, names): ... - def __init__(self, name, namespace, fields, names=None, schema_type='', doc=None, other_props=None): ... - fields = ... # type: Any - doc = ... # type: Any - @property - def fields_dict(self): ... - def to_json(self, names=None): ... - def __eq__(self, that): ... - -def get_other_props(all_props, reserved_props): ... -def make_avsc_object(json_data: Union[Dict, List, str], names: Names) -> Schema: ... -def parse(json_string): ... diff --git a/typeshed/2and3/cachecontrol/adapter.pyi b/typeshed/2and3/cachecontrol/adapter.pyi deleted file mode 100644 index 734fe144..00000000 --- a/typeshed/2and3/cachecontrol/adapter.pyi +++ /dev/null @@ -1,19 +0,0 @@ -# Stubs for cachecontrol.adapter (Python 2) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any -from requests.adapters import HTTPAdapter -from .controller import CacheController as CacheController -from .cache import DictCache as DictCache -from .filewrapper import CallbackFileWrapper as CallbackFileWrapper - -class CacheControlAdapter(HTTPAdapter): - invalidating_methods = ... # type: Any - cache = ... # type: Any - heuristic = ... # type: Any - controller = ... # type: Any - def __init__(self, cache=None, cache_etags=True, controller_class=None, serializer=None, heuristic=None, *args, **kw): ... - def send(self, request, **kw): ... - def build_response(self, request, response, from_cache=False): ... - def close(self): ... diff --git a/typeshed/2and3/cachecontrol/cache.pyi b/typeshed/2and3/cachecontrol/cache.pyi deleted file mode 100644 index c4f507b4..00000000 --- a/typeshed/2and3/cachecontrol/cache.pyi +++ /dev/null @@ -1,19 +0,0 @@ -# Stubs for cachecontrol.cache (Python 2) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any - -class BaseCache: - def get(self, key): ... - def set(self, key, value): ... - def delete(self, key): ... - def close(self): ... - -class DictCache(BaseCache): - lock = ... # type: Any - data = ... # type: Any - def __init__(self, init_dict=None): ... - def get(self, key): ... - def set(self, key, value): ... - def delete(self, key): ... diff --git a/typeshed/2and3/cachecontrol/caches/file_cache.pyi b/typeshed/2and3/cachecontrol/caches/file_cache.pyi deleted file mode 100644 index 2d6ca0c5..00000000 --- a/typeshed/2and3/cachecontrol/caches/file_cache.pyi +++ /dev/null @@ -1,22 +0,0 @@ -# Stubs for cachecontrol.caches.file_cache (Python 2) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any, Callable -from ..cache import BaseCache as BaseCache -from ..controller import CacheController as CacheController - -class FileCache(BaseCache): - directory = ... # type: str - forever = ... # type: bool - filemode = ... # type: str - dirmode = ... # type: str - lock_class = ... # type: Callable - def __init__(self, directory: str, forever=False, filemode=384, dirmode=448, use_dir_lock=None, lock_class=None) -> None: ... - @staticmethod - def encode(x): ... - def get(self, key): ... - def set(self, key, value): ... - def delete(self, key): ... - -def url_to_file_path(url, filecache): ... diff --git a/typeshed/2and3/cachecontrol/controller.pyi b/typeshed/2and3/cachecontrol/controller.pyi deleted file mode 100644 index 1161e797..00000000 --- a/typeshed/2and3/cachecontrol/controller.pyi +++ /dev/null @@ -1,25 +0,0 @@ -# Stubs for cachecontrol.controller (Python 2) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any -#from .cache import DictCache as DictCache -#from .serialize import Serializer as Serializer - -logger = ... # type: Any -URI = ... # type: Any - -def parse_uri(uri): ... - -class CacheController: - cache = ... # type: Any - cache_etags = ... # type: Any - serializer = ... # type: Any - def __init__(self, cache=None, cache_etags=True, serializer=None): ... - @classmethod - def cache_url(https://github.com/cls,%20uri): ... - def parse_cache_control(self, headers): ... - def cached_request(self, request): ... - def conditional_headers(self, request): ... - def cache_response(self, request, response, body=None): ... - def update_cached_response(self, request, response): ... diff --git a/typeshed/2and3/cachecontrol/filewrapper.pyi b/typeshed/2and3/cachecontrol/filewrapper.pyi deleted file mode 100644 index d21df150..00000000 --- a/typeshed/2and3/cachecontrol/filewrapper.pyi +++ /dev/null @@ -1,8 +0,0 @@ -# Stubs for cachecontrol.filewrapper (Python 2) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -class CallbackFileWrapper: - def __init__(self, fp, callback): ... - def __getattr__(self, name): ... - def read(self, amt=None): ... diff --git a/typeshed/2and3/cachecontrol/serialize.pyi b/typeshed/2and3/cachecontrol/serialize.pyi deleted file mode 100644 index a0f9eec8..00000000 --- a/typeshed/2and3/cachecontrol/serialize.pyi +++ /dev/null @@ -1,10 +0,0 @@ -# Stubs for cachecontrol.serialize (Python 2) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from .compat import HTTPResponse as HTTPResponse, pickle as pickle, text_type as text_type - -class Serializer: - def dumps(self, request, response, body=None): ... - def loads(self, request, data): ... - def prepare_response(self, request, cached): ... diff --git a/typeshed/2and3/cachecontrol/wrapper.pyi b/typeshed/2and3/cachecontrol/wrapper.pyi deleted file mode 100644 index 67ef6b4e..00000000 --- a/typeshed/2and3/cachecontrol/wrapper.pyi +++ /dev/null @@ -1,14 +0,0 @@ -# Stubs for cachecontrol.wrapper (Python 2) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Optional, Union -from .adapter import CacheControlAdapter as CacheControlAdapter -from .cache import DictCache, BaseCache -import requests - -def CacheControl(sess: requests.sessions.Session, - cache: Optional[Union[DictCache, BaseCache]] = None, - cache_etags: bool = True, - serializer=None, - heuristic=None) -> requests.sessions.Session: ... diff --git a/typeshed/2and3/future/utils/__init__.pyi b/typeshed/2and3/future/utils/__init__.pyi deleted file mode 100644 index a67c2a13..00000000 --- a/typeshed/2and3/future/utils/__init__.pyi +++ /dev/null @@ -1,61 +0,0 @@ -# Stubs for future.utils (Python 3) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any, Optional - -PY3: Any -PY2: Any -PY26: Any -PYPY: Any - -def python_2_unicode_compatible(cls): ... -def with_metaclass(meta: Any, *bases: Any): ... -def bstr(s: Any): ... -def bord(s: Any): ... - -def tobytes(s: Any): ... -def native_str_to_bytes(s: Any, encoding: str = ...): ... -def bytes_to_native_str(b: Any, encoding: str = ...): ... -def text_to_native_str(t: Any, encoding: Optional[Any] = ...): ... -def lrange(*args: Any, **kwargs: Any): ... -def lzip(*args: Any, **kwargs: Any): ... -def lmap(*args: Any, **kwargs: Any): ... -def lfilter(*args: Any, **kwargs: Any): ... - -def isidentifier(s: Any, dotted: bool = ...): ... -def viewitems(obj: Any, **kwargs: Any): ... -def viewkeys(obj: Any, **kwargs: Any): ... -def viewvalues(obj: Any, **kwargs: Any): ... -def iteritems(obj: Any, **kwargs: Any): ... -def iterkeys(obj: Any, **kwargs: Any): ... -def itervalues(obj: Any, **kwargs: Any): ... -def bind_method(cls, name: Any, func: Any) -> None: ... -def getexception(): ... -def raise_(tp: Any, value: Optional[Any] = ..., tb: Optional[Any] = ...) -> None: ... -def raise_from(exc: Any, cause: Any) -> None: ... -def raise_with_traceback(exc: Any, traceback: Any = ...) -> None: ... -reraise = raise_ - -def implements_iterator(cls): ... - -get_next: Any - -def encode_filename(filename: Any): ... -def is_new_style(cls): ... -native_str = str -native_bytes = bytes - -def istext(obj: Any): ... -def isbytes(obj: Any): ... -def isnewbytes(obj: Any): ... -def isint(obj: Any): ... -def native(obj: Any): ... - -exec_: Any - -def old_div(a: Any, b: Any): ... -def as_native_str(encoding: str = ...): ... -def listvalues(d: Any): ... -def listitems(d: Any): ... -def ensure_new_type(obj: Any): ... diff --git a/typeshed/2and3/galaxy/__init__.pyi b/typeshed/2and3/galaxy/__init__.pyi deleted file mode 100644 index aa2f6e6e..00000000 --- a/typeshed/2and3/galaxy/__init__.pyi +++ /dev/null @@ -1,13 +0,0 @@ -# Stubs for galaxy (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any - -PROJECT_NAME = ... # type: str -PROJECT_OWNER = ... # type: str -PROJECT_USERAME = ... # type: str -PROJECT_URL = ... # type: str -PROJECT_AUTHOR = ... # type: str -PROJECT_EMAIL = ... # type: str -RAW_CONTENT_URL = ... # type: Any diff --git a/typeshed/2and3/galaxy/exceptions/__init__.pyi b/typeshed/2and3/galaxy/exceptions/__init__.pyi deleted file mode 100644 index e59ac087..00000000 --- a/typeshed/2and3/galaxy/exceptions/__init__.pyi +++ /dev/null @@ -1,143 +0,0 @@ -# Stubs for galaxy.exceptions (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any, Optional -from ..exceptions import error_codes as error_codes - -class MessageException(Exception): - status_code = ... # type: int - err_code = ... # type: Any - err_msg = ... # type: Any - type = ... # type: Any - extra_error_info = ... # type: Any - def __init__(self, err_msg: Optional[Any] = ..., type: str = ..., **extra_error_info) -> None: ... - -class ItemDeletionException(MessageException): ... -class ObjectInvalid(Exception): ... - -class ActionInputError(MessageException): - status_code = ... # type: int - err_code = ... # type: Any - def __init__(self, err_msg, type: str = ...) -> None: ... - -class DuplicatedSlugException(MessageException): - status_code = ... # type: int - err_code = ... # type: Any - -class DuplicatedIdentifierException(MessageException): - status_code = ... # type: int - err_code = ... # type: Any - -class ObjectAttributeInvalidException(MessageException): - status_code = ... # type: int - err_code = ... # type: Any - -class ObjectAttributeMissingException(MessageException): - status_code = ... # type: int - err_code = ... # type: Any - -class MalformedId(MessageException): - status_code = ... # type: int - err_code = ... # type: Any - -class MalformedContents(MessageException): - status_code = ... # type: int - err_code = ... # type: Any - -class UnknownContentsType(MessageException): - status_code = ... # type: int - err_code = ... # type: Any - -class RequestParameterMissingException(MessageException): - status_code = ... # type: int - err_code = ... # type: Any - -class ToolMetaParameterException(MessageException): - status_code = ... # type: int - err_code = ... # type: Any - -class ToolMissingException(MessageException): - status_code = ... # type: int - err_code = ... # type: Any - -class RequestParameterInvalidException(MessageException): - status_code = ... # type: int - err_code = ... # type: Any - -class AuthenticationFailed(MessageException): - status_code = ... # type: int - err_code = ... # type: Any - -class AuthenticationRequired(MessageException): - status_code = ... # type: int - err_code = ... # type: Any - -class ItemAccessibilityException(MessageException): - status_code = ... # type: int - err_code = ... # type: Any - -class ItemOwnershipException(MessageException): - status_code = ... # type: int - err_code = ... # type: Any - -class ConfigDoesNotAllowException(MessageException): - status_code = ... # type: int - err_code = ... # type: Any - -class InsufficientPermissionsException(MessageException): - status_code = ... # type: int - err_code = ... # type: Any - -class AdminRequiredException(MessageException): - status_code = ... # type: int - err_code = ... # type: Any - -class ObjectNotFound(MessageException): - status_code = ... # type: int - err_code = ... # type: Any - -class DeprecatedMethod(MessageException): - status_code = ... # type: int - err_code = ... # type: Any - -class Conflict(MessageException): - status_code = ... # type: int - err_code = ... # type: Any - -class ConfigurationError(Exception): - status_code = ... # type: int - err_code = ... # type: Any - -class InconsistentDatabase(MessageException): - status_code = ... # type: int - err_code = ... # type: Any - -class InternalServerError(MessageException): - status_code = ... # type: int - err_code = ... # type: Any - -class NotImplemented(MessageException): - status_code = ... # type: int - err_code = ... # type: Any - -class ContainerCLIError(Exception): - stdout = ... # type: Any - stderr = ... # type: Any - returncode = ... # type: Any - command = ... # type: Any - subprocess_command = ... # type: Any - def __init__(self, msg: Optional[Any] = ..., stdout: Optional[Any] = ..., stderr: Optional[Any] = ..., returncode: Optional[Any] = ..., command: Optional[Any] = ..., subprocess_command: Optional[Any] = ..., **kwargs) -> None: ... - -class ContainerNotFound(Exception): - container_id = ... # type: Any - def __init__(self, msg: Optional[Any] = ..., container_id: Optional[Any] = ..., **kwargs) -> None: ... - -class ContainerImageNotFound(Exception): - image = ... # type: Any - def __init__(self, msg: Optional[Any] = ..., image: Optional[Any] = ..., **kwargs) -> None: ... - -class ContainerRunError(Exception): - image = ... # type: Any - command = ... # type: Any - def __init__(self, msg: Optional[Any] = ..., image: Optional[Any] = ..., command: Optional[Any] = ..., **kwargs) -> None: ... diff --git a/typeshed/2and3/galaxy/exceptions/error_codes.pyi b/typeshed/2and3/galaxy/exceptions/error_codes.pyi deleted file mode 100644 index b25ca3e9..00000000 --- a/typeshed/2and3/galaxy/exceptions/error_codes.pyi +++ /dev/null @@ -1,17 +0,0 @@ -# Stubs for galaxy.exceptions.error_codes (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any - -UNKNOWN_ERROR_MESSAGE = ... # type: str - -class ErrorCode: - code = ... # type: Any - default_error_message = ... # type: Any - def __init__(self, code, default_error_message) -> None: ... - def __int__(self): ... - -error_codes_json = ... # type: Any -name = ... # type: Any -error_code_obj = ... # type: Any diff --git a/typeshed/2and3/galaxy/jobs/__init__.pyi b/typeshed/2and3/galaxy/jobs/__init__.pyi deleted file mode 100644 index c65cfb4e..00000000 --- a/typeshed/2and3/galaxy/jobs/__init__.pyi +++ /dev/null @@ -1,4 +0,0 @@ -# Stubs for galaxy.jobs (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - diff --git a/typeshed/2and3/galaxy/jobs/metrics/__init__.pyi b/typeshed/2and3/galaxy/jobs/metrics/__init__.pyi deleted file mode 100644 index 758ddc67..00000000 --- a/typeshed/2and3/galaxy/jobs/metrics/__init__.pyi +++ /dev/null @@ -1,38 +0,0 @@ -# Stubs for galaxy.jobs.metrics (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any, Optional -from ..metrics import formatting as formatting - -log = ... # type: Any -DEFAULT_FORMATTER = ... # type: Any - -class JobMetrics: - plugin_classes = ... # type: Any - default_job_instrumenter = ... # type: Any - job_instrumenters = ... # type: Any - def __init__(self, conf_file: Optional[Any] = ..., **kwargs) -> None: ... - def format(self, plugin, key, value): ... - def set_destination_conf_file(self, destination_id, conf_file): ... - def set_destination_conf_element(self, destination_id, element): ... - def set_destination_instrumenter(self, destination_id, job_instrumenter: Optional[Any] = ...): ... - def collect_properties(self, destination_id, job_id, job_directory): ... - -class NullJobInstrumenter: - def pre_execute_commands(self, job_directory): ... - def post_execute_commands(self, job_directory): ... - def collect_properties(self, job_id, job_directory): ... - -NULL_JOB_INSTRUMENTER = ... # type: Any - -class JobInstrumenter: - extra_kwargs = ... # type: Any - plugin_classes = ... # type: Any - plugins = ... # type: Any - def __init__(self, plugin_classes, plugins_source, **kwargs) -> None: ... - def pre_execute_commands(self, job_directory): ... - def post_execute_commands(self, job_directory): ... - def collect_properties(self, job_id, job_directory): ... - @staticmethod - def from_file(plugin_classes, conf_file, **kwargs): ... diff --git a/typeshed/2and3/galaxy/jobs/metrics/collectl/__init__.pyi b/typeshed/2and3/galaxy/jobs/metrics/collectl/__init__.pyi deleted file mode 100644 index c58636ec..00000000 --- a/typeshed/2and3/galaxy/jobs/metrics/collectl/__init__.pyi +++ /dev/null @@ -1,4 +0,0 @@ -# Stubs for galaxy.jobs.metrics.collectl (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - diff --git a/typeshed/2and3/galaxy/jobs/metrics/collectl/cli.pyi b/typeshed/2and3/galaxy/jobs/metrics/collectl/cli.pyi deleted file mode 100644 index 88e3120d..00000000 --- a/typeshed/2and3/galaxy/jobs/metrics/collectl/cli.pyi +++ /dev/null @@ -1,12 +0,0 @@ -# Stubs for galaxy.jobs.metrics.collectl.cli (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any - -class CollectlCli: - mode = ... # type: Any - command_args = ... # type: Any - def __init__(self, **kwargs) -> None: ... - def build_command_line(self): ... - def run(self, stdout: Any = ..., stderr: Any = ...): ... diff --git a/typeshed/2and3/galaxy/jobs/metrics/collectl/processes.pyi b/typeshed/2and3/galaxy/jobs/metrics/collectl/processes.pyi deleted file mode 100644 index ad6fbd88..00000000 --- a/typeshed/2and3/galaxy/jobs/metrics/collectl/processes.pyi +++ /dev/null @@ -1,24 +0,0 @@ -# Stubs for galaxy.jobs.metrics.collectl.processes (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any - -def generate_process_statistics(collectl_playback_cli, pid, statistics: Any = ...): ... - -class CollectlProcessSummarizer: - pid = ... # type: Any - statistics = ... # type: Any - columns_of_interest = ... # type: Any - tree_statistics = ... # type: Any - process_accum_statistics = ... # type: Any - interval_count = ... # type: int - def __init__(self, pid, statistics) -> None: ... - def handle_interval(self, interval): ... - def get_statistics(self): ... - -class CollectlProcessInterval: - rows = ... # type: Any - def __init__(self) -> None: ... - def row_is_in(self, row): ... - def add_row(self, row): ... diff --git a/typeshed/2and3/galaxy/jobs/metrics/collectl/stats.pyi b/typeshed/2and3/galaxy/jobs/metrics/collectl/stats.pyi deleted file mode 100644 index 39f0c8d0..00000000 --- a/typeshed/2and3/galaxy/jobs/metrics/collectl/stats.pyi +++ /dev/null @@ -1,15 +0,0 @@ -# Stubs for galaxy.jobs.metrics.collectl.stats (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any - -class StatisticsTracker: - min = ... # type: Any - max = ... # type: Any - count = ... # type: int - sum = ... # type: int - def __init__(self) -> None: ... - def track(self, value): ... - @property - def avg(self): ... diff --git a/typeshed/2and3/galaxy/jobs/metrics/collectl/subsystems.pyi b/typeshed/2and3/galaxy/jobs/metrics/collectl/subsystems.pyi deleted file mode 100644 index 1da48e66..00000000 --- a/typeshed/2and3/galaxy/jobs/metrics/collectl/subsystems.pyi +++ /dev/null @@ -1,35 +0,0 @@ -# Stubs for galaxy.jobs.metrics.collectl.subsystems (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -class CollectlSubsystem: - @property - def command_line_arg(self): ... - @property - def name(self, job_directory): ... - -class ProcessesSubsystem(CollectlSubsystem): - command_line_arg = ... # type: str - name = ... # type: str - -class CpuSubsystem(CollectlSubsystem): - command_line_arg = ... # type: str - name = ... # type: str - -class DiskSubsystem(CollectlSubsystem): - command_line_arg = ... # type: str - name = ... # type: str - -class NetworkSubsystem(CollectlSubsystem): - command_line_arg = ... # type: str - name = ... # type: str - -class EnvironmentSubsystem(CollectlSubsystem): - command_line_arg = ... # type: str - name = ... # type: str - -class MemorySubsystem(CollectlSubsystem): - command_line_arg = ... # type: str - name = ... # type: str - -def get_subsystem(name): ... diff --git a/typeshed/2and3/galaxy/jobs/metrics/formatting.pyi b/typeshed/2and3/galaxy/jobs/metrics/formatting.pyi deleted file mode 100644 index ebc91b1f..00000000 --- a/typeshed/2and3/galaxy/jobs/metrics/formatting.pyi +++ /dev/null @@ -1,8 +0,0 @@ -# Stubs for galaxy.jobs.metrics.formatting (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -class JobMetricFormatter: - def format(self, key, value): ... - -def seconds_to_str(value): ... diff --git a/typeshed/2and3/galaxy/jobs/metrics/instrumenters/__init__.pyi b/typeshed/2and3/galaxy/jobs/metrics/instrumenters/__init__.pyi deleted file mode 100644 index ede6717e..00000000 --- a/typeshed/2and3/galaxy/jobs/metrics/instrumenters/__init__.pyi +++ /dev/null @@ -1,16 +0,0 @@ -# Stubs for galaxy.jobs.metrics.instrumenters (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any -from ...metrics import formatting as formatting - -INSTRUMENT_FILE_PREFIX = ... # type: str - -class InstrumentPlugin: - formatter = ... # type: Any - @property - def plugin_type(self): ... - def pre_execute_instrument(self, job_directory): ... - def post_execute_instrument(self, job_directory): ... - def job_properties(self, job_id, job_directory): ... diff --git a/typeshed/2and3/galaxy/jobs/metrics/instrumenters/collectl.pyi b/typeshed/2and3/galaxy/jobs/metrics/instrumenters/collectl.pyi deleted file mode 100644 index 080d2e5b..00000000 --- a/typeshed/2and3/galaxy/jobs/metrics/instrumenters/collectl.pyi +++ /dev/null @@ -1,22 +0,0 @@ -# Stubs for galaxy.jobs.metrics.instrumenters.collectl (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any -import formatting -from ..instrumenters import InstrumentPlugin - -class CollectlFormatter(formatting.JobMetricFormatter): - def format(self, key, value): ... - -class CollectlPlugin(InstrumentPlugin): - plugin_type = ... # type: str - formatter = ... # type: Any - saved_logs_path = ... # type: Any - summarize_process_data = ... # type: Any - log_collectl_program_output = ... # type: Any - process_statistics = ... # type: Any - def __init__(self, **kwargs) -> None: ... - def pre_execute_instrument(self, job_directory): ... - def post_execute_instrument(self, job_directory): ... - def job_properties(self, job_id, job_directory): ... diff --git a/typeshed/2and3/galaxy/jobs/metrics/instrumenters/core.pyi b/typeshed/2and3/galaxy/jobs/metrics/instrumenters/core.pyi deleted file mode 100644 index 885df5a2..00000000 --- a/typeshed/2and3/galaxy/jobs/metrics/instrumenters/core.pyi +++ /dev/null @@ -1,18 +0,0 @@ -# Stubs for galaxy.jobs.metrics.instrumenters.core (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any -import formatting -from ..instrumenters import InstrumentPlugin - -class CorePluginFormatter(formatting.JobMetricFormatter): - def format(self, key, value): ... - -class CorePlugin(InstrumentPlugin): - plugin_type = ... # type: str - formatter = ... # type: Any - def __init__(self, **kwargs) -> None: ... - def pre_execute_instrument(self, job_directory): ... - def post_execute_instrument(self, job_directory): ... - def job_properties(self, job_id, job_directory): ... diff --git a/typeshed/2and3/galaxy/jobs/metrics/instrumenters/cpuinfo.pyi b/typeshed/2and3/galaxy/jobs/metrics/instrumenters/cpuinfo.pyi deleted file mode 100644 index 00744ed6..00000000 --- a/typeshed/2and3/galaxy/jobs/metrics/instrumenters/cpuinfo.pyi +++ /dev/null @@ -1,18 +0,0 @@ -# Stubs for galaxy.jobs.metrics.instrumenters.cpuinfo (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any -import formatting -from ..instrumenters import InstrumentPlugin - -class CpuInfoFormatter(formatting.JobMetricFormatter): - def format(self, key, value): ... - -class CpuInfoPlugin(InstrumentPlugin): - plugin_type = ... # type: str - formatter = ... # type: Any - verbose = ... # type: Any - def __init__(self, **kwargs) -> None: ... - def pre_execute_instrument(self, job_directory): ... - def job_properties(self, job_id, job_directory): ... diff --git a/typeshed/2and3/galaxy/jobs/metrics/instrumenters/env.pyi b/typeshed/2and3/galaxy/jobs/metrics/instrumenters/env.pyi deleted file mode 100644 index 41133220..00000000 --- a/typeshed/2and3/galaxy/jobs/metrics/instrumenters/env.pyi +++ /dev/null @@ -1,18 +0,0 @@ -# Stubs for galaxy.jobs.metrics.instrumenters.env (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any -import formatting -from ..instrumenters import InstrumentPlugin - -class EnvFormatter(formatting.JobMetricFormatter): ... - -class EnvPlugin(InstrumentPlugin): - plugin_type = ... # type: str - formatter = ... # type: Any - variables = ... # type: Any - def __init__(self, **kwargs) -> None: ... - def pre_execute_instrument(self, job_directory): ... - def post_execute_instrument(self, job_directory): ... - def job_properties(self, job_id, job_directory): ... diff --git a/typeshed/2and3/galaxy/jobs/metrics/instrumenters/meminfo.pyi b/typeshed/2and3/galaxy/jobs/metrics/instrumenters/meminfo.pyi deleted file mode 100644 index 344cfa86..00000000 --- a/typeshed/2and3/galaxy/jobs/metrics/instrumenters/meminfo.pyi +++ /dev/null @@ -1,18 +0,0 @@ -# Stubs for galaxy.jobs.metrics.instrumenters.meminfo (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any -import formatting -from ..instrumenters import InstrumentPlugin - -class MemInfoFormatter(formatting.JobMetricFormatter): - def format(self, key, value): ... - -class MemInfoPlugin(InstrumentPlugin): - plugin_type = ... # type: str - formatter = ... # type: Any - verbose = ... # type: Any - def __init__(self, **kwargs) -> None: ... - def pre_execute_instrument(self, job_directory): ... - def job_properties(self, job_id, job_directory): ... diff --git a/typeshed/2and3/galaxy/jobs/metrics/instrumenters/uname.pyi b/typeshed/2and3/galaxy/jobs/metrics/instrumenters/uname.pyi deleted file mode 100644 index b541bd02..00000000 --- a/typeshed/2and3/galaxy/jobs/metrics/instrumenters/uname.pyi +++ /dev/null @@ -1,18 +0,0 @@ -# Stubs for galaxy.jobs.metrics.instrumenters.uname (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any -import formatting -from ..instrumenters import InstrumentPlugin - -class UnameFormatter(formatting.JobMetricFormatter): - def format(self, key, value): ... - -class UnamePlugin(InstrumentPlugin): - plugin_type = ... # type: str - formatter = ... # type: Any - uname_args = ... # type: Any - def __init__(self, **kwargs) -> None: ... - def pre_execute_instrument(self, job_directory): ... - def job_properties(self, job_id, job_directory): ... diff --git a/typeshed/2and3/galaxy/objectstore/__init__.pyi b/typeshed/2and3/galaxy/objectstore/__init__.pyi deleted file mode 100644 index 82259bce..00000000 --- a/typeshed/2and3/galaxy/objectstore/__init__.pyi +++ /dev/null @@ -1,80 +0,0 @@ -# Stubs for galaxy.objectstore (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any, Optional - -object_session = ... # type: Any -NO_SESSION_ERROR_MESSAGE = ... # type: str -log = ... # type: Any - -class ObjectStore: - running = ... # type: bool - extra_dirs = ... # type: Any - config = ... # type: Any - check_old_style = ... # type: Any - def __init__(self, config, **kwargs) -> None: ... - def shutdown(self): ... - def exists(self, obj, base_dir: Optional[Any] = ..., dir_only: bool = ..., extra_dir: Optional[Any] = ..., extra_dir_at_root: bool = ..., alt_name: Optional[Any] = ...): ... - def file_ready(self, obj, base_dir: Optional[Any] = ..., dir_only: bool = ..., extra_dir: Optional[Any] = ..., extra_dir_at_root: bool = ..., alt_name: Optional[Any] = ..., obj_dir: bool = ...): ... - def create(self, obj, base_dir: Optional[Any] = ..., dir_only: bool = ..., extra_dir: Optional[Any] = ..., extra_dir_at_root: bool = ..., alt_name: Optional[Any] = ..., obj_dir: bool = ...): ... - def empty(self, obj, base_dir: Optional[Any] = ..., extra_dir: Optional[Any] = ..., extra_dir_at_root: bool = ..., alt_name: Optional[Any] = ..., obj_dir: bool = ...): ... - def size(self, obj, extra_dir: Optional[Any] = ..., extra_dir_at_root: bool = ..., alt_name: Optional[Any] = ..., obj_dir: bool = ...): ... - def delete(self, obj, entire_dir: bool = ..., base_dir: Optional[Any] = ..., extra_dir: Optional[Any] = ..., extra_dir_at_root: bool = ..., alt_name: Optional[Any] = ..., obj_dir: bool = ...): ... - def get_data(self, obj, start: int = ..., count: int = ..., base_dir: Optional[Any] = ..., extra_dir: Optional[Any] = ..., extra_dir_at_root: bool = ..., alt_name: Optional[Any] = ..., obj_dir: bool = ...): ... - def get_filename(self, obj, base_dir: Optional[Any] = ..., dir_only: bool = ..., extra_dir: Optional[Any] = ..., extra_dir_at_root: bool = ..., alt_name: Optional[Any] = ..., obj_dir: bool = ...): ... - def update_from_file(self, obj, base_dir: Optional[Any] = ..., extra_dir: Optional[Any] = ..., extra_dir_at_root: bool = ..., alt_name: Optional[Any] = ..., obj_dir: bool = ..., file_name: Optional[Any] = ..., create: bool = ...): ... - def get_object_url(https://github.com/self,%20obj,%20extra_dir:%20Optional[Any]%20=%20...,%20extra_dir_at_root:%20bool%20=%20...,%20alt_name:%20Optional[Any]%20=%20...,%20obj_dir:%20bool%20=%20...): ... - def get_store_usage_percent(self): ... - -class DiskObjectStore(ObjectStore): - file_path = ... # type: Any - def __init__(self, config, config_xml: Optional[Any] = ..., file_path: Optional[Any] = ..., extra_dirs: Optional[Any] = ...) -> None: ... - def exists(self, obj, **kwargs): ... - def create(self, obj, **kwargs): ... - def empty(self, obj, **kwargs): ... - def size(self, obj, **kwargs): ... - def delete(self, obj, entire_dir: bool = ..., **kwargs): ... - def get_data(self, obj, start: int = ..., count: int = ..., **kwargs): ... - def get_filename(self, obj, **kwargs): ... - def update_from_file(self, obj, file_name: Optional[Any] = ..., create: bool = ..., **kwargs): ... - def get_object_url(https://github.com/self,%20obj,%20**kwargs): ... - def get_store_usage_percent(self): ... - -class NestedObjectStore(ObjectStore): - backends = ... # type: Any - def __init__(self, config, config_xml: Optional[Any] = ...) -> None: ... - def shutdown(self): ... - def exists(self, obj, **kwargs): ... - def file_ready(self, obj, **kwargs): ... - def create(self, obj, **kwargs): ... - def empty(self, obj, **kwargs): ... - def size(self, obj, **kwargs): ... - def delete(self, obj, **kwargs): ... - def get_data(self, obj, **kwargs): ... - def get_filename(self, obj, **kwargs): ... - def update_from_file(self, obj, **kwargs): ... - def get_object_url(https://github.com/self,%20obj,%20**kwargs): ... - -class DistributedObjectStore(NestedObjectStore): - distributed_config = ... # type: Any - backends = ... # type: Any - weighted_backend_ids = ... # type: Any - original_weighted_backend_ids = ... # type: Any - max_percent_full = ... # type: Any - global_max_percent_full = ... # type: float - sleeper = ... # type: Any - filesystem_monitor_thread = ... # type: Any - def __init__(self, config, config_xml: Optional[Any] = ..., fsmon: bool = ...) -> None: ... - def shutdown(self): ... - def create(self, obj, **kwargs): ... - -class HierarchicalObjectStore(NestedObjectStore): - backends = ... # type: Any - def __init__(self, config, config_xml: Optional[Any] = ..., fsmon: bool = ...) -> None: ... - def exists(self, obj, **kwargs): ... - def create(self, obj, **kwargs): ... - -def build_object_store_from_config(config, fsmon: bool = ..., config_xml: Optional[Any] = ...): ... -def local_extra_dirs(func): ... -def convert_bytes(bytes): ... diff --git a/typeshed/2and3/galaxy/objectstore/azure_blob.pyi b/typeshed/2and3/galaxy/objectstore/azure_blob.pyi deleted file mode 100644 index 89b58c1a..00000000 --- a/typeshed/2and3/galaxy/objectstore/azure_blob.pyi +++ /dev/null @@ -1,29 +0,0 @@ -# Stubs for galaxy.objectstore.azure_blob (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any, Optional -from ..objectstore import convert_bytes as convert_bytes, ObjectStore as ObjectStore - -BlockBlobService = ... # type: Any -NO_BLOBSERVICE_ERROR_MESSAGE = ... # type: str -log = ... # type: Any - -class AzureBlobObjectStore(ObjectStore): - staging_path = ... # type: Any - transfer_progress = ... # type: int - cache_size = ... # type: Any - sleeper = ... # type: Any - cache_monitor_thread = ... # type: Any - def __init__(self, config, config_xml) -> None: ... - def exists(self, obj, **kwargs): ... - def file_ready(self, obj, **kwargs): ... - def create(self, obj, **kwargs): ... - def empty(self, obj, **kwargs): ... - def size(self, obj, **kwargs): ... - def delete(self, obj, entire_dir: bool = ..., **kwargs): ... - def get_data(self, obj, start: int = ..., count: int = ..., **kwargs): ... - def get_filename(self, obj, **kwargs): ... - def update_from_file(self, obj, file_name: Optional[Any] = ..., create: bool = ..., **kwargs): ... - def get_object_url(https://github.com/self,%20obj,%20**kwargs): ... - def get_store_usage_percent(self): ... diff --git a/typeshed/2and3/galaxy/objectstore/pulsar.pyi b/typeshed/2and3/galaxy/objectstore/pulsar.pyi deleted file mode 100644 index bad10452..00000000 --- a/typeshed/2and3/galaxy/objectstore/pulsar.pyi +++ /dev/null @@ -1,24 +0,0 @@ -# Stubs for galaxy.objectstore.pulsar (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any, Optional -from ..objectstore import ObjectStore as ObjectStore - -ObjectStoreClientManager = ... # type: Any - -class PulsarObjectStore(ObjectStore): - pulsar_client = ... # type: Any - def __init__(self, config, config_xml) -> None: ... - def exists(self, obj, **kwds): ... - def file_ready(self, obj, **kwds): ... - def create(self, obj, **kwds): ... - def empty(self, obj, **kwds): ... - def size(self, obj, **kwds): ... - def delete(self, obj, **kwds): ... - def get_data(self, obj, **kwds): ... - def get_filename(self, obj, **kwds): ... - def update_from_file(self, obj, **kwds): ... - def get_store_usage_percent(self): ... - def get_object_url(https://github.com/self,%20obj,%20extra_dir:%20Optional[Any]%20=%20...,%20extra_dir_at_root:%20bool%20=%20...,%20alt_name:%20Optional[Any]%20=%20...): ... - def shutdown(self): ... diff --git a/typeshed/2and3/galaxy/objectstore/rods.pyi b/typeshed/2and3/galaxy/objectstore/rods.pyi deleted file mode 100644 index 125444b2..00000000 --- a/typeshed/2and3/galaxy/objectstore/rods.pyi +++ /dev/null @@ -1,32 +0,0 @@ -# Stubs for galaxy.objectstore.rods (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any, Optional -from posixpath import basename as path_basename -from posixpath import dirname as path_dirname -from posixpath import join as path_join -from ..objectstore import DiskObjectStore as DiskObjectStore, local_extra_dirs as local_extra_dirs - -irods = ... # type: Any -IRODS_IMPORT_MESSAGE = ... # type: str -log = ... # type: Any - -class IRODSObjectStore(DiskObjectStore): - cache_path = ... # type: Any - default_resource = ... # type: Any - root_collection_path = ... # type: Any - root_collection = ... # type: Any - def __init__(self, config, file_path: Optional[Any] = ..., extra_dirs: Optional[Any] = ...) -> None: ... - def exists(self, obj, **kwargs): ... - def create(self, obj, **kwargs): ... - def empty(self, obj, **kwargs): ... - def size(self, obj, **kwargs): ... - def delete(self, obj, entire_dir: bool = ..., **kwargs): ... - def get_data(self, obj, start: int = ..., count: int = ..., **kwargs): ... - def get_filename(self, obj, **kwargs): ... - def update_from_file(self, obj, file_name: Optional[Any] = ..., create: bool = ..., **kwargs): ... - def get_object_url(https://github.com/self,%20obj,%20**kwargs): ... - def get_store_usage_percent(self): ... - -def rods_connect(): ... diff --git a/typeshed/2and3/galaxy/objectstore/s3.pyi b/typeshed/2and3/galaxy/objectstore/s3.pyi deleted file mode 100644 index 8ffbd92c..00000000 --- a/typeshed/2and3/galaxy/objectstore/s3.pyi +++ /dev/null @@ -1,34 +0,0 @@ -# Stubs for galaxy.objectstore.s3 (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any, Optional -from .s3_multipart_upload import multipart_upload as multipart_upload -from ..objectstore import convert_bytes as convert_bytes, ObjectStore as ObjectStore - -boto = ... # type: Any -NO_BOTO_ERROR_MESSAGE = ... # type: str -log = ... # type: Any - -class S3ObjectStore(ObjectStore): - staging_path = ... # type: Any - transfer_progress = ... # type: int - bucket = ... # type: Any - cache_size = ... # type: Any - sleeper = ... # type: Any - cache_monitor_thread = ... # type: Any - use_axel = ... # type: bool - def __init__(self, config, config_xml) -> None: ... - def file_ready(self, obj, **kwargs): ... - def exists(self, obj, **kwargs): ... - def create(self, obj, **kwargs): ... - def empty(self, obj, **kwargs): ... - def size(self, obj, **kwargs): ... - def delete(self, obj, entire_dir: bool = ..., **kwargs): ... - def get_data(self, obj, start: int = ..., count: int = ..., **kwargs): ... - def get_filename(self, obj, **kwargs): ... - def update_from_file(self, obj, file_name: Optional[Any] = ..., create: bool = ..., **kwargs): ... - def get_object_url(https://github.com/self,%20obj,%20**kwargs): ... - def get_store_usage_percent(self): ... - -class SwiftObjectStore(S3ObjectStore): ... diff --git a/typeshed/2and3/galaxy/objectstore/s3_multipart_upload.pyi b/typeshed/2and3/galaxy/objectstore/s3_multipart_upload.pyi deleted file mode 100644 index 9bf1d872..00000000 --- a/typeshed/2and3/galaxy/objectstore/s3_multipart_upload.pyi +++ /dev/null @@ -1,13 +0,0 @@ -# Stubs for galaxy.objectstore.s3_multipart_upload (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any, Optional - -boto = ... # type: Any - -def map_wrap(f): ... -def mp_from_ids(s3server, mp_id, mp_keyname, mp_bucketname): ... -def transfer_part(s3server, mp_id, mp_keyname, mp_bucketname, i, part): ... -def multipart_upload(s3server, bucket, s3_key_name, tarball, mb_size): ... -def multimap(cores: Optional[Any] = ...): ... diff --git a/typeshed/2and3/galaxy/tools/__init__.pyi b/typeshed/2and3/galaxy/tools/__init__.pyi deleted file mode 100644 index ef883e95..00000000 --- a/typeshed/2and3/galaxy/tools/__init__.pyi +++ /dev/null @@ -1,4 +0,0 @@ -# Stubs for galaxy.tools (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - diff --git a/typeshed/2and3/galaxy/tools/cwl/__init__.pyi b/typeshed/2and3/galaxy/tools/cwl/__init__.pyi deleted file mode 100644 index 72bc0494..00000000 --- a/typeshed/2and3/galaxy/tools/cwl/__init__.pyi +++ /dev/null @@ -1,8 +0,0 @@ -# Stubs for galaxy.tools.cwl (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from .cwltool_deps import needs_shell_quoting as needs_shell_quoting, shellescape as shellescape -from .parser import tool_proxy as tool_proxy, workflow_proxy as workflow_proxy -from .representation import to_cwl_job as to_cwl_job, to_galaxy_parameters as to_galaxy_parameters -from .runtime_actions import handle_outputs as handle_outputs diff --git a/typeshed/2and3/galaxy/tools/cwl/cwltool_deps.pyi b/typeshed/2and3/galaxy/tools/cwl/cwltool_deps.pyi deleted file mode 100644 index 351a4208..00000000 --- a/typeshed/2and3/galaxy/tools/cwl/cwltool_deps.pyi +++ /dev/null @@ -1,22 +0,0 @@ -# Stubs for galaxy.tools.cwl.cwltool_deps (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any -from cwltool import main as main, workflow as workflow, process as process, pathmapper as pathmapper -from cwltool import load_tool as load_tool -import shellescape as shellescape -import schema_salad as schema_salad -from schema_salad import ref_resolver as ref_resolver - -main = ... # type: Any -workflow = ... # type: Any -process = ... # type: Any -pathmapper = ... # type: Any -load_tool = ... # type: Any -shellescape = ... # type: Any -schema_salad = ... # type: Any -ref_resolver = ... # type: Any -needs_shell_quoting = ... # type: Any - -def ensure_cwltool_available(): ... diff --git a/typeshed/2and3/galaxy/tools/cwl/parser.pyi b/typeshed/2and3/galaxy/tools/cwl/parser.pyi deleted file mode 100644 index 369b1468..00000000 --- a/typeshed/2and3/galaxy/tools/cwl/parser.pyi +++ /dev/null @@ -1,94 +0,0 @@ -# Stubs for galaxy.tools.cwl.parser (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any, Optional - -def tool_proxy(tool_path, strict_cwl_validation: bool = ...): ... -def load_job_proxy(job_directory, strict_cwl_validation: bool = ...): ... - -class ToolProxy: - def __init__(self, tool, tool_path) -> None: ... - def job_proxy(self, input_dict, output_dict, job_directory: str = ...): ... - def input_instances(self): ... - def output_instances(self): ... - def docker_identifier(self): ... - def description(self): ... - def label(self): ... - -class CommandLineToolProxy(ToolProxy): - def description(self): ... - def label(self): ... - def input_instances(self): ... - def output_instances(self): ... - def docker_identifier(self): ... - -class ExpressionToolProxy(CommandLineToolProxy): ... - -class JobProxy: - def __init__(self, tool_proxy, input_dict, output_dict, job_directory) -> None: ... - def cwl_job(self): ... - @property - def is_command_line_job(self): ... - @property - def command_line(self): ... - @property - def stdin(self): ... - @property - def stdout(self): ... - @property - def environment(self): ... - @property - def generate_files(self): ... - def collect_outputs(self, tool_working_directory): ... - def save_job(self): ... - def output_id(self, output_name): ... - def output_path(self, output_name): ... - def output_secondary_files_dir(self, output_name, create: bool = ...): ... - def stage_files(self): ... - -class WorkflowProxy: - def __init__(self, workflow, workflow_path) -> None: ... - def step_proxies(self): ... - @property - def runnables(self): ... - def to_dict(self): ... - -class StepProxy: - def __init__(self, workflow_proxy, step) -> None: ... - def to_dict(self): ... - -class ConditionalInstance: - input_type = ... # type: Any - name = ... # type: Any - case = ... # type: Any - whens = ... # type: Any - def __init__(self, name, case, whens) -> None: ... - def to_dict(self): ... - -class SelectInputInstance: - input_type = ... # type: Any - name = ... # type: Any - label = ... # type: Any - description = ... # type: Any - options = ... # type: Any - def __init__(self, name, label, description, options) -> None: ... - def to_dict(self): ... - -class InputInstance: - input_type = ... # type: Any - name = ... # type: Any - label = ... # type: Any - description = ... # type: Any - required = ... # type: bool - array = ... # type: Any - area = ... # type: Any - def __init__(self, name, label, description, input_type, array: bool = ..., area: bool = ...) -> None: ... - def to_dict(self, itemwise: bool = ...): ... - -class OutputInstance: - name = ... # type: Any - output_data_type = ... # type: Any - output_type = ... # type: Any - path = ... # type: Any - def __init__(self, name, output_data_type, output_type, path: Optional[Any] = ...) -> None: ... diff --git a/typeshed/2and3/galaxy/tools/cwl/representation.pyi b/typeshed/2and3/galaxy/tools/cwl/representation.pyi deleted file mode 100644 index ef2cc45f..00000000 --- a/typeshed/2and3/galaxy/tools/cwl/representation.pyi +++ /dev/null @@ -1,12 +0,0 @@ -# Stubs for galaxy.tools.cwl.representation (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any - -log = ... # type: Any -NOT_PRESENT = ... # type: Any -GALAXY_TO_CWL_TYPES = ... # type: Any - -def to_cwl_job(tool, param_dict, local_working_directory): ... -def to_galaxy_parameters(tool, as_dict): ... diff --git a/typeshed/2and3/galaxy/tools/cwl/runtime_actions.pyi b/typeshed/2and3/galaxy/tools/cwl/runtime_actions.pyi deleted file mode 100644 index 4f1558d9..00000000 --- a/typeshed/2and3/galaxy/tools/cwl/runtime_actions.pyi +++ /dev/null @@ -1,7 +0,0 @@ -# Stubs for galaxy.tools.cwl.runtime_actions (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any, Optional - -def handle_outputs(job_directory: Optional[Any] = ...): ... diff --git a/typeshed/2and3/galaxy/tools/cwl/schema.pyi b/typeshed/2and3/galaxy/tools/cwl/schema.pyi deleted file mode 100644 index 1c51ead4..00000000 --- a/typeshed/2and3/galaxy/tools/cwl/schema.pyi +++ /dev/null @@ -1,22 +0,0 @@ -# Stubs for galaxy.tools.cwl.schema (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any -from .cwltool_deps import ensure_cwltool_available as ensure_cwltool_available, load_tool as load_tool, schema_salad as schema_salad, workflow as workflow -from collections import namedtuple - -RawProcessReference = namedtuple('RawProcessReference', ['process_object', 'uri']) - -ProcessDefinition = namedtuple('ProcessDefinition', ['process_object', 'metadata', 'document_loader', 'avsc_names', 'raw_process_reference']) - -class SchemaLoader: - def __init__(self, strict: bool = ...) -> None: ... - @property - def raw_document_loader(self): ... - def raw_process_reference(self, path): ... - def process_definition(self, raw_reference): ... - def tool(self, **kwds): ... - -schema_loader = ... # type: Any -non_strict_schema_loader = ... # type: Any diff --git a/typeshed/2and3/galaxy/tools/deps/__init__.pyi b/typeshed/2and3/galaxy/tools/deps/__init__.pyi deleted file mode 100644 index 1df97ad9..00000000 --- a/typeshed/2and3/galaxy/tools/deps/__init__.pyi +++ /dev/null @@ -1,41 +0,0 @@ -# Stubs for galaxy.tools.deps (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any, Optional, List -from .requirements import ToolRequirement as ToolRequirement, ToolRequirements as ToolRequirements -from .resolvers import NullDependency as NullDependency -from .resolvers.conda import CondaDependencyResolver as CondaDependencyResolver -from .resolvers.galaxy_packages import GalaxyPackageDependencyResolver as GalaxyPackageDependencyResolver -from .resolvers.tool_shed_packages import ToolShedPackageDependencyResolver as ToolShedPackageDependencyResolver - -log = ... # type: Any -CONFIG_VAL_NOT_FOUND = ... # type: Any - -def build_dependency_manager(config: Any) -> DependencyManager: ... - -class NullDependencyManager: - dependency_resolvers = ... # type: Any - def uses_tool_shed_dependencies(self): ... - def dependency_shell_commands(self, requirements: ToolRequirements, **kwds) -> List[str]: ... - def find_dep(self, name, version: Optional[Any] = ..., type: str = ..., **kwds): ... - -class DependencyManager: - default_base_path = ... # type: Any - resolver_classes = ... # type: Any - dependency_resolvers = ... # type: Any - def __init__(self, default_base_path, conf_file: Optional[Any] = ..., app_config: Any = ...) -> None: ... - def get_resolver_option(self, resolver, key, explicit_resolver_options: Any = ...): ... - def get_app_option(self, key, default: Optional[Any] = ...): ... - def dependency_shell_commands(self, requirements: ToolRequirements, **kwds) -> List[str]: ... - def requirements_to_dependencies(self, requirements, **kwds): ... - def uses_tool_shed_dependencies(self): ... - def find_dep(self, name, version: Optional[Any] = ..., type: str = ..., **kwds): ... - -class CachedDependencyManager(DependencyManager): - tool_dependency_cache_dir = ... # type: Any - def __init__(self, default_base_path, conf_file: Optional[Any] = ..., app_config: Any = ..., tool_dependency_cache_dir: Optional[Any] = ...) -> None: ... - def build_cache(self, requirements, **kwds): ... - def dependency_shell_commands(self, requirements: ToolRequirements, **kwds) -> List[str]: ... - def hash_dependencies(self, resolved_dependencies): ... - def get_hashed_dependencies_path(self, resolved_dependencies): ... diff --git a/typeshed/2and3/galaxy/tools/deps/brew_exts.pyi b/typeshed/2and3/galaxy/tools/deps/brew_exts.pyi deleted file mode 100644 index c526375e..00000000 --- a/typeshed/2and3/galaxy/tools/deps/brew_exts.pyi +++ /dev/null @@ -1,74 +0,0 @@ -# Stubs for galaxy.tools.deps.brew_exts (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any, Optional - -WHITESPACE_PATTERN = ... # type: Any -DESCRIPTION = ... # type: str -DEFAULT_HOMEBREW_ROOT = ... # type: str -NO_BREW_ERROR_MESSAGE = ... # type: str -CANNOT_DETERMINE_TAP_ERROR_MESSAGE = ... # type: str -VERBOSE = ... # type: bool -RELAXED = ... # type: bool -BREW_ARGS = ... # type: Any - -class BrewContext: - homebrew_prefix = ... # type: Any - homebrew_cellar = ... # type: Any - def __init__(self, args: Optional[Any] = ...) -> None: ... - -class RecipeContext: - @staticmethod - def from_args(args, brew_context: Optional[Any] = ...): ... - recipe = ... # type: Any - version = ... # type: Any - brew_context = ... # type: Any - def __init__(self, recipe, version, brew_context: Optional[Any] = ...) -> None: ... - @property - def cellar_path(self): ... - @property - def tap_path(self): ... - -def main(): ... - -class CommandLineException(Exception): - command = ... # type: Any - stdout = ... # type: Any - stderr = ... # type: Any - message = ... # type: Any - def __init__(self, command, stdout, stderr) -> None: ... - -def versioned_install(recipe_context, package: Optional[Any] = ..., version: Optional[Any] = ..., installed_deps: Any = ...): ... -def commit_for_version(recipe_context, package, version): ... -def print_versioned_deps(recipe_context, recipe, version): ... -def load_versioned_deps(cellar_path, relaxed: Optional[Any] = ...): ... -def unversioned_install(package): ... -def attempt_unlink_all(package, deps): ... -def attempt_unlink(package): ... -def brew_execute(args, env: Optional[Any] = ...): ... -def build_env_statements_from_recipe_context(recipe_context, **kwds): ... -def build_env_statements(cellar_root, cellar_path, relaxed: Optional[Any] = ..., custom_only: bool = ...): ... -def build_env_actions(deps, cellar_root, cellar_path, relaxed: Optional[Any] = ..., custom_only: bool = ...): ... - -class EnvAction: - variable = ... # type: Any - action = ... # type: Any - value = ... # type: Any - def __init__(self, keg_root, action_description) -> None: ... - @staticmethod - def build_env(env_actions): ... - def modify_environ(self, environ): ... - def to_statements(self): ... - -def brew_head_at_version(recipe_context, package, version): ... -def brew_head_at_commit(commit, tap_path): ... -def git_execute(args): ... -def execute(cmds, env: Optional[Any] = ...): ... -def brew_deps(package): ... -def brew_info(recipe): ... -def extended_brew_info(recipe): ... -def brew_versions_info(package, tap_path): ... -def recipe_cellar_path(cellar_path, recipe, version): ... -def ensure_brew_on_path(args): ... -def which(file): ... diff --git a/typeshed/2and3/galaxy/tools/deps/brew_util.pyi b/typeshed/2and3/galaxy/tools/deps/brew_util.pyi deleted file mode 100644 index c791f183..00000000 --- a/typeshed/2and3/galaxy/tools/deps/brew_util.pyi +++ /dev/null @@ -1,18 +0,0 @@ -# Stubs for galaxy.tools.deps.brew_util (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any -from ..deps import brew_exts as brew_exts - -DEFAULT_TAP = ... # type: str - -class HomebrewRecipe: - recipe = ... # type: Any - version = ... # type: Any - tap = ... # type: Any - def __init__(self, recipe, version, tap) -> None: ... - -def requirements_to_recipes(requirements): ... -def requirement_to_recipe(requirement): ... -def requirements_to_recipe_contexts(requirements, brew_context): ... diff --git a/typeshed/2and3/galaxy/tools/deps/commands.pyi b/typeshed/2and3/galaxy/tools/deps/commands.pyi deleted file mode 100644 index a11b90dc..00000000 --- a/typeshed/2and3/galaxy/tools/deps/commands.pyi +++ /dev/null @@ -1,22 +0,0 @@ -# Stubs for galaxy.tools.deps.commands (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any, Optional -from galaxy.util import which as which - -def redirecting_io(sys: Any = ...): ... -def redirect_aware_commmunicate(p, sys: Any = ...): ... -def shell(cmds, env: Optional[Any] = ..., **kwds): ... -def shell_process(cmds, env: Optional[Any] = ..., **kwds): ... -def execute(cmds): ... -def argv_to_str(command_argv, quote: bool = ...): ... -def download_command(url, to: Any = ..., quote_url: bool = ...): ... - -class CommandLineException(Exception): - command = ... # type: Any - stdout = ... # type: Any - stderr = ... # type: Any - returncode = ... # type: Any - message = ... # type: Any - def __init__(self, command, stdout, stderr, returncode) -> None: ... diff --git a/typeshed/2and3/galaxy/tools/deps/conda_compat.pyi b/typeshed/2and3/galaxy/tools/deps/conda_compat.pyi deleted file mode 100644 index 0cc63826..00000000 --- a/typeshed/2and3/galaxy/tools/deps/conda_compat.pyi +++ /dev/null @@ -1,21 +0,0 @@ -# Stubs for galaxy.tools.deps.conda_compat (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any, Optional -from conda_build.metadata import MetaData as MetaData - -MetaData = ... # type: Any - -class _Memoized: - func = ... # type: Any - cache = ... # type: Any - def __init__(self, func) -> None: ... - def __call__(self, *args): ... - -def raw_metadata(recipe_dir): ... - -class _MetaData: - meta = ... # type: Any - def __init__(self, input_dir) -> None: ... - def get_value(self, field, default: Optional[Any] = ...): ... diff --git a/typeshed/2and3/galaxy/tools/deps/conda_util.pyi b/typeshed/2and3/galaxy/tools/deps/conda_util.pyi deleted file mode 100644 index 1e418baa..00000000 --- a/typeshed/2and3/galaxy/tools/deps/conda_util.pyi +++ /dev/null @@ -1,69 +0,0 @@ -# Stubs for galaxy.tools.deps.conda_util (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any, Optional -import installable -from sys import platform as _platform - -class CondaContext(installable.InstallableContext): - installable_description = ... # type: str - condarc_override = ... # type: Any - conda_exec = ... # type: Any - debug = ... # type: Any - shell_exec = ... # type: Any - copy_dependencies = ... # type: Any - conda_prefix = ... # type: Any - ensure_channels = ... # type: Any - ensured_channels = ... # type: bool - use_local = ... # type: Any - def __init__(self, conda_prefix: Optional[Any] = ..., conda_exec: Optional[Any] = ..., shell_exec: Optional[Any] = ..., debug: bool = ..., ensure_channels: str = ..., condarc_override: Optional[Any] = ..., use_path_exec: Any = ..., copy_dependencies: bool = ..., use_local: Any = ...) -> None: ... - @property - def conda_version(self): ... - @property - def conda_build_available(self): ... - def ensure_channels_configured(self): ... - def ensure_conda_build_installed_if_needed(self): ... - def conda_info(self): ... - def is_conda_installed(self): ... - def can_install_conda(self): ... - def load_condarc(self): ... - def save_condarc(self, conf): ... - @property - def condarc(self): ... - def command(self, operation, args): ... - def exec_command(self, operation, args): ... - def exec_create(self, args, allow_local: bool = ...): ... - def exec_remove(self, args): ... - def exec_install(self, args, allow_local: bool = ...): ... - def exec_clean(self, args: Any = ..., quiet: bool = ...): ... - def export_list(self, name, path): ... - def env_path(self, env_name): ... - @property - def envs_path(self): ... - def has_env(self, env_name): ... - @property - def deactivate(self): ... - @property - def activate(self): ... - def is_installed(self): ... - def can_install(self): ... - @property - def parent_path(self): ... - -class CondaTarget: - package = ... # type: Any - version = ... # type: Any - channel = ... # type: Any - def __init__(self, package, version: Optional[Any] = ..., channel: Optional[Any] = ...) -> None: ... - @property - def package_specifier(self): ... - @property - def install_environment(self): ... - def __hash__(self): ... - def __eq__(self, other): ... - def __ne__(self, other): ... - -def install_conda(conda_context: Optional[Any] = ..., force_conda_build: bool = ...): ... -def install_conda_target(conda_target, conda_context: Optional[Any] = ..., skip_environment: bool = ...): ... -def requirements_to_conda_targets(requirements, conda_context: Optional[Any] = ...): ... diff --git a/typeshed/2and3/galaxy/tools/deps/container_resolvers/__init__.pyi b/typeshed/2and3/galaxy/tools/deps/container_resolvers/__init__.pyi deleted file mode 100644 index 4e8c8222..00000000 --- a/typeshed/2and3/galaxy/tools/deps/container_resolvers/__init__.pyi +++ /dev/null @@ -1,14 +0,0 @@ -# Stubs for galaxy.tools.deps.container_resolvers (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any, Optional -from galaxy.util.dictifiable import Dictifiable - -class ContainerResolver(Dictifiable): - dict_collection_visible_keys = ... # type: Any - app_info = ... # type: Any - resolver_kwds = ... # type: Any - def __init__(self, app_info: Optional[Any] = ..., **kwds) -> None: ... - def resolve(self, tool_info): ... - def resolver_type(self): ... diff --git a/typeshed/2and3/galaxy/tools/deps/container_resolvers/explicit.pyi b/typeshed/2and3/galaxy/tools/deps/container_resolvers/explicit.pyi deleted file mode 100644 index 3f45f952..00000000 --- a/typeshed/2and3/galaxy/tools/deps/container_resolvers/explicit.pyi +++ /dev/null @@ -1,9 +0,0 @@ -# Stubs for galaxy.tools.deps.container_resolvers.explicit (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from ..container_resolvers import ContainerResolver - -class ExplicitContainerResolver(ContainerResolver): - resolver_type = ... # type: str - def resolve(self, enabled_container_types, tool_info): ... diff --git a/typeshed/2and3/galaxy/tools/deps/container_resolvers/mulled.pyi b/typeshed/2and3/galaxy/tools/deps/container_resolvers/mulled.pyi deleted file mode 100644 index 5f7a6b4e..00000000 --- a/typeshed/2and3/galaxy/tools/deps/container_resolvers/mulled.pyi +++ /dev/null @@ -1,55 +0,0 @@ -# Stubs for galaxy.tools.deps.container_resolvers.mulled (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any, Optional -from ..container_resolvers import ContainerResolver -from collections import namedtuple - -CachedMulledImageSingleTarget = namedtuple('CachedMulledImageSingleTarget', ['package_name', 'version', 'build', 'image_identifier']) - -CachedV1MulledImageMultiTarget = namedtuple('CachedV1MulledImageMultiTarget', ['hash', 'build', 'image_identifier']) - -CachedV2MulledImageMultiTarget = namedtuple('CachedV2MulledImageMultiTarget', ['package_hash', 'version_hash', 'build', 'image_identifier']) - -class CachedMulledDockerContainerResolver(ContainerResolver): - resolver_type = ... # type: str - container_type = ... # type: str - namespace = ... # type: Any - hash_func = ... # type: Any - def __init__(self, app_info: Optional[Any] = ..., namespace: Optional[Any] = ..., hash_func: str = ...) -> None: ... - def resolve(self, enabled_container_types, tool_info): ... - -class CachedMulledSingularityContainerResolver(ContainerResolver): - resolver_type = ... # type: str - container_type = ... # type: str - cache_directory = ... # type: Any - hash_func = ... # type: Any - def __init__(self, app_info: Optional[Any] = ..., hash_func: str = ...) -> None: ... - def resolve(self, enabled_container_types, tool_info): ... - -class MulledDockerContainerResolver(ContainerResolver): - resolver_type = ... # type: str - container_type = ... # type: str - namespace = ... # type: Any - hash_func = ... # type: Any - def __init__(self, app_info: Optional[Any] = ..., namespace: str = ..., hash_func: str = ...) -> None: ... - def resolve(self, enabled_container_types, tool_info): ... - -class BuildMulledDockerContainerResolver(ContainerResolver): - resolver_type = ... # type: str - container_type = ... # type: str - namespace = ... # type: Any - hash_func = ... # type: Any - auto_init = ... # type: Any - def __init__(self, app_info: Optional[Any] = ..., namespace: str = ..., hash_func: str = ..., **kwds) -> None: ... - def resolve(self, enabled_container_types, tool_info): ... - -class BuildMulledSingularityContainerResolver(ContainerResolver): - resolver_type = ... # type: str - container_type = ... # type: str - cache_directory = ... # type: Any - hash_func = ... # type: Any - auto_init = ... # type: Any - def __init__(self, app_info: Optional[Any] = ..., hash_func: str = ..., **kwds) -> None: ... - def resolve(self, enabled_container_types, tool_info): ... diff --git a/typeshed/2and3/galaxy/tools/deps/containers.pyi b/typeshed/2and3/galaxy/tools/deps/containers.pyi deleted file mode 100644 index 5a18a632..00000000 --- a/typeshed/2and3/galaxy/tools/deps/containers.pyi +++ /dev/null @@ -1,99 +0,0 @@ -# Stubs for galaxy.tools.deps.containers (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any, Optional -from .container_resolvers.explicit import ExplicitContainerResolver as ExplicitContainerResolver -from .container_resolvers.mulled import BuildMulledDockerContainerResolver as BuildMulledDockerContainerResolver, BuildMulledSingularityContainerResolver as BuildMulledSingularityContainerResolver, CachedMulledDockerContainerResolver as CachedMulledDockerContainerResolver, CachedMulledSingularityContainerResolver as CachedMulledSingularityContainerResolver, MulledDockerContainerResolver as MulledDockerContainerResolver -from .requirements import ContainerDescription as ContainerDescription -from .requirements import DEFAULT_CONTAINER_RESOLVE_DEPENDENCIES as DEFAULT_CONTAINER_RESOLVE_DEPENDENCIES, DEFAULT_CONTAINER_SHELL as DEFAULT_CONTAINER_SHELL -from ..deps import docker_util as docker_util -from ..deps import singularity_util as singularity_util - -log = ... # type: Any -DOCKER_CONTAINER_TYPE = ... # type: str -SINGULARITY_CONTAINER_TYPE = ... # type: str -DEFAULT_CONTAINER_TYPE = ... # type: Any -ALL_CONTAINER_TYPES = ... # type: Any -LOAD_CACHED_IMAGE_COMMAND_TEMPLATE = ... # type: str - -class ContainerFinder: - app_info = ... # type: Any - container_registry = ... # type: Any - def __init__(self, app_info) -> None: ... - def find_best_container_description(self, enabled_container_types, tool_info): ... - def find_container(self, tool_info, destination_info, job_info): ... - -class NullContainerFinder: - def find_container(self, tool_info, destination_info, job_info): ... - -class ContainerRegistry: - resolver_classes = ... # type: Any - enable_beta_mulled_containers = ... # type: Any - app_info = ... # type: Any - container_resolvers = ... # type: Any - def __init__(self, app_info) -> None: ... - def find_best_container_description(self, enabled_container_types, tool_info): ... - -class AppInfo: - galaxy_root_dir = ... # type: Any - default_file_path = ... # type: Any - outputs_to_working_directory = ... # type: Any - container_image_cache_path = ... # type: Any - library_import_dir = ... # type: Any - enable_beta_mulled_containers = ... # type: Any - containers_resolvers_config_file = ... # type: Any - involucro_path = ... # type: Any - involucro_auto_init = ... # type: Any - def __init__(self, galaxy_root_dir: Optional[Any] = ..., default_file_path: Optional[Any] = ..., outputs_to_working_directory: bool = ..., container_image_cache_path: Optional[Any] = ..., library_import_dir: Optional[Any] = ..., enable_beta_mulled_containers: bool = ..., containers_resolvers_config_file: Optional[Any] = ..., involucro_path: Optional[Any] = ..., involucro_auto_init: bool = ...) -> None: ... - -class ToolInfo: - container_descriptions = ... # type: Any - requirements = ... # type: Any - requires_galaxy_python_environment = ... # type: Any - env_pass_through = ... # type: Any - def __init__(self, container_descriptions: Any = ..., requirements: Any = ..., requires_galaxy_python_environment: bool = ...) -> None: ... - -class JobInfo: - working_directory = ... # type: Any - job_directory = ... # type: Any - tool_directory = ... # type: Any - job_directory_type = ... # type: Any - def __init__(self, working_directory, tool_directory, job_directory, job_directory_type) -> None: ... - -class Container: - container_id = ... # type: Any - app_info = ... # type: Any - tool_info = ... # type: Any - destination_info = ... # type: Any - job_info = ... # type: Any - container_description = ... # type: Any - def __init__(self, container_id, app_info, tool_info, destination_info, job_info, container_description) -> None: ... - @property - def resolve_dependencies(self): ... - @property - def shell(self): ... - def containerize_command(self, command): ... - -def preprocess_volumes(volumes_raw_str, container_type): ... - -class HasDockerLikeVolumes: ... - -class DockerContainer(Container, HasDockerLikeVolumes): - container_type = ... # type: Any - def containerize_command(self, command): ... - -def docker_cache_path(cache_directory, container_id): ... - -class SingularityContainer(Container, HasDockerLikeVolumes): - container_type = ... # type: Any - def containerize_command(self, command): ... - -CONTAINER_CLASSES = ... # type: Any - -class NullContainer: - def __init__(self) -> None: ... - def __bool__(self): ... - __nonzero__ = ... # type: Any - -NULL_CONTAINER = ... # type: Any diff --git a/typeshed/2and3/galaxy/tools/deps/dependencies.pyi b/typeshed/2and3/galaxy/tools/deps/dependencies.pyi deleted file mode 100644 index 04907fef..00000000 --- a/typeshed/2and3/galaxy/tools/deps/dependencies.pyi +++ /dev/null @@ -1,13 +0,0 @@ -# Stubs for galaxy.tools.deps.dependencies (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any - -class DependenciesDescription: - requirements = ... # type: Any - installed_tool_dependencies = ... # type: Any - def __init__(self, requirements: Any = ..., installed_tool_dependencies: Any = ...) -> None: ... - def to_dict(self): ... - @staticmethod - def from_dict(as_dict): ... diff --git a/typeshed/2and3/galaxy/tools/deps/docker_util.pyi b/typeshed/2and3/galaxy/tools/deps/docker_util.pyi deleted file mode 100644 index e98b338c..00000000 --- a/typeshed/2and3/galaxy/tools/deps/docker_util.pyi +++ /dev/null @@ -1,41 +0,0 @@ -# Stubs for galaxy.tools.deps.docker_util (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any, Optional -from .commands import argv_to_str as argv_to_str - -DEFAULT_DOCKER_COMMAND = ... # type: str -DEFAULT_SUDO = ... # type: bool -DEFAULT_SUDO_COMMAND = ... # type: str -DEFAULT_HOST = ... # type: Any -DEFAULT_VOLUME_MOUNT_TYPE = ... # type: str -DEFAULT_WORKING_DIRECTORY = ... # type: Any -DEFAULT_NET = ... # type: Any -DEFAULT_MEMORY = ... # type: Any -DEFAULT_VOLUMES_FROM = ... # type: Any -DEFAULT_AUTO_REMOVE = ... # type: bool -DEFAULT_SET_USER = ... # type: str -DEFAULT_RUN_EXTRA_ARGUMENTS = ... # type: Any - -class DockerVolume: - from_path = ... # type: Any - to_path = ... # type: Any - how = ... # type: Any - def __init__(self, path, to_path: Optional[Any] = ..., how: Any = ...) -> None: ... - @staticmethod - def volumes_from_str(volumes_as_str): ... - @staticmethod - def volume_from_str(as_str): ... - -def kill_command(container, signal: Optional[Any] = ..., **kwds): ... -def logs_command(container, **kwds): ... -def build_command(image, docker_build_path, **kwds): ... -def build_save_image_command(image, destination, **kwds): ... -def build_pull_command(tag, **kwds): ... -def build_docker_cache_command(image, **kwds): ... -def build_docker_images_command(truncate: bool = ..., **kwds): ... -def build_docker_load_command(**kwds): ... -def build_docker_run_command(container_command, image, interactive: bool = ..., terminal: bool = ..., tag: Optional[Any] = ..., volumes: Any = ..., volumes_from: Any = ..., memory: Any = ..., env_directives: Any = ..., working_directory: Any = ..., name: Optional[Any] = ..., net: Any = ..., run_extra_arguments: Any = ..., docker_cmd: Any = ..., sudo: Any = ..., sudo_cmd: Any = ..., auto_rm: Any = ..., set_user: Any = ..., host: Any = ...): ... -def command_list(command, command_args: Any = ..., **kwds): ... -def command_shell(command, command_args: Any = ..., **kwds): ... diff --git a/typeshed/2and3/galaxy/tools/deps/dockerfiles.pyi b/typeshed/2and3/galaxy/tools/deps/dockerfiles.pyi deleted file mode 100644 index 3cf02d56..00000000 --- a/typeshed/2and3/galaxy/tools/deps/dockerfiles.pyi +++ /dev/null @@ -1,15 +0,0 @@ -# Stubs for galaxy.tools.deps.dockerfiles (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any, Optional -from ..deps import commands as commands -from ..deps import docker_util as docker_util -from ..deps.containers import docker_cache_path as docker_cache_path -from ..deps.requirements import parse_requirements_from_xml as parse_requirements_from_xml -from ...tools import loader_directory as loader_directory - -log = ... # type: Any - -def docker_host_args(**kwds): ... -def dockerfile_build(path, dockerfile: Optional[Any] = ..., error: Any = ..., **kwds): ... diff --git a/typeshed/2and3/galaxy/tools/deps/installable.pyi b/typeshed/2and3/galaxy/tools/deps/installable.pyi deleted file mode 100644 index 818eaa26..00000000 --- a/typeshed/2and3/galaxy/tools/deps/installable.pyi +++ /dev/null @@ -1,15 +0,0 @@ -# Stubs for galaxy.tools.deps.installable (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any - -log = ... # type: Any - -class InstallableContext: - def is_installed(self): ... - def can_install(self): ... - def installable_description(self): ... - def parent_path(self): ... - -def ensure_installed(installable_context, install_func, auto_init): ... diff --git a/typeshed/2and3/galaxy/tools/deps/mulled/__init__.pyi b/typeshed/2and3/galaxy/tools/deps/mulled/__init__.pyi deleted file mode 100644 index a3f6bf31..00000000 --- a/typeshed/2and3/galaxy/tools/deps/mulled/__init__.pyi +++ /dev/null @@ -1,4 +0,0 @@ -# Stubs for galaxy.tools.deps.mulled (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - diff --git a/typeshed/2and3/galaxy/tools/deps/mulled/_cli.pyi b/typeshed/2and3/galaxy/tools/deps/mulled/_cli.pyi deleted file mode 100644 index db35991c..00000000 --- a/typeshed/2and3/galaxy/tools/deps/mulled/_cli.pyi +++ /dev/null @@ -1,5 +0,0 @@ -# Stubs for galaxy.tools.deps.mulled._cli (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -def arg_parser(argv, globals): ... diff --git a/typeshed/2and3/galaxy/tools/deps/mulled/mulled_build.pyi b/typeshed/2and3/galaxy/tools/deps/mulled/mulled_build.pyi deleted file mode 100644 index 25650508..00000000 --- a/typeshed/2and3/galaxy/tools/deps/mulled/mulled_build.pyi +++ /dev/null @@ -1,24 +0,0 @@ -# Stubs for galaxy.tools.deps.mulled.mulled_build (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any, Optional -import installable -from sys import platform as _platform - -class BuildExistsException(Exception): ... - -class InvolucroContext(installable.InstallableContext): - installable_description = ... # type: str - involucro_bin = ... # type: str - shell_exec = ... # type: Any - verbose = ... # type: Any - def __init__(self, involucro_bin: Optional[Any] = ..., shell_exec: Optional[Any] = ..., verbose: str = ...) -> None: ... - def build_command(self, involucro_args): ... - def exec_command(self, involucro_args): ... - def is_installed(self): ... - def can_install(self): ... - @property - def parent_path(self): ... - -def main(argv: Optional[Any] = ...): ... diff --git a/typeshed/2and3/galaxy/tools/deps/mulled/mulled_build_channel.pyi b/typeshed/2and3/galaxy/tools/deps/mulled/mulled_build_channel.pyi deleted file mode 100644 index c0039bf4..00000000 --- a/typeshed/2and3/galaxy/tools/deps/mulled/mulled_build_channel.pyi +++ /dev/null @@ -1,7 +0,0 @@ -# Stubs for galaxy.tools.deps.mulled.mulled_build_channel (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any, Optional - -def main(argv: Optional[Any] = ...): ... diff --git a/typeshed/2and3/galaxy/tools/deps/mulled/mulled_build_files.pyi b/typeshed/2and3/galaxy/tools/deps/mulled/mulled_build_files.pyi deleted file mode 100644 index 0057d4d8..00000000 --- a/typeshed/2and3/galaxy/tools/deps/mulled/mulled_build_files.pyi +++ /dev/null @@ -1,10 +0,0 @@ -# Stubs for galaxy.tools.deps.mulled.mulled_build_files (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any, Optional -from collections import namedtuple - -def main(argv: Optional[Any] = ...): ... - -_Line = namedtuple('_Line', ['targets', 'image_build', 'name_override']) diff --git a/typeshed/2and3/galaxy/tools/deps/mulled/mulled_build_tool.pyi b/typeshed/2and3/galaxy/tools/deps/mulled/mulled_build_tool.pyi deleted file mode 100644 index e4af0dac..00000000 --- a/typeshed/2and3/galaxy/tools/deps/mulled/mulled_build_tool.pyi +++ /dev/null @@ -1,8 +0,0 @@ -# Stubs for galaxy.tools.deps.mulled.mulled_build_tool (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any, Optional - -def main(argv: Optional[Any] = ...): ... -def requirements_to_mulled_targets(requirements): ... diff --git a/typeshed/2and3/galaxy/tools/deps/mulled/mulled_search.pyi b/typeshed/2and3/galaxy/tools/deps/mulled/mulled_search.pyi deleted file mode 100644 index 9c8e9c23..00000000 --- a/typeshed/2and3/galaxy/tools/deps/mulled/mulled_search.pyi +++ /dev/null @@ -1,23 +0,0 @@ -# Stubs for galaxy.tools.deps.mulled.mulled_search (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any, Optional - -requests = ... # type: Any -Schema = ... # type: Any -TEXT = ... # type: Any -STORED = ... # type: Any -create_in = ... # type: Any -QueryParser = ... # type: Any -QUAY_API_URL = ... # type: str - -class QuaySearch: - index = ... # type: Any - organization = ... # type: Any - def __init__(self, organization) -> None: ... - def build_index(self): ... - def search_repository(self, search_string, non_strict): ... - def get_additional_repository_information(self, repository_string): ... - -def main(argv: Optional[Any] = ...): ... diff --git a/typeshed/2and3/galaxy/tools/deps/mulled/util.pyi b/typeshed/2and3/galaxy/tools/deps/mulled/util.pyi deleted file mode 100644 index 33063c28..00000000 --- a/typeshed/2and3/galaxy/tools/deps/mulled/util.pyi +++ /dev/null @@ -1,23 +0,0 @@ -# Stubs for galaxy.tools.deps.mulled.util (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any, Optional -from collections import namedtuple - -def quay_versions(namespace, pkg_name): ... -def mulled_tags_for(namespace, image, tag_prefix: Optional[Any] = ...): ... -def split_tag(tag): ... -def version_sorted(elements): ... - -Target = namedtuple('Target', ['package_name', 'version', 'build']) - -def build_target(package_name, version: Optional[Any] = ..., build: Optional[Any] = ..., tag: Optional[Any] = ...): ... -def conda_build_target_str(target): ... -def v1_image_name(targets, image_build: Optional[Any] = ..., name_override: Optional[Any] = ...): ... -def v2_image_name(targets, image_build: Optional[Any] = ..., name_override: Optional[Any] = ...): ... - -image_name = ... # type: Any - -# Names in __all__ with no definition: -# Target diff --git a/typeshed/2and3/galaxy/tools/deps/requirements.pyi b/typeshed/2and3/galaxy/tools/deps/requirements.pyi deleted file mode 100644 index 9cb78c3a..00000000 --- a/typeshed/2and3/galaxy/tools/deps/requirements.pyi +++ /dev/null @@ -1,75 +0,0 @@ -# Stubs for galaxy.tools.deps.requirements (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any, Dict, List, Optional - -DEFAULT_REQUIREMENT_TYPE = ... # type: str -DEFAULT_REQUIREMENT_VERSION = ... # type: Any - -class ToolRequirement: - name = ... # type: Any - type = ... # type: Any - version = ... # type: Any - specs = ... # type: Any - def __init__(self, name: Optional[Any] = ..., type: Optional[Any] = ..., version: Optional[Any] = ..., specs: Any = ...) -> None: ... - def to_dict(self) -> Dict[str, Any]: ... - def copy(self): ... - @staticmethod - def from_dict(dict: Dict[str, Any]) -> ToolRequirement: ... - def __eq__(self, other): ... - def __ne__(self, other): ... - def __hash__(self): ... - -class RequirementSpecification: - uri = ... # type: Any - version = ... # type: Any - def __init__(self, uri, version: Optional[Any] = ...) -> None: ... - @property - def specifies_version(self): ... - @property - def short_name(self): ... - def to_dict(self): ... - @staticmethod - def from_dict(dict: Dict[str, Any]) -> ToolRequirements: ... - def __eq__(self, other): ... - def __ne__(self, other): ... - def __hash__(self): ... - -class ToolRequirements: - tool_requirements = ... # type: Any - def __init__(self, tool_requirements: Optional[Any] = ...) -> None: ... - @staticmethod - def from_list(requirements: List[ToolRequirement]) -> ToolRequirements: ... - @property - def resolvable(self): ... - @property - def packages(self): ... - def to_list(self) -> List[ToolRequirement]: ... - def append(self, requirement): ... - def __eq__(self, other): ... - def __ne__(self, other): ... - def __iter__(self): ... - def __getitem__(self, ii): ... - def __len__(self): ... - def __hash__(self): ... - -class ToolRequirementsException(Exception): ... - -DEFAULT_CONTAINER_TYPE = ... # type: str -DEFAULT_CONTAINER_RESOLVE_DEPENDENCIES = ... # type: bool -DEFAULT_CONTAINER_SHELL = ... # type: str - -class ContainerDescription: - identifier = ... # type: Any - type = ... # type: Any - resolve_dependencies = ... # type: Any - shell = ... # type: Any - def __init__(self, identifier: Optional[Any] = ..., type: Any = ..., resolve_dependencies: Any = ..., shell: Any = ...) -> None: ... - def to_dict(self): ... - @staticmethod - def from_dict(dict): ... - -def parse_requirements_from_dict(root_dict): ... -def parse_requirements_from_xml(xml_root): ... -def container_from_element(container_elem): ... diff --git a/typeshed/2and3/galaxy/tools/deps/resolvers/__init__.pyi b/typeshed/2and3/galaxy/tools/deps/resolvers/__init__.pyi deleted file mode 100644 index a1ffb20a..00000000 --- a/typeshed/2and3/galaxy/tools/deps/resolvers/__init__.pyi +++ /dev/null @@ -1,62 +0,0 @@ -# Stubs for galaxy.tools.deps.resolvers (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any, Optional -from galaxy.util.dictifiable import Dictifiable -from ..requirements import ToolRequirement as ToolRequirement - -class DependencyResolver(Dictifiable): - dict_collection_visible_keys = ... # type: Any - disabled = ... # type: bool - resolves_simple_dependencies = ... # type: bool - can_uninstall_dependencies = ... # type: bool - config_options = ... # type: Any - def resolve(self, requirement, **kwds): ... - -class MultipleDependencyResolver: - def resolve_all(self, requirements, **kwds): ... - -class ListableDependencyResolver: - def list_dependencies(self): ... - -class MappableDependencyResolver: ... - -FROM_UNVERSIONED = ... # type: Any - -class RequirementMapping: - from_name = ... # type: Any - from_version = ... # type: Any - to_name = ... # type: Any - to_version = ... # type: Any - def __init__(self, from_name, from_version, to_name, to_version) -> None: ... - def matches_requirement(self, requirement): ... - def apply(self, requirement): ... - @staticmethod - def from_dict(raw_mapping): ... - -class SpecificationAwareDependencyResolver: ... -class SpecificationPatternDependencyResolver: ... - -class InstallableDependencyResolver: - def install_dependency(self, name, version, type, **kwds): ... - -class Dependency(Dictifiable): - dict_collection_visible_keys = ... # type: Any - cacheable = ... # type: bool - def shell_commands(self, requirement): ... - def exact(self): ... - @property - def resolver_msg(self): ... - -class NullDependency(Dependency): - dependency_type = ... # type: Any - exact = ... # type: bool - version = ... # type: Any - name = ... # type: Any - def __init__(self, version: Optional[Any] = ..., name: Optional[Any] = ...) -> None: ... - @property - def resolver_msg(self): ... - def shell_commands(self, requirement): ... - -class DependencyException(Exception): ... diff --git a/typeshed/2and3/galaxy/tools/deps/resolvers/brewed_tool_shed_packages.pyi b/typeshed/2and3/galaxy/tools/deps/resolvers/brewed_tool_shed_packages.pyi deleted file mode 100644 index d581de35..00000000 --- a/typeshed/2and3/galaxy/tools/deps/resolvers/brewed_tool_shed_packages.pyi +++ /dev/null @@ -1,33 +0,0 @@ -# Stubs for galaxy.tools.deps.resolvers.brewed_tool_shed_packages (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any -from xml.etree import ElementTree as ET -from .resolver_mixins import UsesHomebrewMixin, UsesInstalledRepositoriesMixin, UsesToolDependencyDirMixin -from ..resolvers import DependencyResolver - -class HomebrewToolShedDependencyResolver(DependencyResolver, UsesHomebrewMixin, UsesToolDependencyDirMixin, UsesInstalledRepositoriesMixin): - resolver_type = ... # type: str - def __init__(self, dependency_manager, **kwds) -> None: ... - def resolve(self, requirement, **kwds): ... - -class RawDependencies: - root = ... # type: Any - dependencies = ... # type: Any - def __init__(self, dependencies_file) -> None: ... - def find(self, package_name, package_version): ... - -class RawDependency: - dependencies = ... # type: Any - package_el = ... # type: Any - repository_el = ... # type: Any - def __init__(self, dependencies, package_el, repository_el) -> None: ... - @property - def repository_owner(self): ... - @property - def repository_name(self): ... - @property - def package_name(self): ... - @property - def package_version(self): ... diff --git a/typeshed/2and3/galaxy/tools/deps/resolvers/conda.pyi b/typeshed/2and3/galaxy/tools/deps/resolvers/conda.pyi deleted file mode 100644 index 333954de..00000000 --- a/typeshed/2and3/galaxy/tools/deps/resolvers/conda.pyi +++ /dev/null @@ -1,72 +0,0 @@ -# Stubs for galaxy.tools.deps.resolvers.conda (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any, Optional -from ..resolvers import Dependency, DependencyResolver, InstallableDependencyResolver, ListableDependencyResolver, MappableDependencyResolver, MultipleDependencyResolver, SpecificationPatternDependencyResolver - -DEFAULT_ENSURE_CHANNELS = ... # type: str - -class CondaDependencyResolver(DependencyResolver, MultipleDependencyResolver, ListableDependencyResolver, InstallableDependencyResolver, SpecificationPatternDependencyResolver, MappableDependencyResolver): - dict_collection_visible_keys = ... # type: Any - resolver_type = ... # type: str - config_options = ... # type: Any - can_uninstall_dependencies = ... # type: bool - versionless = ... # type: Any - dependency_manager = ... # type: Any - conda_prefix_parent = ... # type: Any - ensure_channels = ... # type: Any - auto_init = ... # type: Any - conda_context = ... # type: Any - disabled = ... # type: Any - auto_install = ... # type: Any - copy_dependencies = ... # type: Any - def __init__(self, dependency_manager, **kwds) -> None: ... - def clean(self, **kwds): ... - def uninstall(self, requirements): ... - def uninstall_environments(self, environments): ... - def install_all(self, conda_targets): ... - def resolve_all(self, requirements, **kwds): ... - def merged_environment_name(self, conda_targets): ... - def resolve(self, requirement, **kwds): ... - def unused_dependency_paths(self, toolbox_requirements_status): ... - def list_dependencies(self): ... - def install_dependency(self, name, version, type, **kwds): ... - @property - def prefix(self): ... - -class MergedCondaDependency(Dependency): - dict_collection_visible_keys = ... # type: Any - dependency_type = ... # type: str - activate = ... # type: Any - conda_context = ... # type: Any - environment_path = ... # type: Any - cache_path = ... # type: Any - def __init__(self, conda_context, environment_path, exact, name: Optional[Any] = ..., version: Optional[Any] = ..., preserve_python_environment: bool = ...) -> None: ... - @property - def exact(self): ... - @property - def name(self): ... - @property - def version(self): ... - def shell_commands(self, requirement): ... - -class CondaDependency(Dependency): - dict_collection_visible_keys = ... # type: Any - dependency_type = ... # type: str - cacheable = ... # type: bool - activate = ... # type: Any - conda_context = ... # type: Any - environment_path = ... # type: Any - cache_path = ... # type: Any - def __init__(self, conda_context, environment_path, exact, name: Optional[Any] = ..., version: Optional[Any] = ..., preserve_python_environment: bool = ...) -> None: ... - @property - def exact(self): ... - @property - def name(self): ... - @property - def version(self): ... - def build_cache(self, cache_path): ... - def set_cache_path(self, cache_path): ... - def build_environment(self): ... - def shell_commands(self, requirement): ... diff --git a/typeshed/2and3/galaxy/tools/deps/resolvers/galaxy_packages.pyi b/typeshed/2and3/galaxy/tools/deps/resolvers/galaxy_packages.pyi deleted file mode 100644 index cb4551ff..00000000 --- a/typeshed/2and3/galaxy/tools/deps/resolvers/galaxy_packages.pyi +++ /dev/null @@ -1,35 +0,0 @@ -# Stubs for galaxy.tools.deps.resolvers.galaxy_packages (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any -from .resolver_mixins import UsesToolDependencyDirMixin -from ..resolvers import Dependency, DependencyResolver, ListableDependencyResolver, MappableDependencyResolver - -class GalaxyPackageDependency(Dependency): - dict_collection_visible_keys = ... # type: Any - dependency_type = ... # type: str - script = ... # type: Any - path = ... # type: Any - version = ... # type: Any - name = ... # type: Any - def __init__(self, script, path, version, name, exact: bool = ...) -> None: ... - @property - def exact(self): ... - def shell_commands(self, requirement): ... - -class ToolShedDependency(GalaxyPackageDependency): - dependency_type = ... # type: str - -class BaseGalaxyPackageDependencyResolver(DependencyResolver, UsesToolDependencyDirMixin): - dict_collection_visible_keys = ... # type: Any - dependency_type = ... # type: Any - versionless = ... # type: Any - def __init__(self, dependency_manager, **kwds) -> None: ... - def resolve(self, requirement, **kwds): ... - -class GalaxyPackageDependencyResolver(BaseGalaxyPackageDependencyResolver, ListableDependencyResolver, MappableDependencyResolver): - resolver_type = ... # type: str - def __init__(self, dependency_manager, **kwds) -> None: ... - def resolve(self, requirement, **kwds): ... - def list_dependencies(self): ... diff --git a/typeshed/2and3/galaxy/tools/deps/resolvers/homebrew.pyi b/typeshed/2and3/galaxy/tools/deps/resolvers/homebrew.pyi deleted file mode 100644 index 78961731..00000000 --- a/typeshed/2and3/galaxy/tools/deps/resolvers/homebrew.pyi +++ /dev/null @@ -1,14 +0,0 @@ -# Stubs for galaxy.tools.deps.resolvers.homebrew (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any -from .resolver_mixins import UsesHomebrewMixin -from ..resolvers import DependencyResolver - -class HomebrewDependencyResolver(DependencyResolver, UsesHomebrewMixin): - resolver_type = ... # type: str - versionless = ... # type: Any - prefer_version = ... # type: Any - def __init__(self, dependency_manager, **kwds) -> None: ... - def resolve(self, requirement, **kwds): ... diff --git a/typeshed/2and3/galaxy/tools/deps/resolvers/modules.pyi b/typeshed/2and3/galaxy/tools/deps/resolvers/modules.pyi deleted file mode 100644 index 5762d957..00000000 --- a/typeshed/2and3/galaxy/tools/deps/resolvers/modules.pyi +++ /dev/null @@ -1,42 +0,0 @@ -# Stubs for galaxy.tools.deps.resolvers.modules (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any, Optional -from ..resolvers import Dependency, DependencyResolver, MappableDependencyResolver - -class ModuleDependencyResolver(DependencyResolver, MappableDependencyResolver): - dict_collection_visible_keys = ... # type: Any - resolver_type = ... # type: str - versionless = ... # type: Any - modulecmd = ... # type: Any - modulepath = ... # type: Any - default_indicator = ... # type: Any - module_checker = ... # type: Any - def __init__(self, dependency_manager, **kwds) -> None: ... - def resolve(self, requirement, **kwds): ... - -class DirectoryModuleChecker: - module_dependency_resolver = ... # type: Any - directories = ... # type: Any - def __init__(self, module_dependency_resolver, modulepath, prefetch) -> None: ... - def has_module(self, module, version): ... - -class AvailModuleChecker: - module_dependency_resolver = ... # type: Any - modulepath = ... # type: Any - default_indicator = ... # type: Any - prefetched_modules = ... # type: Any - def __init__(self, module_dependency_resolver, modulepath, prefetch, default_indicator: Any = ...) -> None: ... - def has_module(self, module, version): ... - -class ModuleDependency(Dependency): - dict_collection_visible_keys = ... # type: Any - dependency_type = ... # type: str - module_dependency_resolver = ... # type: Any - module_name = ... # type: Any - module_version = ... # type: Any - def __init__(self, module_dependency_resolver, module_name, module_version: Optional[Any] = ..., exact: bool = ...) -> None: ... - @property - def exact(self): ... - def shell_commands(self, requirement): ... diff --git a/typeshed/2and3/galaxy/tools/deps/resolvers/resolver_mixins.pyi b/typeshed/2and3/galaxy/tools/deps/resolvers/resolver_mixins.pyi deleted file mode 100644 index 2b90a98d..00000000 --- a/typeshed/2and3/galaxy/tools/deps/resolvers/resolver_mixins.pyi +++ /dev/null @@ -1,18 +0,0 @@ -# Stubs for galaxy.tools.deps.resolvers.resolver_mixins (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any -from ..brew_exts import build_env_statements as build_env_statements, DEFAULT_HOMEBREW_ROOT as DEFAULT_HOMEBREW_ROOT, recipe_cellar_path as recipe_cellar_path -from ..resolvers import Dependency as Dependency, NullDependency as NullDependency - -class UsesHomebrewMixin: ... -class UsesToolDependencyDirMixin: ... -class UsesInstalledRepositoriesMixin: ... - -class HomebrewDependency(Dependency): - commands = ... # type: Any - def __init__(self, commands, exact: bool = ...) -> None: ... - @property - def exact(self): ... - def shell_commands(self, requirement): ... diff --git a/typeshed/2and3/galaxy/tools/deps/resolvers/tool_shed_packages.pyi b/typeshed/2and3/galaxy/tools/deps/resolvers/tool_shed_packages.pyi deleted file mode 100644 index 224d377c..00000000 --- a/typeshed/2and3/galaxy/tools/deps/resolvers/tool_shed_packages.pyi +++ /dev/null @@ -1,13 +0,0 @@ -# Stubs for galaxy.tools.deps.resolvers.tool_shed_packages (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any -from .galaxy_packages import BaseGalaxyPackageDependencyResolver -from .resolver_mixins import UsesInstalledRepositoriesMixin - -class ToolShedPackageDependencyResolver(BaseGalaxyPackageDependencyResolver, UsesInstalledRepositoriesMixin): - resolver_type = ... # type: str - dependency_type = ... # type: Any - resolves_simple_dependencies = ... # type: bool - def __init__(self, dependency_manager, **kwds) -> None: ... diff --git a/typeshed/2and3/galaxy/tools/deps/resolvers/unlinked_tool_shed_packages.pyi b/typeshed/2and3/galaxy/tools/deps/resolvers/unlinked_tool_shed_packages.pyi deleted file mode 100644 index ddf2ee04..00000000 --- a/typeshed/2and3/galaxy/tools/deps/resolvers/unlinked_tool_shed_packages.pyi +++ /dev/null @@ -1,25 +0,0 @@ -# Stubs for galaxy.tools.deps.resolvers.unlinked_tool_shed_packages (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any -from .galaxy_packages import BaseGalaxyPackageDependencyResolver -from ..resolvers import Dependency - -class UnlinkedToolShedPackageDependencyResolver(BaseGalaxyPackageDependencyResolver): - dict_collection_visible_keys = ... # type: Any - resolver_type = ... # type: str - preferred_owners = ... # type: Any - select_by_owner = ... # type: Any - def __init__(self, dependency_manager, **kwds) -> None: ... - -class CandidateDependency(Dependency): - dict_collection_visible_keys = ... # type: Any - dependency_type = ... # type: str - @property - def exact(self): ... - dependency = ... # type: Any - path = ... # type: Any - owner = ... # type: Any - def __init__(self, dependency, path, owner: Any = ...) -> None: ... - def shell_commands(self, requirement): ... diff --git a/typeshed/2and3/galaxy/tools/deps/singularity_util.pyi b/typeshed/2and3/galaxy/tools/deps/singularity_util.pyi deleted file mode 100644 index a701d1fd..00000000 --- a/typeshed/2and3/galaxy/tools/deps/singularity_util.pyi +++ /dev/null @@ -1,7 +0,0 @@ -# Stubs for galaxy.tools.deps.singularity_util (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any - -def build_singularity_run_command(container_command, image, volumes: Any = ..., env: Any = ..., working_directory: Any = ..., singularity_cmd: Any = ..., run_extra_arguments: Any = ..., sudo: Any = ..., sudo_cmd: Any = ...): ... diff --git a/typeshed/2and3/galaxy/tools/deps/views.pyi b/typeshed/2and3/galaxy/tools/deps/views.pyi deleted file mode 100644 index 2f579901..00000000 --- a/typeshed/2and3/galaxy/tools/deps/views.pyi +++ /dev/null @@ -1,32 +0,0 @@ -# Stubs for galaxy.tools.deps.views (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any, Optional - -class DependencyResolversView: - def __init__(self, app) -> None: ... - def index(self): ... - def show(self, index): ... - def reload(self): ... - def manager_requirements(self): ... - def resolver_requirements(self, index): ... - def manager_dependency(self, **kwds): ... - def resolver_dependency(self, index, **kwds): ... - def show_dependencies(self, tool_requirements_d, installed_tool_dependencies: Optional[Any] = ...): ... - def uninstall_dependencies(self, index: Optional[Any] = ..., **payload): ... - @property - def unused_dependency_paths(self): ... - def remove_unused_dependency_paths(self, envs): ... - def install_dependencies(self, requirements): ... - def install_dependency(self, index: Optional[Any] = ..., **payload): ... - @property - def installable_resolvers(self): ... - @property - def uninstallable_resolvers(self): ... - @property - def tool_ids_by_requirements(self): ... - @property - def toolbox_requirements_status(self): ... - def get_requirements_status(self, tool_requirements_d, installed_tool_dependencies: Optional[Any] = ...): ... - def clean(self, index: Optional[Any] = ..., **kwds): ... diff --git a/typeshed/2and3/galaxy/tools/fetcher.pyi b/typeshed/2and3/galaxy/tools/fetcher.pyi deleted file mode 100644 index 221bc58a..00000000 --- a/typeshed/2and3/galaxy/tools/fetcher.pyi +++ /dev/null @@ -1,10 +0,0 @@ -# Stubs for galaxy.tools.fetcher (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any - -class ToolLocationFetcher: - resolver_classes = ... # type: Any - def __init__(self) -> None: ... - def to_tool_path(self, path_or_uri_like, **kwds): ... diff --git a/typeshed/2and3/galaxy/tools/lint.pyi b/typeshed/2and3/galaxy/tools/lint.pyi deleted file mode 100644 index 9cd7a263..00000000 --- a/typeshed/2and3/galaxy/tools/lint.pyi +++ /dev/null @@ -1,33 +0,0 @@ -# Stubs for galaxy.tools.lint (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any -from .parser import get_tool_source as get_tool_source - -LEVEL_ALL = ... # type: str -LEVEL_WARN = ... # type: str -LEVEL_ERROR = ... # type: str - -def lint_tool_source(tool_source, level: Any = ..., fail_level: Any = ..., extra_modules: Any = ..., skip_types: Any = ...): ... -def lint_xml(tool_xml, level: Any = ..., fail_level: Any = ..., extra_modules: Any = ..., skip_types: Any = ...): ... -def lint_tool_source_with(lint_context, tool_source, extra_modules: Any = ...): ... -def lint_xml_with(lint_context, tool_xml, extra_modules: Any = ...): ... - -class LintContext: - skip_types = ... # type: Any - level = ... # type: Any - found_errors = ... # type: bool - found_warns = ... # type: bool - def __init__(self, level, skip_types: Any = ...) -> None: ... - printed_linter_info = ... # type: bool - valid_messages = ... # type: Any - info_messages = ... # type: Any - warn_messages = ... # type: Any - error_messages = ... # type: Any - def lint(self, name, lint_func, lint_target): ... - def valid(self, message, *args): ... - def info(self, message, *args): ... - def error(self, message, *args): ... - def warn(self, message, *args): ... - def failed(self, fail_level): ... diff --git a/typeshed/2and3/galaxy/tools/lint_util.pyi b/typeshed/2and3/galaxy/tools/lint_util.pyi deleted file mode 100644 index e1e1ac02..00000000 --- a/typeshed/2and3/galaxy/tools/lint_util.pyi +++ /dev/null @@ -1,5 +0,0 @@ -# Stubs for galaxy.tools.lint_util (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -def is_datasource(tool_xml): ... diff --git a/typeshed/2and3/galaxy/tools/linters/__init__.pyi b/typeshed/2and3/galaxy/tools/linters/__init__.pyi deleted file mode 100644 index 7f56312c..00000000 --- a/typeshed/2and3/galaxy/tools/linters/__init__.pyi +++ /dev/null @@ -1,4 +0,0 @@ -# Stubs for galaxy.tools.linters (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - diff --git a/typeshed/2and3/galaxy/tools/linters/citations.pyi b/typeshed/2and3/galaxy/tools/linters/citations.pyi deleted file mode 100644 index 5378b8de..00000000 --- a/typeshed/2and3/galaxy/tools/linters/citations.pyi +++ /dev/null @@ -1,5 +0,0 @@ -# Stubs for galaxy.tools.linters.citations (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -def lint_citations(tool_xml, lint_ctx): ... diff --git a/typeshed/2and3/galaxy/tools/linters/command.pyi b/typeshed/2and3/galaxy/tools/linters/command.pyi deleted file mode 100644 index 2e686353..00000000 --- a/typeshed/2and3/galaxy/tools/linters/command.pyi +++ /dev/null @@ -1,6 +0,0 @@ -# Stubs for galaxy.tools.linters.command (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -def lint_command(tool_xml, lint_ctx): ... -def get_command(tool_xml): ... diff --git a/typeshed/2and3/galaxy/tools/linters/cwl.pyi b/typeshed/2and3/galaxy/tools/linters/cwl.pyi deleted file mode 100644 index a94292e4..00000000 --- a/typeshed/2and3/galaxy/tools/linters/cwl.pyi +++ /dev/null @@ -1,12 +0,0 @@ -# Stubs for galaxy.tools.linters.cwl (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any - -lint_tool_types = ... # type: Any - -def lint_cwl_validation(tool_source, lint_ctx): ... -def lint_new_draft(tool_source, lint_ctx): ... -def lint_docker_image(tool_source, lint_ctx): ... -def lint_description(tool_source, lint_ctx): ... diff --git a/typeshed/2and3/galaxy/tools/linters/general.pyi b/typeshed/2and3/galaxy/tools/linters/general.pyi deleted file mode 100644 index 812e6e9f..00000000 --- a/typeshed/2and3/galaxy/tools/linters/general.pyi +++ /dev/null @@ -1,19 +0,0 @@ -# Stubs for galaxy.tools.linters.general (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any - -ERROR_VERSION_MSG = ... # type: str -VALID_VERSION_MSG = ... # type: str -ERROR_NAME_MSG = ... # type: str -VALID_NAME_MSG = ... # type: str -ERROR_ID_MSG = ... # type: str -VALID_ID_MSG = ... # type: str -PROFILE_PATTERN = ... # type: Any -PROFILE_INFO_DEFAULT_MSG = ... # type: str -PROFILE_INFO_SPECIFIED_MSG = ... # type: str -PROFILE_INVALID_MSG = ... # type: str -lint_tool_types = ... # type: Any - -def lint_general(tool_source, lint_ctx): ... diff --git a/typeshed/2and3/galaxy/tools/linters/help.pyi b/typeshed/2and3/galaxy/tools/linters/help.pyi deleted file mode 100644 index 306fa3bd..00000000 --- a/typeshed/2and3/galaxy/tools/linters/help.pyi +++ /dev/null @@ -1,6 +0,0 @@ -# Stubs for galaxy.tools.linters.help (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -def lint_help(tool_xml, lint_ctx): ... -def rst_invalid(text): ... diff --git a/typeshed/2and3/galaxy/tools/linters/inputs.pyi b/typeshed/2and3/galaxy/tools/linters/inputs.pyi deleted file mode 100644 index c06f46c9..00000000 --- a/typeshed/2and3/galaxy/tools/linters/inputs.pyi +++ /dev/null @@ -1,8 +0,0 @@ -# Stubs for galaxy.tools.linters.inputs (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from ..lint_util import is_datasource as is_datasource - -def lint_inputs(tool_xml, lint_ctx): ... -def lint_repeats(tool_xml, lint_ctx): ... diff --git a/typeshed/2and3/galaxy/tools/linters/outputs.pyi b/typeshed/2and3/galaxy/tools/linters/outputs.pyi deleted file mode 100644 index ecb92209..00000000 --- a/typeshed/2and3/galaxy/tools/linters/outputs.pyi +++ /dev/null @@ -1,5 +0,0 @@ -# Stubs for galaxy.tools.linters.outputs (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -def lint_output(tool_xml, lint_ctx): ... diff --git a/typeshed/2and3/galaxy/tools/linters/stdio.pyi b/typeshed/2and3/galaxy/tools/linters/stdio.pyi deleted file mode 100644 index d7c2927c..00000000 --- a/typeshed/2and3/galaxy/tools/linters/stdio.pyi +++ /dev/null @@ -1,7 +0,0 @@ -# Stubs for galaxy.tools.linters.stdio (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from .command import get_command as get_command - -def lint_stdio(tool_source, lint_ctx): ... diff --git a/typeshed/2and3/galaxy/tools/linters/tests.pyi b/typeshed/2and3/galaxy/tools/linters/tests.pyi deleted file mode 100644 index d9c7cf0f..00000000 --- a/typeshed/2and3/galaxy/tools/linters/tests.pyi +++ /dev/null @@ -1,7 +0,0 @@ -# Stubs for galaxy.tools.linters.tests (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from ..lint_util import is_datasource as is_datasource - -def lint_tsts(tool_xml, lint_ctx): ... diff --git a/typeshed/2and3/galaxy/tools/linters/xml_order.pyi b/typeshed/2and3/galaxy/tools/linters/xml_order.pyi deleted file mode 100644 index a3904f6c..00000000 --- a/typeshed/2and3/galaxy/tools/linters/xml_order.pyi +++ /dev/null @@ -1,10 +0,0 @@ -# Stubs for galaxy.tools.linters.xml_order (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any - -TAG_ORDER = ... # type: Any -DATASOURCE_TAG_ORDER = ... # type: Any - -def lint_xml_order(tool_xml, lint_ctx): ... diff --git a/typeshed/2and3/galaxy/tools/loader.pyi b/typeshed/2and3/galaxy/tools/loader.pyi deleted file mode 100644 index 4e7cd7fd..00000000 --- a/typeshed/2and3/galaxy/tools/loader.pyi +++ /dev/null @@ -1,8 +0,0 @@ -# Stubs for galaxy.tools.loader (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any -from galaxy.util.xml_macros import imported_macro_paths as imported_macro_paths, raw_tool_xml_tree as raw_tool_xml_tree, template_macro_params as template_macro_params - -load_tool = ... # type: Any diff --git a/typeshed/2and3/galaxy/tools/loader_directory.pyi b/typeshed/2and3/galaxy/tools/loader_directory.pyi deleted file mode 100644 index 628289f7..00000000 --- a/typeshed/2and3/galaxy/tools/loader_directory.pyi +++ /dev/null @@ -1,15 +0,0 @@ -# Stubs for galaxy.tools.loader_directory (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any, Optional - -def find_possible_tools_from_path(path, recursive: bool = ..., enable_beta_formats: bool = ...): ... -def load_tool_sources_from_path(path, load_exception_handler: Any = ..., recursive: bool = ..., register_load_errors: bool = ...): ... -def load_tool_elements_from_path(path, load_exception_handler: Any = ..., recursive: bool = ..., register_load_errors: bool = ...): ... -def is_tool_load_error(obj): ... -def looks_like_a_tool_xml(path): ... -def is_a_yaml_with_class(path, classes): ... -def looks_like_a_tool_yaml(path): ... -def looks_like_a_cwl_artifact(path, classes: Optional[Any] = ...): ... -def looks_like_a_tool_cwl(path): ... diff --git a/typeshed/2and3/galaxy/tools/locations/__init__.pyi b/typeshed/2and3/galaxy/tools/locations/__init__.pyi deleted file mode 100644 index af99abd8..00000000 --- a/typeshed/2and3/galaxy/tools/locations/__init__.pyi +++ /dev/null @@ -1,7 +0,0 @@ -# Stubs for galaxy.tools.locations (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -class ToolLocationResolver: - def scheme(self): ... - def get_tool_source_path(self, uri_like): ... diff --git a/typeshed/2and3/galaxy/tools/locations/dockstore.pyi b/typeshed/2and3/galaxy/tools/locations/dockstore.pyi deleted file mode 100644 index 3420e1eb..00000000 --- a/typeshed/2and3/galaxy/tools/locations/dockstore.pyi +++ /dev/null @@ -1,19 +0,0 @@ -# Stubs for galaxy.tools.locations.dockstore (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any -from ..locations import ToolLocationResolver - -class DockStoreResolver(ToolLocationResolver): - scheme = ... # type: str - def get_tool_source_path(self, uri_like): ... - -class _Ga4ghToolClient: - base_url = ... # type: Any - def __init__(self, base_url: str = ...) -> None: ... - def get_tools(self): ... - def get_tool(self, tool_id): ... - def get_tool_version(self, tool_id, version: str = ...): ... - def get_tool_descriptor(self, tool_id, version: str = ..., tool_type: str = ...): ... - def get_tool_cwl(self, tool_id, version: str = ..., as_string: bool = ...): ... diff --git a/typeshed/2and3/galaxy/tools/locations/file.pyi b/typeshed/2and3/galaxy/tools/locations/file.pyi deleted file mode 100644 index 8268d650..00000000 --- a/typeshed/2and3/galaxy/tools/locations/file.pyi +++ /dev/null @@ -1,9 +0,0 @@ -# Stubs for galaxy.tools.locations.file (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from ..locations import ToolLocationResolver as ToolLocationResolver - -class HttpToolResolver(ToolLocationResolver): - scheme = ... # type: str - def get_tool_source_path(self, uri_like): ... diff --git a/typeshed/2and3/galaxy/tools/locations/http.pyi b/typeshed/2and3/galaxy/tools/locations/http.pyi deleted file mode 100644 index 2687afce..00000000 --- a/typeshed/2and3/galaxy/tools/locations/http.pyi +++ /dev/null @@ -1,13 +0,0 @@ -# Stubs for galaxy.tools.locations.http (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from ..locations import ToolLocationResolver - -class HttpToolResolver(ToolLocationResolver): - scheme = ... # type: str - def __init__(self, **kwds) -> None: ... - def get_tool_source_path(self, uri_like): ... - -class HttpsToolResolver(HttpToolResolver): - scheme = ... # type: str diff --git a/typeshed/2and3/galaxy/tools/parser/__init__.pyi b/typeshed/2and3/galaxy/tools/parser/__init__.pyi deleted file mode 100644 index 0b1bc814..00000000 --- a/typeshed/2and3/galaxy/tools/parser/__init__.pyi +++ /dev/null @@ -1,7 +0,0 @@ -# Stubs for galaxy.tools.parser (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from .factory import get_input_source as get_input_source, get_tool_source as get_tool_source -from .interface import ToolSource as ToolSource -from .output_objects import ToolOutputCollectionPart as ToolOutputCollectionPart diff --git a/typeshed/2and3/galaxy/tools/parser/cwl.pyi b/typeshed/2and3/galaxy/tools/parser/cwl.pyi deleted file mode 100644 index 1b754a91..00000000 --- a/typeshed/2and3/galaxy/tools/parser/cwl.pyi +++ /dev/null @@ -1,41 +0,0 @@ -# Stubs for galaxy.tools.parser.cwl (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any -from .interface import PageSource as PageSource -from .interface import PagesSource as PagesSource -from .interface import ToolSource as ToolSource -from .interface import ToolStdioExitCode as ToolStdioExitCode -from .output_actions import ToolOutputActionGroup as ToolOutputActionGroup -from .output_objects import ToolOutput as ToolOutput -from .yaml import YamlInputSource as YamlInputSource - -log = ... # type: Any - -class CwlToolSource(ToolSource): - def __init__(self, tool_file, strict_cwl_validation: bool = ...) -> None: ... - @property - def tool_proxy(self): ... - def parse_tool_type(self): ... - def parse_id(self): ... - def parse_name(self): ... - def parse_command(self): ... - def parse_environment_variables(self): ... - def parse_edam_operations(self): ... - def parse_edam_topics(self): ... - def parse_help(self): ... - def parse_sanitize(self): ... - def parse_strict_shell(self): ... - def parse_stdio(self): ... - def parse_interpreter(self): ... - def parse_version(self): ... - def parse_description(self): ... - def parse_input_pages(self): ... - def parse_outputs(self, tool): ... - def parse_requirements_and_containers(self): ... - def parse_profile(self): ... - -class CwlPageSource(PageSource): - def __init__(self, tool_proxy) -> None: ... - def parse_input_sources(self): ... diff --git a/typeshed/2and3/galaxy/tools/parser/factory.pyi b/typeshed/2and3/galaxy/tools/parser/factory.pyi deleted file mode 100644 index c6b63d09..00000000 --- a/typeshed/2and3/galaxy/tools/parser/factory.pyi +++ /dev/null @@ -1,9 +0,0 @@ -# Stubs for galaxy.tools.parser.factory (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any, Optional -from galaxy.tools.loader import load_tool as load_tool_xml - -def get_tool_source(config_file: Optional[Any] = ..., xml_tree: Optional[Any] = ..., enable_beta_formats: bool = ..., tool_location_fetcher: Optional[Any] = ...): ... -def get_input_source(content): ... diff --git a/typeshed/2and3/galaxy/tools/parser/interface.pyi b/typeshed/2and3/galaxy/tools/parser/interface.pyi deleted file mode 100644 index e219c74a..00000000 --- a/typeshed/2and3/galaxy/tools/parser/interface.pyi +++ /dev/null @@ -1,96 +0,0 @@ -# Stubs for galaxy.tools.parser.interface (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any, Optional - -NOT_IMPLEMENTED_MESSAGE = ... # type: str - -class ToolSource: - default_is_multi_byte = ... # type: bool - def parse_id(self): ... - def parse_version(self): ... - def parse_tool_module(self): ... - def parse_action_module(self): ... - def parse_tool_type(self): ... - def parse_name(self): ... - def parse_description(self): ... - def parse_is_multi_byte(self): ... - def parse_display_interface(self, default): ... - def parse_require_login(self, default): ... - def parse_request_param_translation_elem(self): ... - def parse_command(self): ... - def parse_environment_variables(self): ... - def parse_interpreter(self): ... - def parse_redirect_url_params_elem(self): ... - def parse_version_command(self): ... - def parse_version_command_interpreter(self): ... - def parse_parallelism(self): ... - def parse_hidden(self): ... - def parse_sanitize(self): ... - def parse_refresh(self): ... - def parse_requirements_and_containers(self): ... - def parse_input_pages(self): ... - def parse_outputs(self, tool): ... - def parse_strict_shell(self): ... - def parse_stdio(self): ... - def parse_help(self): ... - def parse_profile(self): ... - def parse_tests_to_dict(self): ... - -class PagesSource: - page_sources = ... # type: Any - def __init__(self, page_sources) -> None: ... - @property - def inputs_defined(self): ... - -class PageSource: - def parse_display(self): ... - def parse_input_sources(self): ... - -class InputSource: - default_optional = ... # type: bool - def elem(self): ... - def get(self, key, value: Optional[Any] = ...): ... - def get_bool(self, key, default): ... - def parse_label(self): ... - def parse_help(self): ... - def parse_sanitizer_elem(self): ... - def parse_validator_elems(self): ... - def parse_optional(self, default: Optional[Any] = ...): ... - def parse_dynamic_options_elem(self): ... - def parse_static_options(self): ... - def parse_conversion_tuples(self): ... - def parse_nested_inputs_source(self): ... - def parse_test_input_source(self): ... - def parse_when_input_sources(self): ... - -class ToolStdioRegex: - match = ... # type: str - stdout_match = ... # type: bool - stderr_match = ... # type: bool - error_level = ... # type: str - desc = ... # type: str - def __init__(self) -> None: ... - -class ToolStdioExitCode: - range_start = ... # type: Any - range_end = ... # type: Any - error_level = ... # type: str - desc = ... # type: str - def __init__(self) -> None: ... - -class TestCollectionDef: - elements = ... # type: Any - collection_type = ... # type: Any - name = ... # type: Any - def __init__(self, elem, parse_param_elem) -> None: ... - def collect_inputs(self): ... - -class TestCollectionOutputDef: - name = ... # type: Any - collection_type = ... # type: Any - count = ... # type: Any - attrib = ... # type: Any - element_tests = ... # type: Any - def __init__(self, name, attrib, element_tests) -> None: ... diff --git a/typeshed/2and3/galaxy/tools/parser/output_actions.pyi b/typeshed/2and3/galaxy/tools/parser/output_actions.pyi deleted file mode 100644 index 5945acdc..00000000 --- a/typeshed/2and3/galaxy/tools/parser/output_actions.pyi +++ /dev/null @@ -1,215 +0,0 @@ -# Stubs for galaxy.tools.parser.output_actions (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any - -log = ... # type: Any -COLLECTION_ATTRIBUTES = ... # type: Any - -class ToolOutputActionGroup: - tag = ... # type: str - parent = ... # type: Any - actions = ... # type: Any - def __init__(self, parent, config_elem) -> None: ... - def apply_action(self, output_dataset, other_values): ... - @property - def tool(self): ... - def __len__(self): ... - -class ToolOutputActionConditionalWhen(ToolOutputActionGroup): - tag = ... # type: str - @classmethod - def from_elem(cls, parent, when_elem): ... - value = ... # type: Any - def __init__(self, parent, config_elem, value) -> None: ... - def is_case(self, output_dataset, other_values): ... - def get_ref(self, output_dataset, other_values): ... - def apply_action(self, output_dataset, other_values): ... - -class ValueToolOutputActionConditionalWhen(ToolOutputActionConditionalWhen): - tag = ... # type: str - def is_case(self, output_dataset, other_values): ... - -class DatatypeIsInstanceToolOutputActionConditionalWhen(ToolOutputActionConditionalWhen): - tag = ... # type: str - value = ... # type: Any - def __init__(self, parent, config_elem, value) -> None: ... - def is_case(self, output_dataset, other_values): ... - -class ToolOutputActionConditional: - tag = ... # type: str - parent = ... # type: Any - name = ... # type: Any - cases = ... # type: Any - def __init__(self, parent, config_elem) -> None: ... - def apply_action(self, output_dataset, other_values): ... - @property - def tool(self): ... - -class ToolOutputAction: - tag = ... # type: str - @classmethod - def from_elem(cls, parent, elem): ... - parent = ... # type: Any - default = ... # type: Any - option = ... # type: Any - def __init__(self, parent, elem) -> None: ... - def apply_action(self, output_dataset, other_values): ... - @property - def tool(self): ... - -class ToolOutputActionOption: - tag = ... # type: str - @classmethod - def from_elem(cls, parent, elem): ... - parent = ... # type: Any - filters = ... # type: Any - def __init__(self, parent, elem) -> None: ... - def get_value(self, other_values): ... - @property - def tool(self): ... - -class NullToolOutputActionOption(ToolOutputActionOption): - tag = ... # type: str - def get_value(self, other_values): ... - -class FromFileToolOutputActionOption(ToolOutputActionOption): - tag = ... # type: str - name = ... # type: Any - column = ... # type: Any - offset = ... # type: Any - separator = ... # type: Any - options = ... # type: Any - def __init__(self, parent, elem) -> None: ... - def get_value(self, other_values): ... - -class FromParamToolOutputActionOption(ToolOutputActionOption): - tag = ... # type: str - name = ... # type: Any - column = ... # type: Any - offset = ... # type: Any - param_attribute = ... # type: Any - def __init__(self, parent, elem) -> None: ... - def get_value(self, other_values): ... - -class FromDataTableOutputActionOption(ToolOutputActionOption): - tag = ... # type: str - name = ... # type: Any - missing_tool_data_table_name = ... # type: Any - options = ... # type: Any - column = ... # type: Any - offset = ... # type: Any - def __init__(self, parent, elem) -> None: ... - def get_value(self, other_values): ... - -class MetadataToolOutputAction(ToolOutputAction): - tag = ... # type: str - name = ... # type: Any - def __init__(self, parent, elem) -> None: ... - def apply_action(self, output_dataset, other_values): ... - -class FormatToolOutputAction(ToolOutputAction): - tag = ... # type: str - default = ... # type: Any - def __init__(self, parent, elem) -> None: ... - def apply_action(self, output_dataset, other_values): ... - -class ToolOutputActionOptionFilter: - tag = ... # type: str - @classmethod - def from_elem(cls, parent, elem): ... - parent = ... # type: Any - def __init__(self, parent, elem) -> None: ... - def filter_options(self, options, other_values): ... - @property - def tool(self): ... - -class ParamValueToolOutputActionOptionFilter(ToolOutputActionOptionFilter): - tag = ... # type: str - ref = ... # type: Any - value = ... # type: Any - column = ... # type: Any - keep = ... # type: Any - compare = ... # type: Any - cast = ... # type: Any - param_attribute = ... # type: Any - def __init__(self, parent, elem) -> None: ... - def filter_options(self, options, other_values): ... - -class InsertColumnToolOutputActionOptionFilter(ToolOutputActionOptionFilter): - tag = ... # type: str - ref = ... # type: Any - value = ... # type: Any - column = ... # type: Any - iterate = ... # type: Any - def __init__(self, parent, elem) -> None: ... - def filter_options(self, options, other_values): ... - -class MultipleSplitterFilter(ToolOutputActionOptionFilter): - tag = ... # type: str - column = ... # type: Any - separator = ... # type: Any - def __init__(self, parent, elem) -> None: ... - def filter_options(self, options, other_values): ... - -class ColumnStripFilter(ToolOutputActionOptionFilter): - tag = ... # type: str - column = ... # type: Any - strip = ... # type: Any - def __init__(self, parent, elem) -> None: ... - def filter_options(self, options, other_values): ... - -class ColumnReplaceFilter(ToolOutputActionOptionFilter): - tag = ... # type: str - old_column = ... # type: Any - old_value = ... # type: Any - new_value = ... # type: Any - new_column = ... # type: Any - column = ... # type: Any - def __init__(self, parent, elem) -> None: ... - def filter_options(self, options, other_values): ... - -class MetadataValueFilter(ToolOutputActionOptionFilter): - tag = ... # type: str - ref = ... # type: Any - name = ... # type: Any - column = ... # type: Any - keep = ... # type: Any - compare = ... # type: Any - def __init__(self, parent, elem) -> None: ... - def filter_options(self, options, other_values): ... - -class BooleanFilter(ToolOutputActionOptionFilter): - tag = ... # type: str - column = ... # type: Any - keep = ... # type: Any - cast = ... # type: Any - def __init__(self, parent, elem) -> None: ... - def filter_options(self, options, other_values): ... - -class StringFunctionFilter(ToolOutputActionOptionFilter): - tag = ... # type: str - column = ... # type: Any - function = ... # type: Any - def __init__(self, parent, elem) -> None: ... - def filter_options(self, options, other_values): ... - -action_types = ... # type: Any -option_types = ... # type: Any -filter_types = ... # type: Any - -def parse_cast_attribute(cast): ... -def parse_compare_type(compare): ... -def compare_eq(value1, value2): ... -def compare_neq(value1, value2): ... -def compare_gt(value1, value2): ... -def compare_gte(value1, value2): ... -def compare_lt(value1, value2): ... -def compare_lte(value1, value2): ... -def compare_in(value1, value2): ... -def compare_startswith(value1, value2): ... -def compare_endswith(value1, value2): ... -def compare_re_search(value1, value2): ... - -compare_types = ... # type: Any diff --git a/typeshed/2and3/galaxy/tools/parser/output_collection_def.pyi b/typeshed/2and3/galaxy/tools/parser/output_collection_def.pyi deleted file mode 100644 index 2cc4b1bd..00000000 --- a/typeshed/2and3/galaxy/tools/parser/output_collection_def.pyi +++ /dev/null @@ -1,29 +0,0 @@ -# Stubs for galaxy.tools.parser.output_collection_def (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any - -DEFAULT_EXTRA_FILENAME_PATTERN = ... # type: str -DEFAULT_SORT_BY = ... # type: str -DEFAULT_SORT_COMP = ... # type: str -NAMED_PATTERNS = ... # type: Any -INPUT_DBKEY_TOKEN = ... # type: str -LEGACY_DEFAULT_DBKEY = ... # type: Any - -def dataset_collector_descriptions_from_elem(elem, legacy: bool = ...): ... -def dataset_collector_descriptions_from_list(discover_datasets_dicts): ... - -class DatasetCollectionDescription: - pattern = ... # type: Any - default_dbkey = ... # type: Any - default_ext = ... # type: Any - default_visible = ... # type: Any - directory = ... # type: Any - assign_primary_output = ... # type: Any - sort_reverse = ... # type: bool - sort_key = ... # type: Any - sort_comp = ... # type: Any - def __init__(self, **kwargs) -> None: ... - -DEFAULT_DATASET_COLLECTOR_DESCRIPTION = ... # type: Any diff --git a/typeshed/2and3/galaxy/tools/parser/output_objects.pyi b/typeshed/2and3/galaxy/tools/parser/output_objects.pyi deleted file mode 100644 index 68f824ea..00000000 --- a/typeshed/2and3/galaxy/tools/parser/output_objects.pyi +++ /dev/null @@ -1,68 +0,0 @@ -# Stubs for galaxy.tools.parser.output_objects (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any, Optional -from galaxy.util.dictifiable import Dictifiable - -class ToolOutputBase(Dictifiable): - name = ... # type: Any - label = ... # type: Any - filters = ... # type: Any - hidden = ... # type: Any - collection = ... # type: bool - def __init__(self, name, label: Optional[Any] = ..., filters: Optional[Any] = ..., hidden: bool = ...) -> None: ... - -class ToolOutput(ToolOutputBase): - dict_collection_visible_keys = ... # type: Any - format = ... # type: Any - format_source = ... # type: Any - metadata_source = ... # type: Any - parent = ... # type: Any - actions = ... # type: Any - change_format = ... # type: Any - implicit = ... # type: Any - from_work_dir = ... # type: Any - def __init__(self, name, format: Optional[Any] = ..., format_source: Optional[Any] = ..., metadata_source: Optional[Any] = ..., parent: Optional[Any] = ..., label: Optional[Any] = ..., filters: Optional[Any] = ..., actions: Optional[Any] = ..., hidden: bool = ..., implicit: bool = ...) -> None: ... - def __len__(self): ... - def __getitem__(self, index): ... - def __iter__(self): ... - def to_dict(self, view: str = ..., value_mapper: Optional[Any] = ..., app: Optional[Any] = ...): ... - -class ToolOutputCollection(ToolOutputBase): - collection = ... # type: bool - default_format = ... # type: Any - structure = ... # type: Any - outputs = ... # type: Any - inherit_format = ... # type: Any - inherit_metadata = ... # type: Any - metadata_source = ... # type: Any - format_source = ... # type: Any - change_format = ... # type: Any - def __init__(self, name, structure, label: Optional[Any] = ..., filters: Optional[Any] = ..., hidden: bool = ..., default_format: str = ..., default_format_source: Optional[Any] = ..., default_metadata_source: Optional[Any] = ..., inherit_format: bool = ..., inherit_metadata: bool = ...) -> None: ... - def known_outputs(self, inputs, type_registry): ... - @property - def dynamic_structure(self): ... - @property - def dataset_collector_descriptions(self): ... - -class ToolOutputCollectionStructure: - collection_type = ... # type: Any - collection_type_source = ... # type: Any - structured_like = ... # type: Any - dataset_collector_descriptions = ... # type: Any - dynamic = ... # type: Any - def __init__(self, collection_type, collection_type_source, structured_like, dataset_collector_descriptions) -> None: ... - -class ToolOutputCollectionPart: - output_collection_def = ... # type: Any - element_identifier = ... # type: Any - output_def = ... # type: Any - parent_ids = ... # type: Any - def __init__(self, output_collection_def, element_identifier, output_def, parent_ids: Any = ...) -> None: ... - @property - def effective_output_name(self): ... - @staticmethod - def is_named_collection_part_name(name): ... - @staticmethod - def split_output_name(name): ... diff --git a/typeshed/2and3/galaxy/tools/parser/util.pyi b/typeshed/2and3/galaxy/tools/parser/util.pyi deleted file mode 100644 index 97b33962..00000000 --- a/typeshed/2and3/galaxy/tools/parser/util.pyi +++ /dev/null @@ -1,9 +0,0 @@ -# Stubs for galaxy.tools.parser.util (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from .interface import ToolStdioExitCode as ToolStdioExitCode -from .interface import ToolStdioRegex as ToolStdioRegex - -def error_on_exit_code(): ... -def aggressive_error_checks(): ... diff --git a/typeshed/2and3/galaxy/tools/parser/xml.pyi b/typeshed/2and3/galaxy/tools/parser/xml.pyi deleted file mode 100644 index ffdd7e92..00000000 --- a/typeshed/2and3/galaxy/tools/parser/xml.pyi +++ /dev/null @@ -1,89 +0,0 @@ -# Stubs for galaxy.tools.parser.xml (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any, Optional -from .interface import InputSource as InputSource, PageSource as PageSource, PagesSource as PagesSource, TestCollectionDef as TestCollectionDef, TestCollectionOutputDef as TestCollectionOutputDef, ToolSource as ToolSource, ToolStdioExitCode as ToolStdioExitCode, ToolStdioRegex as ToolStdioRegex -from .output_actions import ToolOutputActionGroup as ToolOutputActionGroup -from .output_collection_def import dataset_collector_descriptions_from_elem as dataset_collector_descriptions_from_elem -from .output_objects import ToolOutput as ToolOutput, ToolOutputCollection as ToolOutputCollection, ToolOutputCollectionStructure as ToolOutputCollectionStructure -from .util import aggressive_error_checks as aggressive_error_checks, error_on_exit_code as error_on_exit_code - -log = ... # type: Any - -class XmlToolSource(ToolSource): - xml_tree = ... # type: Any - root = ... # type: Any - legacy_defaults = ... # type: Any - def __init__(self, xml_tree, source_path: Optional[Any] = ...) -> None: ... - def parse_version(self): ... - def parse_id(self): ... - def parse_tool_module(self): ... - def parse_action_module(self): ... - def parse_tool_type(self): ... - def parse_name(self): ... - def parse_edam_operations(self): ... - def parse_edam_topics(self): ... - def parse_description(self): ... - def parse_is_multi_byte(self): ... - def parse_display_interface(self, default): ... - def parse_require_login(self, default): ... - def parse_request_param_translation_elem(self): ... - def parse_command(self): ... - def parse_environment_variables(self): ... - def parse_interpreter(self): ... - def parse_version_command(self): ... - def parse_version_command_interpreter(self): ... - def parse_parallelism(self): ... - def parse_hidden(self): ... - def parse_redirect_url_params_elem(self): ... - def parse_sanitize(self): ... - def parse_refresh(self): ... - def parse_requirements_and_containers(self): ... - def parse_input_pages(self): ... - def parse_outputs(self, tool): ... - def parse_stdio(self): ... - def parse_strict_shell(self): ... - def parse_help(self): ... - def parse_tests_to_dict(self): ... - def parse_profile(self): ... - -class StdioParser: - stdio_exit_codes = ... # type: Any - stdio_regexes = ... # type: Any - def __init__(self, root) -> None: ... - def parse_stdio_exit_codes(self, stdio_elem): ... - def parse_stdio_regexes(self, stdio_elem): ... - def parse_error_level(self, err_level): ... - -class XmlPagesSource(PagesSource): - input_elem = ... # type: Any - def __init__(self, root) -> None: ... - @property - def inputs_defined(self): ... - -class XmlPageSource(PageSource): - parent_elem = ... # type: Any - def __init__(self, parent_elem) -> None: ... - def parse_display(self): ... - def parse_input_sources(self): ... - -class XmlInputSource(InputSource): - input_elem = ... # type: Any - input_type = ... # type: Any - def __init__(self, input_elem) -> None: ... - def parse_input_type(self): ... - def elem(self): ... - def get(self, key, value: Optional[Any] = ...): ... - def get_bool(self, key, default): ... - def parse_label(self): ... - def parse_help(self): ... - def parse_sanitizer_elem(self): ... - def parse_validator_elems(self): ... - def parse_dynamic_options_elem(self): ... - def parse_static_options(self): ... - def parse_optional(self, default: Optional[Any] = ...): ... - def parse_conversion_tuples(self): ... - def parse_nested_inputs_source(self): ... - def parse_test_input_source(self): ... - def parse_when_input_sources(self): ... diff --git a/typeshed/2and3/galaxy/tools/parser/yaml.pyi b/typeshed/2and3/galaxy/tools/parser/yaml.pyi deleted file mode 100644 index ccf2afdd..00000000 --- a/typeshed/2and3/galaxy/tools/parser/yaml.pyi +++ /dev/null @@ -1,56 +0,0 @@ -# Stubs for galaxy.tools.parser.yaml (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any, Optional -from .interface import InputSource as InputSource -from .interface import PageSource as PageSource -from .interface import PagesSource as PagesSource -from .interface import ToolSource as ToolSource -from .output_actions import ToolOutputActionGroup as ToolOutputActionGroup -from .output_collection_def import dataset_collector_descriptions_from_list as dataset_collector_descriptions_from_list -from .output_objects import ToolOutput as ToolOutput, ToolOutputCollection as ToolOutputCollection, ToolOutputCollectionStructure as ToolOutputCollectionStructure -from .util import error_on_exit_code as error_on_exit_code - -class YamlToolSource(ToolSource): - root_dict = ... # type: Any - def __init__(self, root_dict, source_path: Optional[Any] = ...) -> None: ... - def parse_id(self): ... - def parse_version(self): ... - def parse_name(self): ... - def parse_description(self): ... - def parse_edam_operations(self): ... - def parse_edam_topics(self): ... - def parse_is_multi_byte(self): ... - def parse_sanitize(self): ... - def parse_display_interface(self, default): ... - def parse_require_login(self, default): ... - def parse_command(self): ... - def parse_environment_variables(self): ... - def parse_interpreter(self): ... - def parse_version_command(self): ... - def parse_version_command_interpreter(self): ... - def parse_requirements_and_containers(self): ... - def parse_input_pages(self): ... - def parse_strict_shell(self): ... - def parse_stdio(self): ... - def parse_help(self): ... - def parse_outputs(self, tool): ... - def parse_tests_to_dict(self): ... - def parse_profile(self): ... - -class YamlPageSource(PageSource): - inputs_list = ... # type: Any - def __init__(self, inputs_list) -> None: ... - def parse_input_sources(self): ... - -class YamlInputSource(InputSource): - input_dict = ... # type: Any - def __init__(self, input_dict) -> None: ... - def get(self, key, default: Optional[Any] = ...): ... - def get_bool(self, key, default): ... - def parse_input_type(self): ... - def parse_nested_inputs_source(self): ... - def parse_test_input_source(self): ... - def parse_when_input_sources(self): ... - def parse_static_options(self): ... diff --git a/typeshed/2and3/galaxy/tools/verify/__init__.pyi b/typeshed/2and3/galaxy/tools/verify/__init__.pyi deleted file mode 100644 index 62425538..00000000 --- a/typeshed/2and3/galaxy/tools/verify/__init__.pyi +++ /dev/null @@ -1,18 +0,0 @@ -# Stubs for galaxy.tools.verify (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any, Optional -from .asserts import verify_assertions as verify_assertions -from .test_data import TestDataResolver as TestDataResolver - -log = ... # type: Any -DEFAULT_TEST_DATA_RESOLVER = ... # type: Any - -def verify(item_label, output_content, attributes, filename: Optional[Any] = ..., get_filename: Optional[Any] = ..., keep_outputs_dir: Optional[Any] = ..., verify_extra_files: Optional[Any] = ...): ... -def make_temp_fname(fname: Optional[Any] = ...): ... -def check_command(command, description): ... -def files_diff(file1, file2, attributes: Optional[Any] = ...): ... -def files_re_match(file1, file2, attributes: Optional[Any] = ...): ... -def files_re_match_multiline(file1, file2, attributes: Optional[Any] = ...): ... -def files_contains(file1, file2, attributes: Optional[Any] = ...): ... diff --git a/typeshed/2and3/galaxy/tools/verify/asserts/__init__.pyi b/typeshed/2and3/galaxy/tools/verify/asserts/__init__.pyi deleted file mode 100644 index 3ba17d3d..00000000 --- a/typeshed/2and3/galaxy/tools/verify/asserts/__init__.pyi +++ /dev/null @@ -1,14 +0,0 @@ -# Stubs for galaxy.tools.verify.asserts (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any - -log = ... # type: Any -assertion_module_names = ... # type: Any -assertion_modules = ... # type: Any -full_assertion_module_name = ... # type: Any -assertion_module = ... # type: Any - -def verify_assertions(data, assertion_description_list): ... -def verify_assertion(data, assertion_description): ... diff --git a/typeshed/2and3/galaxy/tools/verify/asserts/tabular.pyi b/typeshed/2and3/galaxy/tools/verify/asserts/tabular.pyi deleted file mode 100644 index 4515eab5..00000000 --- a/typeshed/2and3/galaxy/tools/verify/asserts/tabular.pyi +++ /dev/null @@ -1,6 +0,0 @@ -# Stubs for galaxy.tools.verify.asserts.tabular (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -def get_first_line(output): ... -def assert_has_n_columns(output, n, sep: str = ...): ... diff --git a/typeshed/2and3/galaxy/tools/verify/asserts/text.pyi b/typeshed/2and3/galaxy/tools/verify/asserts/text.pyi deleted file mode 100644 index 549d5348..00000000 --- a/typeshed/2and3/galaxy/tools/verify/asserts/text.pyi +++ /dev/null @@ -1,9 +0,0 @@ -# Stubs for galaxy.tools.verify.asserts.text (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -def assert_has_text(output, text): ... -def assert_not_has_text(output, text): ... -def assert_has_line(output, line): ... -def assert_has_text_matching(output, expression): ... -def assert_has_line_matching(output, expression): ... diff --git a/typeshed/2and3/galaxy/tools/verify/asserts/xml.pyi b/typeshed/2and3/galaxy/tools/verify/asserts/xml.pyi deleted file mode 100644 index 57af9c72..00000000 --- a/typeshed/2and3/galaxy/tools/verify/asserts/xml.pyi +++ /dev/null @@ -1,15 +0,0 @@ -# Stubs for galaxy.tools.verify.asserts.xml (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -def to_xml(output): ... -def xml_find_text(output, path): ... -def xml_find(output, path): ... -def assert_is_valid_xml(output): ... -def assert_has_element_with_path(output, path): ... -def assert_has_n_elements_with_path(output, path, n): ... -def assert_element_text_matches(output, path, expression): ... -def assert_element_text_is(output, path, text): ... -def assert_attribute_matches(output, path, attribute, expression): ... -def assert_attribute_is(output, path, attribute, text): ... -def assert_element_text(output, path, verify_assertions_function, children): ... diff --git a/typeshed/2and3/galaxy/tools/verify/test_data.pyi b/typeshed/2and3/galaxy/tools/verify/test_data.pyi deleted file mode 100644 index 1fe6f0d3..00000000 --- a/typeshed/2and3/galaxy/tools/verify/test_data.pyi +++ /dev/null @@ -1,31 +0,0 @@ -# Stubs for galaxy.tools.verify.test_data (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any - -UPDATE_TEMPLATE = ... # type: Any -UPDATE_FAILED_TEMPLATE = ... # type: Any -LIST_SEP = ... # type: Any - -class TestDataResolver: - resolvers = ... # type: Any - def __init__(self, env_var: str = ..., environ: Any = ...) -> None: ... - def get_filename(self, name): ... - -def build_resolver(uri, environ): ... - -class FileDataResolver: - file_dir = ... # type: Any - def __init__(self, file_dir) -> None: ... - def exists(self, filename): ... - def path(self, filename): ... - -class GitDataResolver(FileDataResolver): - repository = ... # type: Any - updated = ... # type: bool - fetch_data = ... # type: Any - def __init__(self, repository, environ) -> None: ... - def exists(self, filename): ... - def update_repository(self): ... - def execute(self, cmd): ... diff --git a/typeshed/2and3/galaxy/util/__init__.pyi b/typeshed/2and3/galaxy/util/__init__.pyi deleted file mode 100644 index d2c9a1ee..00000000 --- a/typeshed/2and3/galaxy/util/__init__.pyi +++ /dev/null @@ -1,131 +0,0 @@ -# Stubs for galaxy.util (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any, Optional -import collections -from six.moves.urllib import parse as urlparse, request as urlrequest -from .inflection import English as English, Inflector as Inflector - -grp = ... # type: Any -docutils_core = ... # type: Any -docutils_html4css1 = ... # type: Any -inflector = ... # type: Any -log = ... # type: Any -CHUNK_SIZE = ... # type: int -DATABASE_MAX_STRING_SIZE = ... # type: int -DATABASE_MAX_STRING_SIZE_PRETTY = ... # type: str -gzip_magic = ... # type: str -bz2_magic = ... # type: str -DEFAULT_ENCODING = ... # type: Any -NULL_CHAR = ... # type: str -BINARY_CHARS = ... # type: Any -FILENAME_VALID_CHARS = ... # type: str - -def remove_protocol_from_https://github.com/url(url): ... -def is_binary(value, binary_chars: Optional[Any] = ...): ... -def is_uuid(value): ... -def directory_hash_id(id): ... -def get_charset_from_http_headers(headers, default: Optional[Any] = ...): ... -def synchronized(func): ... -def file_iter(fname, sep: Optional[Any] = ...): ... -def file_reader(fp, chunk_size: Any = ...): ... -def unique_id(KEY_SIZE: int = ...): ... -def parse_xml(fname): ... -def parse_xml_string(xml_string): ... -def xml_to_string(elem, pretty: bool = ...): ... -def xml_element_compare(elem1, elem2): ... -def xml_element_list_compare(elem_list1, elem_list2): ... -def xml_element_to_dict(elem): ... -def pretty_print_xml(elem, level: int = ...): ... -def get_file_size(value, default: Optional[Any] = ...): ... -def shrink_stream_by_size(value, size, join_by: str = ..., left_larger: bool = ..., beginning_on_size_error: bool = ..., end_on_size_error: bool = ...): ... -def shrink_string_by_size(value, size, join_by: str = ..., left_larger: bool = ..., beginning_on_size_error: bool = ..., end_on_size_error: bool = ...): ... -def pretty_print_time_interval(time: bool = ..., precise: bool = ...): ... -def pretty_print_json(json_data, is_json_string: bool = ...): ... - -valid_chars = ... # type: Any -mapped_chars = ... # type: Any - -def restore_text(text, character_map: Any = ...): ... -def sanitize_text(text, valid_characters: Any = ..., character_map: Any = ..., invalid_character: str = ...): ... -def sanitize_lists_to_string(values, valid_characters: Any = ..., character_map: Any = ..., invalid_character: str = ...): ... -def sanitize_param(value, valid_characters: Any = ..., character_map: Any = ..., invalid_character: str = ...): ... - -valid_filename_chars = ... # type: Any -invalid_filenames = ... # type: Any - -def sanitize_for_filename(text, default: Optional[Any] = ...): ... -def mask_password_from_https://github.com/url(url): ... -def ready_name_for_url(https://github.com/raw_name): ... -def which(file): ... -def safe_makedirs(path): ... -def in_directory(file, directory, local_path_module: Any = ...): ... -def merge_sorted_iterables(operator, *iterables): ... - -class Params: - NEVER_SANITIZE = ... # type: Any - def __init__(self, params, sanitize: bool = ...) -> None: ... - def flatten(self): ... - def __getattr__(self, name): ... - def get(self, key, default): ... - def __len__(self): ... - def __iter__(self): ... - def update(self, values): ... - -def rst_to_html(s): ... -def xml_text(root, name: Optional[Any] = ...): ... - -truthy = ... # type: Any -falsy = ... # type: Any - -def asbool(obj): ... -def string_as_bool(string): ... -def string_as_bool_or_none(string): ... -def listify(item, do_strip: bool = ...): ... -def commaify(amount): ... -def roundify(amount, sfs: int = ...): ... -def unicodify(value, encoding: Any = ..., error: str = ..., default: Optional[Any] = ...): ... -def smart_str(s, encoding: Any = ..., strings_only: bool = ..., errors: str = ...): ... -def object_to_string(obj): ... -def string_to_object(s): ... - -class ParamsWithSpecs(collections.defaultdict): - specs = ... # type: Any - params = ... # type: Any - def __init__(self, specs: Optional[Any] = ..., params: Optional[Any] = ...) -> None: ... - def __missing__(self, name): ... - def __getattr__(self, name): ... - -def compare_urls(url1, url2, compare_scheme: bool = ..., compare_hostname: bool = ..., compare_path: bool = ...): ... -def read_dbnames(filename): ... -def read_build_sites(filename, check_builds: bool = ...): ... -def relativize_symlinks(path, start: Optional[Any] = ..., followlinks: bool = ...): ... -def stringify_dictionary_keys(in_dict): ... -def recursively_stringify_dictionary_keys(d): ... -def mkstemp_ln(src, prefix: str = ...): ... -def umask_fix_perms(path, umask, unmasked_perms, gid: Optional[Any] = ...): ... -def docstring_trim(docstring): ... -def nice_size(size): ... -def size_to_bytes(size): ... -def send_mail(frm, to, subject, body, config, html: Optional[Any] = ...): ... -def force_symlink(source, link_name): ... -def move_merge(source, target): ... -def safe_str_cmp(a, b): ... - -galaxy_root_path = ... # type: Any - -def galaxy_directory(): ... -def config_directories_from_setting(directories_setting, galaxy_root: Any = ...): ... -def parse_int(value, min_val: Optional[Any] = ..., max_val: Optional[Any] = ..., default: Optional[Any] = ..., allow_none: bool = ...): ... -def parse_non_hex_float(s): ... -def build_url(https://github.com/base_url,%20port:%20int%20=%20...,%20scheme:%20str%20=%20...,%20pathspec:%20Optional[Any]%20=%20...,%20params:%20Optional[Any]%20=%20...,%20doseq:%20bool%20=%20...): ... -def url_get(base_url, password_mgr: Optional[Any] = ..., pathspec: Optional[Any] = ..., params: Optional[Any] = ...): ... -def download_to_file(url, dest_file_path, timeout: int = ..., chunk_size: Any = ...): ... -def safe_relpath(path): ... - -class ExecutionTimer: - begin = ... # type: Any - def __init__(self) -> None: ... - @property - def elapsed(self): ... diff --git a/typeshed/2and3/galaxy/util/aliaspickler.pyi b/typeshed/2and3/galaxy/util/aliaspickler.pyi deleted file mode 100644 index 95c60a9b..00000000 --- a/typeshed/2and3/galaxy/util/aliaspickler.pyi +++ /dev/null @@ -1,20 +0,0 @@ -# Stubs for galaxy.util.aliaspickler (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any -import pickle -from six.moves import cStringIO as StringIO - -class AliasUnpickler(pickle.Unpickler): - aliases = ... # type: Any - def __init__(self, aliases, *args, **kw) -> None: ... - def find_class(self, module, name): ... - -class AliasPickleModule: - aliases = ... # type: Any - def __init__(self, aliases) -> None: ... - def dump(self, obj, fileobj, protocol: int = ...): ... - def dumps(self, obj, protocol: int = ...): ... - def load(self, fileobj): ... - def loads(self, string): ... diff --git a/typeshed/2and3/galaxy/util/bunch.pyi b/typeshed/2and3/galaxy/util/bunch.pyi deleted file mode 100644 index 87dc09bd..00000000 --- a/typeshed/2and3/galaxy/util/bunch.pyi +++ /dev/null @@ -1,17 +0,0 @@ -# Stubs for galaxy.util.bunch (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any, Optional - -class Bunch: - def __init__(self, **kwds) -> None: ... - def dict(self): ... - def get(self, key, default: Optional[Any] = ...): ... - def __iter__(self): ... - def items(self): ... - def keys(self): ... - def values(self): ... - def __nonzero__(self): ... - def __setitem__(self, k, v): ... - def __contains__(self, item): ... diff --git a/typeshed/2and3/galaxy/util/checkers.pyi b/typeshed/2and3/galaxy/util/checkers.pyi deleted file mode 100644 index cdcb3efb..00000000 --- a/typeshed/2and3/galaxy/util/checkers.pyi +++ /dev/null @@ -1,14 +0,0 @@ -# Stubs for galaxy.util.checkers (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any, Optional - -def check_html(file_path, chunk: Optional[Any] = ...): ... -def check_binary(name, file_path: bool = ...): ... -def check_gzip(file_path): ... -def check_bz2(file_path): ... -def check_zip(file_path): ... -def is_bz2(file_path): ... -def is_gzip(file_path): ... -def check_image(file_path): ... diff --git a/typeshed/2and3/galaxy/util/compression_utils.pyi b/typeshed/2and3/galaxy/util/compression_utils.pyi deleted file mode 100644 index 0c6ca3a7..00000000 --- a/typeshed/2and3/galaxy/util/compression_utils.pyi +++ /dev/null @@ -1,7 +0,0 @@ -# Stubs for galaxy.util.compression_utils (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from .checkers import is_bz2 as is_bz2, is_gzip as is_gzip - -def get_fileobj(filename, mode: str = ..., gzip_only: bool = ..., bz2_only: bool = ..., zip_only: bool = ...): ... diff --git a/typeshed/2and3/galaxy/util/dictifiable.pyi b/typeshed/2and3/galaxy/util/dictifiable.pyi deleted file mode 100644 index babdeb4d..00000000 --- a/typeshed/2and3/galaxy/util/dictifiable.pyi +++ /dev/null @@ -1,8 +0,0 @@ -# Stubs for galaxy.util.dictifiable (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any, Optional - -class Dictifiable: - def to_dict(self, view: str = ..., value_mapper: Optional[Any] = ...): ... diff --git a/typeshed/2and3/galaxy/util/expressions.pyi b/typeshed/2and3/galaxy/util/expressions.pyi deleted file mode 100644 index f1eca5ee..00000000 --- a/typeshed/2and3/galaxy/util/expressions.pyi +++ /dev/null @@ -1,18 +0,0 @@ -# Stubs for galaxy.util.expressions (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any, Optional -from collections import MutableMapping - -class ExpressionContext(MutableMapping): - dict = ... # type: Any - parent = ... # type: Any - def __init__(self, dict, parent: Optional[Any] = ...) -> None: ... - def __delitem__(self, key): ... - def __iter__(self): ... - def __len__(self): ... - def __getitem__(self, key): ... - def __setitem__(self, key, value): ... - def __contains__(self, key): ... - def __nonzero__(self): ... diff --git a/typeshed/2and3/galaxy/util/filelock.pyi b/typeshed/2and3/galaxy/util/filelock.pyi deleted file mode 100644 index f74dd9a4..00000000 --- a/typeshed/2and3/galaxy/util/filelock.pyi +++ /dev/null @@ -1,21 +0,0 @@ -# Stubs for galaxy.util.filelock (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any - -class FileLockException(Exception): ... - -class FileLock: - is_locked = ... # type: bool - lockfile = ... # type: Any - file_name = ... # type: Any - timeout = ... # type: Any - delay = ... # type: Any - def __init__(self, file_name, timeout: int = ..., delay: float = ...) -> None: ... - fd = ... # type: Any - def acquire(self): ... - def release(self): ... - def __enter__(self): ... - def __exit__(self, type, value, traceback): ... - def __del__(self): ... diff --git a/typeshed/2and3/galaxy/util/hash_util.pyi b/typeshed/2and3/galaxy/util/hash_util.pyi deleted file mode 100644 index 1a81a16a..00000000 --- a/typeshed/2and3/galaxy/util/hash_util.pyi +++ /dev/null @@ -1,14 +0,0 @@ -# Stubs for galaxy.util.hash_util (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any, Optional -import hashlib as hashlib - -sha1 = ... # type: Any -sha = ... # type: Any -md5 = ... # type: Any - -def new_secure_hash(text_type: Optional[Any] = ...): ... -def hmac_new(key, value): ... -def is_hashable(value): ... diff --git a/typeshed/2and3/galaxy/util/heartbeat.pyi b/typeshed/2and3/galaxy/util/heartbeat.pyi deleted file mode 100644 index e7152ae9..00000000 --- a/typeshed/2and3/galaxy/util/heartbeat.pyi +++ /dev/null @@ -1,30 +0,0 @@ -# Stubs for galaxy.util.heartbeat (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any -import threading - -def get_current_thread_object_dict(): ... - -class Heartbeat(threading.Thread): - config = ... # type: Any - should_stop = ... # type: bool - period = ... # type: Any - fname = ... # type: Any - file = ... # type: Any - fname_nonsleeping = ... # type: Any - file_nonsleeping = ... # type: Any - pid = ... # type: Any - nonsleeping_heartbeats = ... # type: Any - wait_event = ... # type: Any - def __init__(self, config, name: str = ..., period: int = ..., fname: str = ...) -> None: ... - def run(self): ... - def open_logs(self): ... - def close_logs(self): ... - def dump(self): ... - def shutdown(self): ... - def thread_is_sleeping(self, last_stack_frame): ... - def get_interesting_stack_frame(self, stack_frames): ... - def print_nonsleeping(self, threads_object_dict): ... - def dump_signal_handler(self, signum, frame): ... diff --git a/typeshed/2and3/galaxy/util/image_util.pyi b/typeshed/2and3/galaxy/util/image_util.pyi deleted file mode 100644 index ce04019b..00000000 --- a/typeshed/2and3/galaxy/util/image_util.pyi +++ /dev/null @@ -1,13 +0,0 @@ -# Stubs for galaxy.util.image_util (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any -from PIL import Image as PIL - -PIL = ... # type: Any -log = ... # type: Any - -def image_type(filename): ... -def check_image_type(filename, types): ... -def get_image_ext(file_path): ... diff --git a/typeshed/2and3/galaxy/util/inflection.pyi b/typeshed/2and3/galaxy/util/inflection.pyi deleted file mode 100644 index 92f01cb9..00000000 --- a/typeshed/2and3/galaxy/util/inflection.pyi +++ /dev/null @@ -1,46 +0,0 @@ -# Stubs for galaxy.util.inflection (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any - -class Base: - def cond_plural(self, number_of_records, word): ... - def titleize(self, word, uppercase: str = ...): ... - def camelize(self, word): ... - def underscore(self, word): ... - def humanize(self, word, uppercase: str = ...): ... - def variablize(self, word): ... - def tableize(self, class_name): ... - def classify(self, table_name): ... - def ordinalize(self, number): ... - def unaccent(self, text): ... - def string_replace(self, word, find, replace): ... - def urlize(self, text): ... - def demodulize(self, module_name): ... - def modulize(self, module_description): ... - def foreignKey(self, class_name, separate_class_name_and_id_with_underscore: int = ...): ... - -class English(Base): - def pluralize(self, word): ... - def singularize(self, word): ... - -class Inflector: - Inflector = ... # type: Any - def __init__(self, Inflector: Any = ...) -> None: ... - def pluralize(self, word): ... - def singularize(self, word): ... - def cond_plural(self, number_of_records, word): ... - def titleize(self, word, uppercase: str = ...): ... - def camelize(self, word): ... - def underscore(self, word): ... - def humanize(self, word, uppercase: str = ...): ... - def variablize(self, word): ... - def tableize(self, class_name): ... - def classify(self, table_name): ... - def ordinalize(self, number): ... - def unaccent(self, text): ... - def urlize(self, text): ... - def demodulize(self, module_name): ... - def modulize(self, module_description): ... - def foreignKey(self, class_name, separate_class_name_and_id_with_underscore: int = ...): ... diff --git a/typeshed/2and3/galaxy/util/json.pyi b/typeshed/2and3/galaxy/util/json.pyi deleted file mode 100644 index d124bd66..00000000 --- a/typeshed/2and3/galaxy/util/json.pyi +++ /dev/null @@ -1,12 +0,0 @@ -# Stubs for galaxy.util.json (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any, Optional - -def json_fix(val): ... -def safe_dumps(*args, **kwargs): ... -def validate_jsonrpc_request(request, regular_methods, notification_methods): ... -def validate_jsonrpc_response(response, id: Optional[Any] = ...): ... -def jsonrpc_request(method, params: Optional[Any] = ..., id: Optional[Any] = ..., jsonrpc: str = ...): ... -def jsonrpc_response(request: Optional[Any] = ..., id: Optional[Any] = ..., result: Optional[Any] = ..., error: Optional[Any] = ..., jsonrpc: str = ...): ... diff --git a/typeshed/2and3/galaxy/util/lazy_process.pyi b/typeshed/2and3/galaxy/util/lazy_process.pyi deleted file mode 100644 index 045e42f4..00000000 --- a/typeshed/2and3/galaxy/util/lazy_process.pyi +++ /dev/null @@ -1,22 +0,0 @@ -# Stubs for galaxy.util.lazy_process (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any - -class LazyProcess: - command_and_args = ... # type: Any - thread_lock = ... # type: Any - allow_process_request = ... # type: bool - process = ... # type: Any - def __init__(self, command_and_args) -> None: ... - def start_process(self): ... - def shutdown(self): ... - @property - def running(self): ... - -class NoOpLazyProcess: - def start_process(self): ... - def shutdown(self): ... - @property - def running(self): ... diff --git a/typeshed/2and3/galaxy/util/object_wrapper.pyi b/typeshed/2and3/galaxy/util/object_wrapper.pyi deleted file mode 100644 index 8a5cda6e..00000000 --- a/typeshed/2and3/galaxy/util/object_wrapper.pyi +++ /dev/null @@ -1,95 +0,0 @@ -# Stubs for galaxy.util.object_wrapper (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any, Optional -from six.moves import copyreg as copy_reg -from galaxy.util import sanitize_lists_to_string as _sanitize_lists_to_string - -NoneType = ... # type: Any -NotImplementedType = ... # type: Any -EllipsisType = ... # type: Any -XRangeType = ... # type: Any -SliceType = ... # type: Any -BufferType = ... # type: Any -DictProxyType = ... # type: Any -log = ... # type: Any -__CALLABLE_TYPES__ = ... # type: Any -__WRAP_NO_SUBCLASS__ = ... # type: Any -__DONT_SANITIZE_TYPES__ = ... # type: Any -__DONT_WRAP_TYPES__ = ... # type: Any -__WRAP_SEQUENCES__ = ... # type: Any -__WRAP_SETS__ = ... # type: Any -__WRAP_MAPPINGS__ = ... # type: Any -VALID_CHARACTERS = ... # type: Any -CHARACTER_MAP = ... # type: Any -INVALID_CHARACTER = ... # type: str - -def coerce(x, y): ... -def cmp(x, y): ... -def sanitize_lists_to_string(values, valid_characters: Any = ..., character_map: Any = ..., invalid_character: Any = ...): ... -def wrap_with_safe_string(value, no_wrap_classes: Optional[Any] = ...): ... - -class SafeStringWrapper: - __UNSANITIZED_ATTRIBUTE_NAME__ = ... # type: str - __NO_WRAP_NAMES__ = ... # type: Any - def __new__(cls, *arg, **kwd): ... - unsanitized = ... # type: Any - __safe_string_wrapper_function__ = ... # type: Any - def __init__(self, value, safe_string_wrapper_function: Any = ...) -> None: ... - def __lt__(self, other): ... - def __le__(self, other): ... - def __eq__(self, other): ... - def __ne__(self, other): ... - def __gt__(self, other): ... - def __ge__(self, other): ... - def __cmp__(self, other): ... - def __hash__(self): ... - def __bool__(self): ... - __nonzero__ = ... # type: Any - def __getattr__(self, name): ... - def __setattr__(self, name, value): ... - def __delattr__(self, name): ... - def __getattribute__(self, name): ... - def __len__(self): ... - def __getitem__(self, key): ... - def __setitem__(self, key, value): ... - def __delitem__(self, key): ... - def __iter__(self): ... - def __contains__(self, item): ... - def __getslice__(self, i, j): ... - def __setslice__(self, i, j, value): ... - def __delslice__(self, i, j): ... - def __add__(self, other): ... - def __sub__(self, other): ... - def __mul__(self, other): ... - def __floordiv__(self, other): ... - def __mod__(self, other): ... - def __divmod__(self, other): ... - def __pow__(self, *other): ... - def __lshift__(self, other): ... - def __rshift__(self, other): ... - def __and__(self, other): ... - def __xor__(self, other): ... - def __or__(self, other): ... - def __div__(self, other): ... - def __truediv__(self, other): ... - def __rpow__(self, other): ... - def __neg__(self): ... - def __pos__(self): ... - def __abs__(self): ... - def __invert__(self): ... - def __complex__(self): ... - def __int__(self): ... - def __float__(self): ... - def __oct__(self): ... - def __hex__(self): ... - def __index__(self): ... - def __coerce__(self, other): ... - def __enter__(self): ... - def __exit__(self, *args): ... - -class CallableSafeStringWrapper(SafeStringWrapper): - def __call__(self, *args, **kwds): ... - -def pickle_SafeStringWrapper(safe_object): ... diff --git a/typeshed/2and3/galaxy/util/odict.pyi b/typeshed/2and3/galaxy/util/odict.pyi deleted file mode 100644 index 459e3069..00000000 --- a/typeshed/2and3/galaxy/util/odict.pyi +++ /dev/null @@ -1,27 +0,0 @@ -# Stubs for galaxy.util.odict (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any, Optional -from six.moves import UserDict - -dict_alias = ... # type: Any - -class odict(UserDict): - def __init__(self, dict: Optional[Any] = ...) -> None: ... - def __delitem__(self, key): ... - def __setitem__(self, key, item): ... - def clear(self): ... - def copy(self): ... - def items(self): ... - def keys(self): ... - def popitem(self): ... - def setdefault(self, key, failobj: Optional[Any] = ...): ... - def update(self, dict): ... - def values(self): ... - def iterkeys(self): ... - def itervalues(self): ... - def iteritems(self): ... - def __iter__(self): ... - def reverse(self): ... - def insert(self, index, key, item): ... diff --git a/typeshed/2and3/galaxy/util/oset.pyi b/typeshed/2and3/galaxy/util/oset.pyi deleted file mode 100644 index 1d1f7bd8..00000000 --- a/typeshed/2and3/galaxy/util/oset.pyi +++ /dev/null @@ -1,19 +0,0 @@ -# Stubs for galaxy.util.oset (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any, Optional -import collections - -class OrderedSet(collections.MutableSet): - end = ... # type: Any - map = ... # type: Any - def __init__(self, iterable: Optional[Any] = ...) -> None: ... - def __len__(self): ... - def __contains__(self, key): ... - def add(self, key): ... - def discard(self, key): ... - def __iter__(self): ... - def __reversed__(self): ... - def pop(self, last: bool = ...): ... - def __eq__(self, other): ... diff --git a/typeshed/2and3/galaxy/util/plugin_config.pyi b/typeshed/2and3/galaxy/util/plugin_config.pyi deleted file mode 100644 index 887a82b7..00000000 --- a/typeshed/2and3/galaxy/util/plugin_config.pyi +++ /dev/null @@ -1,11 +0,0 @@ -# Stubs for galaxy.util.plugin_config (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any - -yaml = ... # type: Any - -def plugins_dict(module, plugin_type_identifier): ... -def load_plugins(plugins_dict, plugin_source, extra_kwds: Any = ...): ... -def plugin_source_from_path(path): ... diff --git a/typeshed/2and3/galaxy/util/properties.pyi b/typeshed/2and3/galaxy/util/properties.pyi deleted file mode 100644 index b59fdd0c..00000000 --- a/typeshed/2and3/galaxy/util/properties.pyi +++ /dev/null @@ -1,19 +0,0 @@ -# Stubs for galaxy.util.properties (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any, Optional -from six.moves.configparser import ConfigParser - -def find_config_file(default, old_default, explicit, cwd: Optional[Any] = ...): ... -def load_app_properties(kwds: Any = ..., ini_file: Optional[Any] = ..., ini_section: str = ..., config_prefix: str = ...): ... - -class NicerConfigParser(ConfigParser): - filename = ... # type: Any - def __init__(self, filename, *args, **kw) -> None: ... - read_file = ... # type: Any - def defaults(self): ... - class InterpolateWrapper: - def __init__(self, original) -> None: ... - def __getattr__(self, name): ... - def before_get(self, parser, section, option, value, defaults): ... diff --git a/typeshed/2and3/galaxy/util/simplegraph.pyi b/typeshed/2and3/galaxy/util/simplegraph.pyi deleted file mode 100644 index b1aba1a6..00000000 --- a/typeshed/2and3/galaxy/util/simplegraph.pyi +++ /dev/null @@ -1,26 +0,0 @@ -# Stubs for galaxy.util.simplegraph (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any, Optional - -class SimpleGraphNode: - index = ... # type: Any - data = ... # type: Any - def __init__(self, index, **data) -> None: ... - -class SimpleGraphEdge: - source_index = ... # type: Any - target_index = ... # type: Any - data = ... # type: Any - def __init__(self, source_index, target_index, **data) -> None: ... - -class SimpleGraph: - nodes = ... # type: Any - edges = ... # type: Any - def __init__(self, nodes: Optional[Any] = ..., edges: Optional[Any] = ...) -> None: ... - def add_node(self, node_id, **data): ... - def add_edge(self, source_id, target_id, **data): ... - def gen_node_dicts(self): ... - def gen_edge_dicts(self): ... - def as_dict(self): ... diff --git a/typeshed/2and3/galaxy/util/sleeper.pyi b/typeshed/2and3/galaxy/util/sleeper.pyi deleted file mode 100644 index 600adf98..00000000 --- a/typeshed/2and3/galaxy/util/sleeper.pyi +++ /dev/null @@ -1,11 +0,0 @@ -# Stubs for galaxy.util.sleeper (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any - -class Sleeper: - condition = ... # type: Any - def __init__(self) -> None: ... - def sleep(self, seconds): ... - def wake(self): ... diff --git a/typeshed/2and3/galaxy/util/sockets.pyi b/typeshed/2and3/galaxy/util/sockets.pyi deleted file mode 100644 index 100aba9a..00000000 --- a/typeshed/2and3/galaxy/util/sockets.pyi +++ /dev/null @@ -1,7 +0,0 @@ -# Stubs for galaxy.util.sockets (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any, Optional - -def unused_port(range: Optional[Any] = ...): ... diff --git a/typeshed/2and3/galaxy/util/specs.pyi b/typeshed/2and3/galaxy/util/specs.pyi deleted file mode 100644 index e3a95b9d..00000000 --- a/typeshed/2and3/galaxy/util/specs.pyi +++ /dev/null @@ -1,9 +0,0 @@ -# Stubs for galaxy.util.specs (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -def to_str_or_none(value): ... -def to_bool_or_none(value): ... -def to_bool(value): ... -def to_float_or_none(value): ... -def is_in(*args): ... diff --git a/typeshed/2and3/galaxy/util/sqlite.pyi b/typeshed/2and3/galaxy/util/sqlite.pyi deleted file mode 100644 index 53c7eaea..00000000 --- a/typeshed/2and3/galaxy/util/sqlite.pyi +++ /dev/null @@ -1,6 +0,0 @@ -# Stubs for galaxy.util.sqlite (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -def is_read_only_query(query): ... -def connect(path): ... diff --git a/typeshed/2and3/galaxy/util/submodules.pyi b/typeshed/2and3/galaxy/util/submodules.pyi deleted file mode 100644 index dbae0501..00000000 --- a/typeshed/2and3/galaxy/util/submodules.pyi +++ /dev/null @@ -1,9 +0,0 @@ -# Stubs for galaxy.util.submodules (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any - -log = ... # type: Any - -def submodules(module): ... diff --git a/typeshed/2and3/galaxy/util/topsort.pyi b/typeshed/2and3/galaxy/util/topsort.pyi deleted file mode 100644 index 79396d98..00000000 --- a/typeshed/2and3/galaxy/util/topsort.pyi +++ /dev/null @@ -1,20 +0,0 @@ -# Stubs for galaxy.util.topsort (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any -from galaxy.util.odict import odict as OrderedDict - -class CycleError(Exception): - preds = ... # type: Any - def __init__(self, sofar, numpreds, succs) -> None: ... - def get_partial(self): ... - def get_pred_counts(self): ... - def get_succs(self): ... - def get_elements(self): ... - def get_pairlist(self): ... - def get_preds(self): ... - def pick_a_cycle(self): ... - -def topsort(pairlist): ... -def topsort_levels(pairlist): ... diff --git a/typeshed/2and3/galaxy/util/xml_macros.pyi b/typeshed/2and3/galaxy/util/xml_macros.pyi deleted file mode 100644 index 27607dfd..00000000 --- a/typeshed/2and3/galaxy/util/xml_macros.pyi +++ /dev/null @@ -1,18 +0,0 @@ -# Stubs for galaxy.util.xml_macros (Python 3.4) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any - -REQUIRED_PARAMETER = ... # type: Any - -def load(path): ... -def template_macro_params(root): ... -def raw_tool_xml_tree(path): ... -def imported_macro_paths(root): ... - -class XmlMacroDef: - elements = ... # type: Any - parameters = ... # type: Any - def __init__(self, el) -> None: ... - def macro_tokens(self, expand_el): ... diff --git a/typeshed/2and3/junit_xml.pyi b/typeshed/2and3/junit_xml.pyi deleted file mode 100644 index 1f50f8a4..00000000 --- a/typeshed/2and3/junit_xml.pyi +++ /dev/null @@ -1,60 +0,0 @@ -# Stubs for junit_xml (Python 3.5) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any, Optional - -unichr = chr - -def decode(var, encoding): ... - -class TestSuite: - name: Any = ... - test_cases: Any = ... - timestamp: Any = ... - hostname: Any = ... - id: Any = ... - package: Any = ... - file: Any = ... - log: Any = ... - url: Any = ... - stdout: Any = ... - stderr: Any = ... - properties: Any = ... - def __init__(self, name, test_cases: Optional[Any] = ..., hostname: Optional[Any] = ..., id: Optional[Any] = ..., package: Optional[Any] = ..., timestamp: Optional[Any] = ..., properties: Optional[Any] = ..., file: Optional[Any] = ..., log: Optional[Any] = ..., url: Optional[Any] = ..., stdout: Optional[Any] = ..., stderr: Optional[Any] = ...) -> None: ... - def build_xml_doc(self, encoding: Optional[Any] = ...): ... - @staticmethod - def to_xml_string(test_suites, prettyprint: bool = ..., encoding: Optional[Any] = ...): ... - @staticmethod - def to_file(file_descriptor, test_suites, prettyprint: bool = ..., encoding: Optional[Any] = ...): ... - -class TestCase: - name: Any = ... - assertions: Any = ... - elapsed_sec: Any = ... - timestamp: Any = ... - classname: Any = ... - status: Any = ... - category: Any = ... - file: Any = ... - line: Any = ... - log: Any = ... - url: Any = ... - stdout: Any = ... - stderr: Any = ... - is_enabled: bool = ... - error_message: Any = ... - error_output: Any = ... - error_type: Any = ... - failure_message: Any = ... - failure_output: Any = ... - failure_type: Any = ... - skipped_message: Any = ... - skipped_output: Any = ... - def __init__(self, name, classname: Optional[Any] = ..., elapsed_sec: Optional[Any] = ..., stdout: Optional[Any] = ..., stderr: Optional[Any] = ..., assertions: Optional[Any] = ..., timestamp: Optional[Any] = ..., status: Optional[Any] = ..., category: Optional[Any] = ..., file: Optional[Any] = ..., line: Optional[Any] = ..., log: Optional[Any] = ..., group: Optional[Any] = ..., url: Optional[Any] = ...) -> None: ... - def add_error_info(self, message: Optional[Any] = ..., output: Optional[Any] = ..., error_type: Optional[Any] = ...): ... - def add_failure_info(self, message: Optional[Any] = ..., output: Optional[Any] = ..., failure_type: Optional[Any] = ...): ... - def add_skipped_info(self, message: Optional[Any] = ..., output: Optional[Any] = ...): ... - def is_failure(self): ... - def is_error(self): ... - def is_skipped(self): ... diff --git a/typeshed/2and3/mistune.pyi b/typeshed/2and3/mistune.pyi deleted file mode 100644 index d267d921..00000000 --- a/typeshed/2and3/mistune.pyi +++ /dev/null @@ -1,271 +0,0 @@ -__author__ = "Aleksandr Slepchenkov" -__email__ = "Sl.aleksandr28@gmail.com" - -from typing import Any, Optional, Pattern, List, Text, Tuple, Dict, Match, Type, Sequence, Iterable - -Tokens = List[Dict[Text, Any]] -# There are too much levels of optional unions of lists of text in cell and align 385 and 396 lines in mistune - - -def escape(text: Text, quote: bool = ..., smart_amp: bool = ...) -> Text: ... - - -class BlockGrammar: - def_links = ... # type: Pattern - def_footnotes = ... # type: Pattern - newline = ... # type: Pattern - block_code = ... # type: Pattern - fences = ... # type: Pattern - hrule = ... # type: Pattern - heading = ... # type: Pattern - lheading = ... # type: Pattern - block_quote = ... # type: Pattern - list_block = ... # type: Pattern - list_item = ... # type: Pattern - list_bullet = ... # type: Pattern - paragraph = ... # type: Pattern - block_html = ... # type: Pattern - table = ... # type: Pattern - nptable = ... # type: Pattern - text = ... # type: Pattern - - -class BlockLexer: - grammar_class = ... # type: Type[BlockGrammar] - default_rules = ... # type: List[Text] - list_rules = ... # type: Tuple[Text] - footnote_rules = ... # type: Tuple[Text] - tokens = ... # type: Tokens - def_links = ... # type: Dict[Text, Dict[Text, Text]] - def_footnotes = ... # type: Dict[Text, int] - rules = ... # type: BlockGrammar - - def __init__(self, rules: Optional[BlockGrammar] = ..., **kwargs) -> None: ... - - def __call__(self, text: Text, rules: Optional[Sequence[Text]] = ...) -> Tokens: ... - - def parse(self, text: Text, rules: Optional[Sequence[Text]] = ...) -> Tokens: ... - - def parse_newline(self, m: Match) -> None: ... - - def parse_block_code(self, m: Match) -> None: ... - - def parse_fences(self, m: Match) -> None: ... - - def parse_heading(self, m: Match) -> None: ... - - def parse_lheading(self, m: Match) -> None: ... - - def parse_hrule(self, m: Match) -> None: ... - - def parse_list_block(self, m: Match) -> None: ... - - def parse_block_quote(self, m: Match) -> None: ... - - def parse_def_links(self, m: Match) -> None: ... - - def parse_def_footnotes(self, m: Match) -> None: ... - - def parse_table(self, m: Match) -> None: ... - - def parse_nptable(self, m: Match) -> None: ... - - def parse_block_html(self, m: Match) -> None: ... - - def parse_paragraph(self, m: Match) -> None: ... - - def parse_text(self, m: Match) -> None: ... - - -class InlineGrammar: - escape = ... # type: Pattern - inline_html = ... # type: Pattern - autolink = ... # type: Pattern - link = ... # type: Pattern - reflink = ... # type: Pattern - nolink = ... # type: Pattern - url = ... # type: Pattern - double_emphasis = ... # type: Pattern - emphasis = ... # type: Pattern - code = ... # type: Pattern - linebreak = ... # type: Pattern - strikethrough = ... # type: Pattern - footnote = ... # type: Pattern - text = ... # type: Pattern - - def hard_wrap(self) -> None: ... - - -class InlineLexer: - grammar_class = ... # type: Type[InlineGrammar] - default_rules = ... # type: List[Text] - inline_html_rules = ... # type: List[Text] - renderer = ... # type: Renderer - links = ... # type: Dict[Any, Dict] - footnotes = ... # type: Dict[Text, int] - footnote_index = ... # type: int - _in_link = ... # type: bool - _in_footnote = ... # type: bool - _parse_inline_html = ... # type: bool - rules = ... # type: InlineGrammar - - def __init__(self, renderer: Renderer, rules: Optional[InlineGrammar] = ..., **kwargs) -> None: ... - - def __call__(self, text: Text, rules: Optional[Sequence[Text]] = ...) -> Text: ... - - def setup(self, links: Optional[Dict[Any, Dict]], footnotes: Optional[Dict[Text, int]]) -> None: ... - - line_match = ... # type: Match - line_started = ... # type: bool - - def output(self, text: Text, rules: Optional[Sequence[Text]] = ...) -> Text: ... - - def output_escape(self, m: Match) -> Text: ... - - def output_autolink(self, m: Match) -> Text: ... - - def output_url(https://github.com/self,%20m:%20Match) -> Text: ... - - def output_inline_html(self, m: Match) -> Text: ... - - def output_footnote(self, m: Match) -> Optional[Text]: ... - - def output_link(self, m: Match) -> Text: ... - - def output_reflink(self, m: Match) -> Optional[Text]: ... - - def output_nolink(self, m: Match) -> Optional[Text]: ... - - def output_double_emphasis(self, m: Match) -> Text: ... - - def output_emphasis(self, m: Match) -> Text: ... - - def output_code(self, m: Match) -> Text: ... - - def output_linebreak(self, m: Match) -> Text: ... - - def output_strikethrough(self, m: Match) -> Text: ... - - def output_text(self, m: Match) -> Text: ... - - -class Renderer: - options = ... # type: Dict - - def __init__(self, **kwargs) -> None: ... - - def placeholder(self) -> Text: ... - - def block_code(self, code: Text, - lang: Any = ...) -> Text: ... # It seems that lang should be string, however other types are valid as well - - def block_quote(self, text: Text) -> Text: ... - - def block_html(self, html: Text) -> Text: ... - - def header(self, text: Text, level: int, raw: Optional[Text] = ...) -> Text: ... - - def hrule(self) -> Text: ... - - def list(self, body: Any, - ordered: bool = ...) -> Text: ... # body - same reason as for lang above, and for other Any in this class - - def list_item(self, text: Any) -> Text: ... - - def paragraph(self, text: Text) -> Text: ... - - def table(self, header: Any, body: Any) -> Text: ... - - def table_row(self, content: Any) -> Text: ... - - def table_cell(self, content: Any, **flags) -> Text: ... - - def double_emphasis(self, text: Any) -> Text: ... - - def emphasis(self, text: Any) -> Text: ... - - def codespan(self, text: Text) -> Text: ... - - def linebreak(self) -> Text: ... - - def strikethrough(self, text: Any) -> Text: ... - - def text(self, text: Any) -> Text: ... - - def escape(self, text: Any) -> Text: ... - - def autolink(self, link: Any, is_email: bool = ...) -> Text: ... - - def link(self, link: Any, title: Any, text: Any) -> Text: ... - - def image(self, src: Any, title: Any, text: Any) -> Text: ... - - def inline_html(self, html: Any) -> Text: ... - - def newline(self) -> Text: ... - - def footnote_ref(self, key: Any, index: int) -> Text: ... - - def footnote_item(self, key: Any, text: Text) -> Text: ... - - def footnotes(self, text: Any) -> Text: ... - - -class Markdown: - renderer = ... # type: Renderer - inline = ... # type: InlineLexer - block = ... # type: BlockLexer - footnotes = ... # type: List[Dict[Text, Any]] - tokens = ... # type: Tokens - - def __init__(self, renderer: Optional[Renderer] = ..., inline: Optional[InlineLexer] = ..., - block: Optional[BlockLexer] = ..., **kwargs) -> None: ... - - def __call__(self, text: Text) -> Text: ... - - def render(self, text: Text) -> Text: ... - - def parse(self, text: Text) -> Text: ... - - token = ... # type: Dict[Text, Any] - - def pop(self) -> Optional[Dict[Text, Any]]: ... - - def peek(self) -> Optional[Dict[Text, Any]]: ... - - def output(self, text: Text, rules: Optional[Sequence[Text]] = ...): ... - - def tok(self) -> Text: ... - - def tok_text(self) -> Text: ... - - def output_newline(self) -> Text: ... - - def output_hrule(self) -> Text: ... - - def output_heading(self) -> Text: ... - - def output_code(self) -> Text: ... - - def output_table(self) -> Text: ... - - def output_block_quote(self) -> Text: ... - - def output_list(self) -> Text: ... - - def output_list_item(self) -> Text: ... - - def output_loose_item(self) -> Text: ... - - def output_footnote(self) -> Text: ... - - def output_close_html(self) -> Text: ... - - def output_open_html(self) -> Text: ... - - def output_paragraph(self) -> Text: ... - - def output_text(self) -> Text: ... - - -def markdown(text: Text, escape: bool = ..., **kwargs) -> Text: ... \ No newline at end of file diff --git a/typeshed/2and3/rdflib/__init__.pyi b/typeshed/2and3/rdflib/__init__.pyi deleted file mode 100644 index d9587d30..00000000 --- a/typeshed/2and3/rdflib/__init__.pyi +++ /dev/null @@ -1,9 +0,0 @@ -# Stubs for rdflib (Python 2) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from rdflib.term import URIRef as URIRef, BNode as BNode, Literal as Literal, Variable as Variable -from rdflib.namespace import Namespace as Namespace -from rdflib.graph import Dataset as Dataset, Graph as Graph, ConjunctiveGraph as ConjunctiveGraph -from rdflib.namespace import RDF as RDF, RDFS as RDFS, OWL as OWL, XSD as XSD -from rdflib import util as util diff --git a/typeshed/2and3/rdflib/events.pyi b/typeshed/2and3/rdflib/events.pyi deleted file mode 100644 index 7da9fbea..00000000 --- a/typeshed/2and3/rdflib/events.pyi +++ /dev/null @@ -1,12 +0,0 @@ -# Stubs for rdflib.events (Python 2) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -class Event: - def __init__(self, **kw): ... - -class Dispatcher: - def set_map(self, amap): ... - def get_map(self): ... - def subscribe(self, event_type, handler): ... - def dispatch(self, event): ... diff --git a/typeshed/2and3/rdflib/exceptions.pyi b/typeshed/2and3/rdflib/exceptions.pyi deleted file mode 100644 index 252af855..00000000 --- a/typeshed/2and3/rdflib/exceptions.pyi +++ /dev/null @@ -1,37 +0,0 @@ -# Stubs for rdflib.exceptions (Python 2) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any - -class Error(Exception): - msg = ... # type: Any - def __init__(self, msg=None): ... - -class TypeCheckError(Error): - type = ... # type: Any - node = ... # type: Any - def __init__(self, node): ... - -class SubjectTypeError(TypeCheckError): - msg = ... # type: Any - def __init__(self, node): ... - -class PredicateTypeError(TypeCheckError): - msg = ... # type: Any - def __init__(self, node): ... - -class ObjectTypeError(TypeCheckError): - msg = ... # type: Any - def __init__(self, node): ... - -class ContextTypeError(TypeCheckError): - msg = ... # type: Any - def __init__(self, node): ... - -class ParserError(Error): - msg = ... # type: Any - def __init__(self, msg): ... - -class UniquenessError(Error): - def __init__(self, values): ... diff --git a/typeshed/2and3/rdflib/graph.pyi b/typeshed/2and3/rdflib/graph.pyi deleted file mode 100644 index bf3c076a..00000000 --- a/typeshed/2and3/rdflib/graph.pyi +++ /dev/null @@ -1,159 +0,0 @@ -# Stubs for rdflib.graph (Python 3) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from rdflib.term import Identifier, Node, BNode -from typing import Any, Iterator, IO, Optional, Text, Tuple, Union - -class Graph(Node): - context_aware: bool = ... - formula_aware: bool = ... - default_union: bool = ... - def __init__(self, store: str = ..., identifier: Optional[Any] = ..., namespace_manager: Optional[Any] = ...) -> None: ... - store: Any = ... - identifier: Any = ... - namespace_manager: Any = ... - def toPython(self): ... - def destroy(self, configuration: Any) -> None: ... - def commit(self) -> None: ... - def rollback(self) -> None: ... - def open(self, configuration: Any, create: bool = ...): ... - def close(self, commit_pending_transaction: bool = ...) -> None: ... - def add(self, xxx_todo_changeme: Any) -> None: ... - def addN(self, quads: Any) -> None: ... - def remove(self, xxx_todo_changeme1: Any) -> None: ... - def triples(self, xxx_todo_changeme2: Tuple[Optional[Union[Text, Identifier]], Optional[Union[Text, Identifier]], Optional[Identifier]]) -> Iterator[Tuple[BNode, BNode, BNode]]: ... - def __getitem__(self, item: Any): ... - def __len__(self): ... - def __iter__(self): ... - def __contains__(self, triple: Any): ... - def __hash__(self): ... - def md5_term_hash(self): ... - def __cmp__(self, other: Any): ... - def __eq__(self, other: Any): ... - def __lt__(self, other: Any): ... - def __le__(self, other: Any): ... - def __gt__(self, other: Any): ... - def __ge__(self, other: Any): ... - def __iadd__(self, other: Any): ... - def __isub__(self, other: Any): ... - def __add__(self, other: Any): ... - def __mul__(self, other: Any): ... - def __sub__(self, other: Any): ... - def __xor__(self, other: Any): ... - __or__: Any = ... - __and__: Any = ... - def set(self, triple: Any) -> None: ... - def subjects(self, predicate: Optional[Any] = ..., object: Optional[Any] = ...) -> None: ... - def predicates(self, subject: Optional[Any] = ..., object: Optional[Any] = ...) -> None: ... - def objects(self, subject: Optional[Any] = ..., predicate: Optional[Any] = ...) -> None: ... - def subject_predicates(self, object: Optional[Any] = ...) -> None: ... - def subject_objects(self, predicate: Optional[Any] = ...) -> None: ... - def predicate_objects(self, subject: Optional[Any] = ...) -> None: ... - def triples_choices(self, xxx_todo_changeme3: Any, context: Optional[Any] = ...) -> None: ... - def value(self, subject: Optional[Any] = ..., predicate: Any = ..., object: Optional[Any] = ..., default: Optional[Any] = ..., any: bool = ...): ... - def label(self, subject: Any, default: str = ...): ... - def preferredLabel(self, subject: Any, lang: Optional[Any] = ..., default: Optional[Any] = ..., labelProperties: Any = ...): ... - def comment(self, subject: Any, default: str = ...): ... - def items(self, list: Any) -> None: ... - def transitiveClosure(self, func: Any, arg: Any, seen: Optional[Any] = ...) -> None: ... - def transitive_objects(self, subject: Any, property: Any, remember: Optional[Any] = ...) -> None: ... - def transitive_subjects(self, predicate: Any, object: Any, remember: Optional[Any] = ...) -> None: ... - def seq(self, subject: Any): ... - def qname(self, uri: Any): ... - def compute_qname(self, uri: Any, generate: bool = ...): ... - def bind(self, prefix: Any, namespace: Any, override: bool = ...): ... - def namespaces(self) -> None: ... - def absolutize(self, uri: Any, defrag: int = ...): ... - def serialize(self, destination: Optional[Any] = ..., format: str = ..., base: Optional[Any] = ..., encoding: Optional[Any] = ..., **args: Any): ... - def parse(self, source: Optional[Any] = ..., publicID: Optional[Any] = ..., format: Optional[Any] = ..., location: Optional[Any] = ..., file: Optional[Any] = ..., data: Optional[Any] = ..., **args: Any): ... - def load(self, source: Any, publicID: Optional[Any] = ..., format: str = ...) -> None: ... - def query(self, query_object: Any, processor: str = ..., result: str = ..., initNs: Optional[Any] = ..., initBindings: Optional[Any] = ..., use_store_provided: bool = ..., **kwargs: Any): ... - def update(self, update_object: Any, processor: str = ..., initNs: Optional[Any] = ..., initBindings: Optional[Any] = ..., use_store_provided: bool = ..., **kwargs: Any): ... - def n3(self): ... - def __reduce__(self): ... - def isomorphic(self, other: Any): ... - def connected(self): ... - def all_nodes(self): ... - def collection(self, identifier: Any): ... - def resource(self, identifier: Any): ... - def skolemize(self, new_graph: Optional[Any] = ..., bnode: Optional[Any] = ...): ... - def de_skolemize(self, new_graph: Optional[Any] = ..., uriref: Optional[Any] = ...): ... - -class ConjunctiveGraph(Graph): - context_aware: bool = ... - default_union: bool = ... - default_context: Any = ... - def __init__(self, store: str = ..., identifier: Optional[Any] = ...) -> None: ... - def __contains__(self, triple_or_quad: Any): ... - def add(self, triple_or_quad: Any) -> None: ... - def addN(self, quads: Any) -> None: ... - def remove(self, triple_or_quad: Any) -> None: ... - def quads(self, triple_or_quad: Optional[Any] = ...) -> None: ... - def triples_choices(self, xxx_todo_changeme4: Any, context: Optional[Any] = ...) -> None: ... - def __len__(self): ... - def contexts(self, triple: Optional[Any] = ...) -> None: ... - def get_context(self, identifier: Any, quoted: bool = ...): ... - def remove_context(self, context: Any) -> None: ... - def context_id(self, uri: Any, context_id: Optional[Any] = ...): ... - def parse(self, source: Optional[Any] = ..., publicID: Optional[Any] = ..., format: Optional[Any] = ..., location: Optional[Any] = ..., file: Optional[Any] = ..., data: Optional[Any] = ..., **args: Any): ... - def __reduce__(self): ... - -class Dataset(ConjunctiveGraph): - __doc__: Any = ... - default_context: Any = ... - default_union: Any = ... - def __init__(self, store: str = ..., default_union: bool = ...) -> None: ... - def graph(self, identifier: Optional[Any] = ...): ... - def parse(self, source: Optional[Any] = ..., publicID: Optional[Any] = ..., format: Optional[Any] = ..., location: Optional[Any] = ..., file: Optional[Any] = ..., data: Optional[Any] = ..., **args: Any): ... - def add_graph(self, g: Any): ... - def remove_graph(self, g: Any) -> None: ... - def contexts(self, triple: Optional[Any] = ...) -> None: ... - graphs: Any = ... - def quads(self, triple_or_quad: Optional[Any] = ...) -> None: ... - -class QuotedGraph(Graph): - def __init__(self, store: Any, identifier: Any) -> None: ... - def add(self, xxx_todo_changeme5: Any) -> None: ... - def addN(self, quads: Any) -> None: ... - def n3(self): ... - def __reduce__(self): ... - -class Seq: - def __init__(self, graph: Any, subject: Any) -> None: ... - def toPython(self): ... - def __iter__(self) -> None: ... - def __len__(self): ... - def __getitem__(self, index: Any): ... - -class ModificationException(Exception): - def __init__(self) -> None: ... - -class UnSupportedAggregateOperation(Exception): - def __init__(self) -> None: ... - -class ReadOnlyGraphAggregate(ConjunctiveGraph): - graphs: Any = ... - def __init__(self, graphs: Any, store: str = ...) -> None: ... - def destroy(self, configuration: Any) -> None: ... - def commit(self) -> None: ... - def rollback(self) -> None: ... - def open(self, configuration: Any, create: bool = ...) -> None: ... - def close(self, commit_pending_transaction: bool = ...) -> None: ... - def add(self, xxx_todo_changeme6: Any) -> None: ... - def addN(self, quads: Any) -> None: ... - def remove(self, xxx_todo_changeme7: Any) -> None: ... - def __contains__(self, triple_or_quad: Any): ... - def quads(self, triple_or_quad: Optional[Any] = ...) -> None: ... - def __len__(self): ... - def __cmp__(self, other: Any): ... - def __iadd__(self, other: Any) -> None: ... - def __isub__(self, other: Any) -> None: ... - def triples_choices(self, xxx_todo_changeme10: Any, context: Optional[Any] = ...) -> None: ... - def qname(self, uri: Any): ... - def compute_qname(self, uri: Any, generate: bool = ...): ... - def bind(self, prefix: Any, namespace: Any, override: bool = ...) -> None: ... - def namespaces(self) -> None: ... - def absolutize(self, uri: Any, defrag: int = ...) -> None: ... - def parse(self, source: Optional[Any] = ..., publicID: Optional[Any] = ..., format: Optional[Any] = ..., location: Optional[Any] = ..., file: Optional[Any] = ..., data: Optional[Any] = ..., **args: Any): ... - def n3(self) -> None: ... diff --git a/typeshed/2and3/rdflib/namespace.pyi b/typeshed/2and3/rdflib/namespace.pyi deleted file mode 100644 index c0d305f6..00000000 --- a/typeshed/2and3/rdflib/namespace.pyi +++ /dev/null @@ -1,62 +0,0 @@ -# Stubs for rdflib.namespace (Python 3) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any, Optional, Text - -from rdflib.term import URIRef - -class Namespace(str): - __doc__: Any = ... - def __new__(cls, value: Any): ... - @property - def title(self) -> URIRef: ... - def term(self, name: Any) -> URIRef: ... - def __getitem__(self, key: Any, default: Optional[Any] = ...) -> URIRef: ... - def __getattr__(self, name: Any) -> URIRef: ... - -class URIPattern(str): - __doc__: Any = ... - def __new__(cls, value: Any): ... - def __mod__(self, *args: Any, **kwargs: Any): ... - def format(self, *args: Any, **kwargs: Any): ... - -class ClosedNamespace: - uri: Any = ... - def __init__(self, uri: Any, terms: Any) -> None: ... - def term(self, name: Any) -> URIRef: ... - def __getitem__(self, key: Any, default: Optional[Any] = ...) -> URIRef: ... - def __getattr__(self, name: Any) -> URIRef: ... - -class _RDFNamespace(ClosedNamespace): - def __init__(self) -> None: ... - def term(self, name: Any) -> URIRef: ... - -RDF = ClosedNamespace("", []) -RDFS = ClosedNamespace("", []) -OWL = Namespace("") -XSD: Namespace -SKOS: Namespace -DOAP: Namespace -FOAF: Namespace -DC: Namespace -DCTERMS: Namespace -VOID: Namespace - -class NamespaceManager: - graph: Any = ... - def __init__(self, graph: Any) -> None: ... - def reset(self) -> None: ... - store: Any = ... - def qname(self, uri: Any): ... - def normalizeUri(self, rdfTerm: Any): ... - def compute_qname(self, uri: Any, generate: bool = ...): ... - def bind(self, prefix: Any, namespace: Any, override: bool = ..., replace: bool = ...) -> None: ... - def namespaces(self) -> None: ... - def absolutize(self, uri: Any, defrag: int = ...): ... - -def is_ncname(name: Any): ... - -XMLNS: str - -def split_uri(uri: Any): ... diff --git a/typeshed/2and3/rdflib/parser.pyi b/typeshed/2and3/rdflib/parser.pyi deleted file mode 100644 index fa1ec9a7..00000000 --- a/typeshed/2and3/rdflib/parser.pyi +++ /dev/null @@ -1,10 +0,0 @@ -# Stubs for rdflib.parser (Python 2) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any -from io import StringIO as BytesIO - -class Parser: - def __init__(self): ... - def parse(self, source, sink): ... diff --git a/typeshed/2and3/rdflib/plugin.pyi b/typeshed/2and3/rdflib/plugin.pyi deleted file mode 100644 index 30026e23..00000000 --- a/typeshed/2and3/rdflib/plugin.pyi +++ /dev/null @@ -1,28 +0,0 @@ -# Stubs for rdflib.plugin (Python 2) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any -from rdflib.exceptions import Error -from rdflib.parser import Parser - -class PluginException(Error): ... - -class Plugin: - name = ... # type: Any - kind = ... # type: Any - module_path = ... # type: Any - class_name = ... # type: Any - def __init__(self, name, kind, module_path, class_name): ... - def getClass(self): ... - -class PKGPlugin(Plugin): - name = ... # type: Any - kind = ... # type: Any - ep = ... # type: Any - def __init__(self, name, kind, ep): ... - def getClass(self): ... - -def register(name: str, kind: type, module_path: str, class_name: str) -> None: ... -def get(name, kind): ... -def plugins(name=None, kind=None): ... diff --git a/typeshed/2and3/rdflib/plugins/parsers/notation3.pyi b/typeshed/2and3/rdflib/plugins/parsers/notation3.pyi deleted file mode 100644 index 31776345..00000000 --- a/typeshed/2and3/rdflib/plugins/parsers/notation3.pyi +++ /dev/null @@ -1,12 +0,0 @@ -# Stubs for rdflib.plugins.parsers.notation3 (Python 3.5) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any -from rdflib.parser import Parser - -class BadSyntax(SyntaxError): - lines = ... # type: Any - def __init__(self, uri, lines, argstr, i, why): ... - @property - def message(self): ... diff --git a/typeshed/2and3/rdflib/query.pyi b/typeshed/2and3/rdflib/query.pyi deleted file mode 100644 index fad3c377..00000000 --- a/typeshed/2and3/rdflib/query.pyi +++ /dev/null @@ -1,54 +0,0 @@ -# Stubs for rdflib.query (Python 2) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any -from io import StringIO as BytesIO -import collections - -class Processor: - def __init__(self, graph): ... - def query(self, strOrQuery, initBindings=..., initNs=..., DEBUG=False): ... - -class UpdateProcessor: - def __init__(self, graph): ... - def update(self, strOrQuery, initBindings=..., initNs=...): ... - -class ResultException(Exception): ... - -class EncodeOnlyUnicode: - def __init__(self, stream): ... - def write(self, arg): ... - def __getattr__(self, name): ... - -class ResultRow(tuple): - __doc__ = ... # type: Any - def __new__(cls, values, labels): ... - def __getattr__(self, name): ... - def __getitem__(self, name): ... - def asdict(self): ... - -class Result(collections.Iterable): - type = ... # type: Any - vars = ... # type: Any - askAnswer = ... # type: Any - graph = ... # type: Any - def __init__(self, type_): ... - bindings = ... # type: Any - @staticmethod - def parse(source, format='', **kwargs): ... - def serialize(self, destination=None, encoding='', format='', **args): ... - def __len__(self): ... - def __nonzero__(self): ... - def __iter__(self): ... - def __getattr__(self, name): ... - def __eq__(self, other): ... - -class ResultParser: - def __init__(self): ... - def parse(self, source, **kwargs): ... - -class ResultSerializer: - result = ... # type: Any - def __init__(self, result): ... - def serialize(self, stream, encoding='', **kwargs): ... diff --git a/typeshed/2and3/rdflib/serializer.pyi b/typeshed/2and3/rdflib/serializer.pyi deleted file mode 100644 index a92dac00..00000000 --- a/typeshed/2and3/rdflib/serializer.pyi +++ /dev/null @@ -1,13 +0,0 @@ -# Stubs for rdflib.serializer (Python 2) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any - -class Serializer: - store = ... # type: Any - encoding = ... # type: Any - base = ... # type: Any - def __init__(self, store): ... - def serialize(self, stream, base=None, encoding=None, **args): ... - def relativize(self, uri): ... diff --git a/typeshed/2and3/rdflib/store.pyi b/typeshed/2and3/rdflib/store.pyi deleted file mode 100644 index 6886321b..00000000 --- a/typeshed/2and3/rdflib/store.pyi +++ /dev/null @@ -1,48 +0,0 @@ -# Stubs for rdflib.store (Python 2) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any -from rdflib.events import Event -from io import StringIO as BytesIO - -class StoreCreatedEvent(Event): ... -class TripleAddedEvent(Event): ... -class TripleRemovedEvent(Event): ... - -class NodePickler: - def __init__(self): ... - def register(self, object, id): ... - def loads(self, s): ... - def dumps(self, obj, protocol=None, bin=None): ... - -class Store: - context_aware = ... # type: Any - formula_aware = ... # type: Any - transaction_aware = ... # type: Any - graph_aware = ... # type: Any - dispatcher = ... # type: Any - def __init__(self, configuration=None, identifier=None): ... - node_pickler = ... # type: Any - def create(self, configuration): ... - def open(self, configuration, create=False): ... - def close(self, commit_pending_transaction=False): ... - def destroy(self, configuration): ... - def gc(self): ... - def add(self, __tuple_arg_2, context, quoted=False): ... - def addN(self, quads): ... - def remove(self, __tuple_arg_2, context=None): ... - def triples_choices(self, __tuple_arg_2, context=None): ... - def triples(self, triple_pattern, context=None): ... - def __len__(self, context=None): ... - def contexts(self, triple=None): ... - def query(self, query, initNs, initBindings, queryGraph, **kwargs): ... - def update(self, update, initNs, initBindings, queryGraph, **kwargs): ... - def bind(self, prefix, namespace): ... - def prefix(self, namespace): ... - def namespace(self, prefix): ... - def namespaces(self): ... - def commit(self): ... - def rollback(self): ... - def add_graph(self, graph): ... - def remove_graph(self, graph): ... diff --git a/typeshed/2and3/rdflib/term.pyi b/typeshed/2and3/rdflib/term.pyi deleted file mode 100644 index 32b09c71..00000000 --- a/typeshed/2and3/rdflib/term.pyi +++ /dev/null @@ -1,87 +0,0 @@ -# Stubs for rdflib.term (Python 2) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from typing import Any, Optional - -class Node: ... - -class Identifier(Node, str): - def __new__(cls, value: Any): ... - def eq(self, other: Any): ... - def neq(self, other: Any): ... - def __ne__(self, other: Any): ... - def __eq__(self, other: Any): ... - def __gt__(self, other: Any): ... - def __lt__(self, other: Any): ... - def __le__(self, other: Any): ... - def __ge__(self, other: Any): ... - def __hash__(self): ... - -class URIRef(Identifier): - def __new__(cls, value: Any, base: Optional[Any] = ...): ... - def toPython(self): ... - def n3(self, namespace_manager: Optional[Any] = ...): ... - def defrag(self): ... - def __reduce__(self): ... - def __getnewargs__(self): ... - def __add__(self, other: Any): ... - def __radd__(self, other: Any): ... - def __mod__(self, other: Any): ... - def md5_term_hash(self): ... - def de_skolemize(self): ... - -class Genid(URIRef): ... -class RDFLibGenid(Genid): ... - -class BNode(Identifier): - def __new__(cls, value=None, _sn_gen=..., _prefix=...): ... - def toPython(self): ... - def n3(self, namespace_manager=None): ... - def __getnewargs__(self): ... - def __reduce__(self): ... - def md5_term_hash(self): ... - def skolemize(self, authority=''): ... - -class Literal(Identifier): - __doc__ = ... # type: Any - def __new__(cls, lexical_or_value, lang=None, datatype=None, normalize=None): ... - def normalize(self): ... - @property - def value(self): ... - @property - def language(self): ... - @property - def datatype(self): ... - def __reduce__(self): ... - def __add__(self, val): ... - def __nonzero__(self): ... - def __neg__(self): ... - def __pos__(self): ... - def __abs__(self): ... - def __invert__(self): ... - def __gt__(self, other): ... - def __lt__(self, other): ... - def __le__(self, other): ... - def __ge__(self, other): ... - def __hash__(self): ... - def __eq__(self, other): ... - def eq(self, other): ... - def neq(self, other): ... - def n3(self, namespace_manager=None): ... - def toPython(self): ... - def md5_term_hash(self): ... - -def bind(datatype, pythontype, constructor=None, lexicalizer=None): ... - -class Variable(Identifier): - def __new__(cls, value): ... - def toPython(self): ... - def n3(self, namespace_manager=None): ... - def __reduce__(self): ... - def md5_term_hash(self): ... - -class Statement(Node, tuple): - def __new__(cls, __tuple_arg_2, context): ... - def __reduce__(self): ... - def toPython(self): ... diff --git a/typeshed/2and3/rdflib/util.pyi b/typeshed/2and3/rdflib/util.pyi deleted file mode 100644 index 0921d30e..00000000 --- a/typeshed/2and3/rdflib/util.pyi +++ /dev/null @@ -1,21 +0,0 @@ -# Stubs for rdflib.util (Python 2) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -def list2set(seq): ... -def first(seq): ... -def uniq(sequence, strip=0): ... -def more_than(sequence, number): ... -def to_term(s, default=None): ... -def from_n3(s, default=None, backend=None): ... -def check_context(c): ... -def check_subject(s): ... -def check_predicate(p): ... -def check_object(o): ... -def check_statement(triple): ... -def check_pattern(triple): ... -def date_time(t=None, local_time_zone=False): ... -def parse_date_time(val): ... -def guess_format(fpath, fmap=None): ... -def find_roots(graph, prop, roots=None): ... -def get_tree(graph, root, prop, mapper=..., sortkey=None, done=None, dir=''): ... diff --git a/typeshed/2and3/ruamel/__init__.py b/typeshed/2and3/ruamel/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/typeshed/2and3/select.pyi b/typeshed/2and3/select.pyi deleted file mode 100644 index 094bb916..00000000 --- a/typeshed/2and3/select.pyi +++ /dev/null @@ -1,137 +0,0 @@ -import sys -from typing import Any, Optional, Sequence, Tuple, Iterable, List, Union - -# When we have protocols, this should change to a protocol with a fileno method -# See https://docs.python.org/3/c-api/file.html#c.PyObject_AsFileDescriptor -_FileDescriptor = Union[int, Any] - -EPOLLERR: int -EPOLLET: int -EPOLLHUP: int -EPOLLIN: int -EPOLLMSG: int -EPOLLONESHOT: int -EPOLLOUT: int -EPOLLPRI: int -EPOLLRDBAND: int -EPOLLRDNORM: int -EPOLLWRBAND: int -EPOLLWRNORM: int -EPOLL_RDHUP: int -KQ_EV_ADD: int -KQ_EV_CLEAR: int -KQ_EV_DELETE: int -KQ_EV_DISABLE: int -KQ_EV_ENABLE: int -KQ_EV_EOF: int -KQ_EV_ERROR: int -KQ_EV_FLAG1: int -KQ_EV_ONESHOT: int -KQ_EV_SYSFLAGS: int -KQ_FILTER_AIO: int -KQ_FILTER_NETDEV: int -KQ_FILTER_PROC: int -KQ_FILTER_READ: int -KQ_FILTER_SIGNAL: int -KQ_FILTER_TIMER: int -KQ_FILTER_VNODE: int -KQ_FILTER_WRITE: int -KQ_NOTE_ATTRIB: int -KQ_NOTE_CHILD: int -KQ_NOTE_DELETE: int -KQ_NOTE_EXEC: int -KQ_NOTE_EXIT: int -KQ_NOTE_EXTEND: int -KQ_NOTE_FORK: int -KQ_NOTE_LINK: int -KQ_NOTE_LINKDOWN: int -KQ_NOTE_LINKINV: int -KQ_NOTE_LINKUP: int -KQ_NOTE_LOWAT: int -KQ_NOTE_PCTRLMASK: int -KQ_NOTE_PDATAMASK: int -KQ_NOTE_RENAME: int -KQ_NOTE_REVOKE: int -KQ_NOTE_TRACK: int -KQ_NOTE_TRACKERR: int -KQ_NOTE_WRITE: int -PIPE_BUF: int -POLLERR: int -POLLHUP: int -POLLIN: int -POLLMSG: int -POLLNVAL: int -POLLOUT: int -POLLPRI: int -POLLRDBAND: int -POLLRDNORM: int -POLLWRBAND: int -POLLWRNORM: int - -class poll: - def __init__(self) -> None: ... - def register(self, fd: _FileDescriptor, eventmask: int = ...) -> None: ... - def modify(self, fd: _FileDescriptor, eventmask: int) -> None: ... - def unregister(self, fd: _FileDescriptor) -> None: ... - def poll(self, timeout: Optional[float] = ...) -> List[Tuple[int, int]]: ... - -def select(rlist: Sequence[Any], wlist: Sequence[Any], xlist: Sequence[Any], - timeout: Optional[float] = ...) -> Tuple[List[Any], - List[Any], - List[Any]]: ... - -if sys.version_info >= (3, 3): - error = OSError -else: - class error(Exception): ... - -# BSD only -class kevent(object): - data: Any - fflags: int - filter: int - flags: int - ident: int - udata: Any - def __init__(self, ident: _FileDescriptor, filter: int = ..., flags: int = ..., fflags: int = ..., data: Any = ..., udata: Any = ...) -> None: ... - -# BSD only -class kqueue(object): - closed: bool - def __init__(self) -> None: ... - def close(self) -> None: ... - def control(self, changelist: Optional[Iterable[kevent]], max_events: int, timeout: float = ...) -> List[kevent]: ... - def fileno(self) -> int: ... - @classmethod - def fromfd(cls, fd: _FileDescriptor) -> kqueue: ... - -# Linux only -class epoll(object): - if sys.version_info >= (3, 3): - def __init__(self, sizehint: int = ..., flags: int = ...) -> None: ... - else: - def __init__(self, sizehint: int = ...) -> None: ... - if sys.version_info >= (3, 4): - def __enter__(self) -> epoll: ... - def __exit__(self, *args: Any) -> None: ... - def close(self) -> None: ... - closed: bool - def fileno(self) -> int: ... - def register(self, fd: _FileDescriptor, eventmask: int = ...) -> None: ... - def modify(self, fd: _FileDescriptor, eventmask: int) -> None: ... - def unregister(self, fd: _FileDescriptor) -> None: ... - def poll(self, timeout: float = ..., maxevents: int = ...) -> List[Tuple[int, int]]: ... - @classmethod - def fromfd(cls, fd: _FileDescriptor) -> epoll: ... - -if sys.version_info >= (3, 3): - # Solaris only - class devpoll: - if sys.version_info >= (3, 4): - def close(self) -> None: ... - closed: bool - def fileno(self) -> int: ... - def register(self, fd: _FileDescriptor, eventmask: int = ...) -> None: ... - def modify(self, fd: _FileDescriptor, eventmask: int = ...) -> None: ... - def unregister(self, fd: _FileDescriptor) -> None: ... - def poll(self, timeout: Optional[float] = ...) -> List[Tuple[int, int]]: ... \ No newline at end of file diff --git a/typeshed/2and3/shellescape/__init__.pyi b/typeshed/2and3/shellescape/__init__.pyi deleted file mode 100644 index 621241e5..00000000 --- a/typeshed/2and3/shellescape/__init__.pyi +++ /dev/null @@ -1,5 +0,0 @@ -# Stubs for shellescape (Python 2) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from .main import quote as quote diff --git a/typeshed/2and3/shellescape/main.pyi b/typeshed/2and3/shellescape/main.pyi deleted file mode 100644 index 69eade63..00000000 --- a/typeshed/2and3/shellescape/main.pyi +++ /dev/null @@ -1,5 +0,0 @@ -# Stubs for shellescape.main (Python 2) - -from typing import AnyStr - -def quote(s: AnyStr) -> AnyStr: ... diff --git a/typeshed/3/urllib/__init__.py b/typeshed/3/urllib/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/typeshed/3/urllib/parse.pyi b/typeshed/3/urllib/parse.pyi deleted file mode 100644 index cb7837e0..00000000 --- a/typeshed/3/urllib/parse.pyi +++ /dev/null @@ -1,152 +0,0 @@ -# Stubs for urllib.parse -from typing import Any, List, Dict, Tuple, AnyStr, Generic, Iterator, overload, Sequence, Mapping, Union, NamedTuple, Callable, Optional -import sys - -_Str = Union[bytes, str] - - -uses_relative: List[str] -uses_netloc: List[str] -uses_params: List[str] -non_hierarchical: List[str] -uses_query: List[str] -uses_fragment: List[str] -scheme_chars: str -MAX_CACHE_SIZE = 0 - -class _ResultMixinBase(Generic[AnyStr]): - def geturl(https://github.com/self) -> AnyStr: ... - -class _ResultMixinStr(_ResultMixinBase[str]): - def encode(self, encoding: str = ..., errors: str = ...) -> _ResultMixinBytes: ... - - -class _ResultMixinBytes(_ResultMixinBase[str]): - def decode(self, encoding: str = ..., errors: str = ...) -> _ResultMixinStr: ... - - -class _NetlocResultMixinBase(Generic[AnyStr]): - username: AnyStr - password: AnyStr - hostname: AnyStr - port: int - -class _NetlocResultMixinStr(_NetlocResultMixinBase[str], _ResultMixinStr): ... - -class _NetlocResultMixinBytes(_NetlocResultMixinBase[bytes], _ResultMixinBytes): ... - -class _DefragResultBase(Generic[AnyStr]): - url: AnyStr - fragment: AnyStr - @overload - def __getitem__(self, x: slice) -> AnyStr: ... - @overload - def __getitem__(self, x: int) -> AnyStr: ... - def __iter__(self) -> Iterator[AnyStr]: ... - - - -_SplitResultBase = NamedTuple( - '_SplitResultBase', - [ - ('scheme', str), ('netloc', str), ('path', str), ('query', str), ('fragment', str) - ] -) -_SplitResultBytesBase = NamedTuple( - '_SplitResultBytesBase', - [ - ('scheme', bytes), ('netloc', bytes), ('path', bytes), ('query', bytes), ('fragment', bytes) - ] -) - -_ParseResultBase = NamedTuple( - '_ParseResultBase', - [ - ('scheme', str), ('netloc', str), ('path', str), ('params', str), ('query', str), ('fragment', str) - ] -) -_ParseResultBytesBase = NamedTuple( - '_ParseResultBytesBase', - [ - ('scheme', bytes), ('netloc', bytes), ('path', bytes), ('params', bytes), ('query', bytes), ('fragment', bytes) - ] -) - -# Structured result objects for string data -class DefragResult(_DefragResultBase[str], _ResultMixinStr): ... - -class SplitResult(_SplitResultBase, _NetlocResultMixinStr): ... - -class ParseResult(_ParseResultBase, _NetlocResultMixinStr): ... - -# Structured result objects for bytes data -class DefragResultBytes(_DefragResultBase[bytes], _ResultMixinBytes): ... - -class SplitResultBytes(_SplitResultBytesBase, _NetlocResultMixinBytes): ... - -class ParseResultBytes(_ParseResultBytesBase, _NetlocResultMixinBytes): ... - - -def parse_qs(qs: AnyStr, keep_blank_values: bool = ..., strict_parsing: bool = ..., encoding: str = ..., errors: str = ...) -> Dict[AnyStr, List[AnyStr]]: ... - -def parse_qsl(qs: AnyStr, keep_blank_values: bool = ..., strict_parsing: bool = ..., encoding: str = ..., errors: str = ...) -> List[Tuple[AnyStr, AnyStr]]: ... - - -@overload -def quote(string: str, safe: _Str = ..., encoding: str = ..., errors: str = ...) -> str: ... -@overload -def quote(string: bytes, safe: _Str = ...) -> str: ... - -def quote_from_bytes(bs: bytes, safe: _Str = ...) -> str: ... - -@overload -def quote_plus(string: str, safe: _Str = ..., encoding: str = ..., errors: str = ...) -> str: ... -@overload -def quote_plus(string: bytes, safe: _Str = ...) -> str: ... - -def unquote(string: str, encoding: str = ..., errors: str = ...) -> str: ... - -def unquote_to_bytes(string: _Str) -> bytes: ... - -def unquote_plus(string: str, encoding: str = ..., errors: str = ...) -> str: ... - -@overload -def urldefrag(url: str) -> DefragResult: ... -@overload -def urldefrag(url: bytes) -> DefragResultBytes: ... - -if sys.version_info >= (3, 5): - def urlencode(query: Union[Mapping[Any, Any], - Mapping[Any, Sequence[Any]], - Sequence[Tuple[Any, Any]], - Sequence[Tuple[Any, Sequence[Any]]]], - doseq: bool = ..., safe: AnyStr = ..., encoding: str = ..., errors: str = ..., - quote_via: Callable[[str, AnyStr, str, str], str] = ...) -> str: ... -else: - def urlencode(query: Union[Mapping[Any, Any], - Mapping[Any, Sequence[Any]], - Sequence[Tuple[Any, Any]], - Sequence[Tuple[Any, Sequence[Any]]]], - doseq: bool = ..., safe: AnyStr = ..., encoding: str = ..., errors: str = ...) -> str: ... - -def urljoin(base: Optional[AnyStr], url: Optional[AnyStr], allow_fragments: bool = ...) -> AnyStr: ... - -@overload -def urlparse(url: str, scheme: str = ..., allow_fragments: bool = ...) -> ParseResult: ... -@overload -def urlparse(url: bytes, scheme: bytes = ..., allow_fragments: bool = ...) -> ParseResultBytes: ... - -@overload -def urlsplit(url: Optional[str], scheme: str = ..., allow_fragments: bool = ...) -> SplitResult: ... -@overload -def urlsplit(url: bytes, scheme: bytes = ..., allow_fragments: bool = ...) -> SplitResultBytes: ... - -@overload -def urlunparse(components: Tuple[AnyStr, AnyStr, AnyStr, AnyStr, AnyStr, AnyStr]) -> AnyStr: ... -@overload -def urlunparse(components: Sequence[AnyStr]) -> AnyStr: ... - -@overload -def urlunsplit(components: Tuple[AnyStr, AnyStr, AnyStr, AnyStr, AnyStr]) -> AnyStr: ... -@overload -def urlunsplit(components: Sequence[AnyStr]) -> AnyStr: ... diff --git a/typeshed/3/urllib/subprocess.pyi b/typeshed/3/urllib/subprocess.pyi deleted file mode 100644 index 2fd8b5ba..00000000 --- a/typeshed/3/urllib/subprocess.pyi +++ /dev/null @@ -1,1208 +0,0 @@ -# Stubs for subprocess - -# Based on http://docs.python.org/3.6/library/subprocess.html -import sys -from typing import Sequence, Any, Mapping, Callable, Tuple, IO, Optional, Union, Type, Text, Generic, TypeVar, AnyStr, overload -from types import TracebackType - -if sys.version_info >= (3, 8): - from typing import Literal -else: - from typing_extensions import Literal - -# We prefer to annotate inputs to methods (eg subprocess.check_call) with these -# union types. -# For outputs we use laborious literal based overloads to try to determine -# which specific return types to use, and prefer to fall back to Any when -# this does not work, so the caller does not have to use an assertion to confirm -# which type. -# -# For example: -# -# try: -# x = subprocess.check_output(["ls", "-l"]) -# reveal_type(x) # bytes, based on the overloads -# except TimeoutError as e: -# reveal_type(e.cmd) # Any, but morally is _CMD -_FILE = Union[None, int, IO[Any]] -_TXT = Union[bytes, Text] -if sys.version_info >= (3, 6): - from builtins import _PathLike - _PATH = Union[bytes, Text, _PathLike] -else: - _PATH = Union[bytes, Text] -# Python 3.6 does't support _CMD being a single PathLike. -# See: https://bugs.python.org/issue31961 -_CMD = Union[_TXT, Sequence[_PATH]] -_ENV = Union[Mapping[bytes, _TXT], Mapping[Text, _TXT]] - -_S = TypeVar('_S') -_T = TypeVar('_T') - -class CompletedProcess(Generic[_T]): - # morally: _CMD - args: Any - returncode: int - # These are really both Optional, but requiring checks would be tedious - # and writing all the overloads would be horrific. - stdout: _T - stderr: _T - def __init__(self, args: _CMD, returncode: int, stdout: Optional[_T] = ..., stderr: Optional[_T] = ...) -> None: ... - def check_returncode(self) -> None: ... - -if sys.version_info >= (3, 7): - # Nearly the same args as for 3.6, except for capture_output and text - @overload - def run( - args: _CMD, - bufsize: int = ..., - executable: _PATH = ..., - stdin: _FILE = ..., - stdout: _FILE = ..., - stderr: _FILE = ..., - preexec_fn: Callable[[], Any] = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: Optional[_PATH] = ..., - env: Optional[_ENV] = ..., - universal_newlines: bool = ..., - startupinfo: Any = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., - *, - capture_output: bool = ..., - check: bool = ..., - encoding: Optional[str] = ..., - errors: Optional[str] = ..., - input: Optional[str] = ..., - text: Literal[True], - timeout: Optional[float] = ..., - ) -> CompletedProcess[str]: ... - @overload - def run( - args: _CMD, - bufsize: int = ..., - executable: _PATH = ..., - stdin: _FILE = ..., - stdout: _FILE = ..., - stderr: _FILE = ..., - preexec_fn: Callable[[], Any] = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: Optional[_PATH] = ..., - env: Optional[_ENV] = ..., - universal_newlines: bool = ..., - startupinfo: Any = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., - *, - capture_output: bool = ..., - check: bool = ..., - encoding: str, - errors: Optional[str] = ..., - input: Optional[str] = ..., - text: Optional[bool] = ..., - timeout: Optional[float] = ..., - ) -> CompletedProcess[str]: ... - @overload - def run( - args: _CMD, - bufsize: int = ..., - executable: _PATH = ..., - stdin: _FILE = ..., - stdout: _FILE = ..., - stderr: _FILE = ..., - preexec_fn: Callable[[], Any] = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: Optional[_PATH] = ..., - env: Optional[_ENV] = ..., - universal_newlines: bool = ..., - startupinfo: Any = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., - *, - capture_output: bool = ..., - check: bool = ..., - encoding: Optional[str] = ..., - errors: str, - input: Optional[str] = ..., - text: Optional[bool] = ..., - timeout: Optional[float] = ..., - ) -> CompletedProcess[str]: ... - @overload - def run( - args: _CMD, - bufsize: int = ..., - executable: _PATH = ..., - stdin: _FILE = ..., - stdout: _FILE = ..., - stderr: _FILE = ..., - preexec_fn: Callable[[], Any] = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: Optional[_PATH] = ..., - env: Optional[_ENV] = ..., - *, - universal_newlines: Literal[True], - startupinfo: Any = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., - # where the *real* keyword only args start - capture_output: bool = ..., - check: bool = ..., - encoding: Optional[str] = ..., - errors: Optional[str] = ..., - input: Optional[str] = ..., - text: Optional[bool] = ..., - timeout: Optional[float] = ..., - ) -> CompletedProcess[str]: ... - @overload - def run( - args: _CMD, - bufsize: int = ..., - executable: _PATH = ..., - stdin: _FILE = ..., - stdout: _FILE = ..., - stderr: _FILE = ..., - preexec_fn: Callable[[], Any] = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: Optional[_PATH] = ..., - env: Optional[_ENV] = ..., - universal_newlines: Literal[False] = ..., - startupinfo: Any = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., - *, - capture_output: bool = ..., - check: bool = ..., - encoding: None = ..., - errors: None = ..., - input: Optional[bytes] = ..., - text: Literal[None, False] = ..., - timeout: Optional[float] = ..., - ) -> CompletedProcess[bytes]: ... - @overload - def run( - args: _CMD, - bufsize: int = ..., - executable: _PATH = ..., - stdin: _FILE = ..., - stdout: _FILE = ..., - stderr: _FILE = ..., - preexec_fn: Callable[[], Any] = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: Optional[_PATH] = ..., - env: Optional[_ENV] = ..., - universal_newlines: bool = ..., - startupinfo: Any = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., - *, - capture_output: bool = ..., - check: bool = ..., - encoding: Optional[str] = ..., - errors: Optional[str] = ..., - input: Optional[_TXT] = ..., - text: Optional[bool] = ..., - timeout: Optional[float] = ..., - ) -> CompletedProcess[Any]: ... -elif sys.version_info >= (3, 6): - # Nearly same args as Popen.__init__ except for timeout, input, and check - @overload - def run( - args: _CMD, - bufsize: int = ..., - executable: _PATH = ..., - stdin: _FILE = ..., - stdout: _FILE = ..., - stderr: _FILE = ..., - preexec_fn: Callable[[], Any] = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: Optional[_PATH] = ..., - env: Optional[_ENV] = ..., - universal_newlines: bool = ..., - startupinfo: Any = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., - *, - check: bool = ..., - encoding: str, - errors: Optional[str] = ..., - input: Optional[str] = ..., - timeout: Optional[float] = ..., - ) -> CompletedProcess[str]: ... - @overload - def run( - args: _CMD, - bufsize: int = ..., - executable: _PATH = ..., - stdin: _FILE = ..., - stdout: _FILE = ..., - stderr: _FILE = ..., - preexec_fn: Callable[[], Any] = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: Optional[_PATH] = ..., - env: Optional[_ENV] = ..., - universal_newlines: bool = ..., - startupinfo: Any = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., - *, - check: bool = ..., - encoding: Optional[str] = ..., - errors: str, - input: Optional[str] = ..., - timeout: Optional[float] = ..., - ) -> CompletedProcess[str]: ... - @overload - def run( - args: _CMD, - bufsize: int = ..., - executable: _PATH = ..., - stdin: _FILE = ..., - stdout: _FILE = ..., - stderr: _FILE = ..., - preexec_fn: Callable[[], Any] = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: Optional[_PATH] = ..., - env: Optional[_ENV] = ..., - *, - universal_newlines: Literal[True], - startupinfo: Any = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., - # where the *real* keyword only args start - check: bool = ..., - encoding: Optional[str] = ..., - errors: Optional[str] = ..., - input: Optional[str] = ..., - timeout: Optional[float] = ..., - ) -> CompletedProcess[str]: ... - @overload - def run( - args: _CMD, - bufsize: int = ..., - executable: _PATH = ..., - stdin: _FILE = ..., - stdout: _FILE = ..., - stderr: _FILE = ..., - preexec_fn: Callable[[], Any] = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: Optional[_PATH] = ..., - env: Optional[_ENV] = ..., - universal_newlines: Literal[False] = ..., - startupinfo: Any = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., - *, - check: bool = ..., - encoding: None = ..., - errors: None = ..., - input: Optional[bytes] = ..., - timeout: Optional[float] = ..., - ) -> CompletedProcess[bytes]: ... - @overload - def run( - args: _CMD, - bufsize: int = ..., - executable: _PATH = ..., - stdin: _FILE = ..., - stdout: _FILE = ..., - stderr: _FILE = ..., - preexec_fn: Callable[[], Any] = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: Optional[_PATH] = ..., - env: Optional[_ENV] = ..., - universal_newlines: bool = ..., - startupinfo: Any = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., - *, - check: bool = ..., - encoding: Optional[str] = ..., - errors: Optional[str] = ..., - input: Optional[_TXT] = ..., - timeout: Optional[float] = ..., - ) -> CompletedProcess[Any]: ... -else: - # Nearly same args as Popen.__init__ except for timeout, input, and check - @overload - def run( - args: _CMD, - bufsize: int = ..., - executable: _PATH = ..., - stdin: _FILE = ..., - stdout: _FILE = ..., - stderr: _FILE = ..., - preexec_fn: Callable[[], Any] = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: Optional[_PATH] = ..., - env: Optional[_ENV] = ..., - *, - universal_newlines: Literal[True], - startupinfo: Any = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., - # where the *real* keyword only args start - check: bool = ..., - input: Optional[str] = ..., - timeout: Optional[float] = ..., - ) -> CompletedProcess[str]: ... - @overload - def run( - args: _CMD, - bufsize: int = ..., - executable: _PATH = ..., - stdin: _FILE = ..., - stdout: _FILE = ..., - stderr: _FILE = ..., - preexec_fn: Callable[[], Any] = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: Optional[_PATH] = ..., - env: Optional[_ENV] = ..., - universal_newlines: Literal[False] = ..., - startupinfo: Any = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., - *, - check: bool = ..., - input: Optional[bytes] = ..., - timeout: Optional[float] = ..., - ) -> CompletedProcess[bytes]: ... - @overload - def run( - args: _CMD, - bufsize: int = ..., - executable: _PATH = ..., - stdin: _FILE = ..., - stdout: _FILE = ..., - stderr: _FILE = ..., - preexec_fn: Callable[[], Any] = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: Optional[_PATH] = ..., - env: Optional[_ENV] = ..., - universal_newlines: bool = ..., - startupinfo: Any = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., - *, - check: bool = ..., - input: Optional[_TXT] = ..., - timeout: Optional[float] = ..., - ) -> CompletedProcess[Any]: ... - -# Same args as Popen.__init__ -def call(args: _CMD, - bufsize: int = ..., - executable: _PATH = ..., - stdin: _FILE = ..., - stdout: _FILE = ..., - stderr: _FILE = ..., - preexec_fn: Callable[[], Any] = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: Optional[_PATH] = ..., - env: Optional[_ENV] = ..., - universal_newlines: bool = ..., - startupinfo: Any = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., - timeout: Optional[float] = ...) -> int: ... - -# Same args as Popen.__init__ -def check_call(args: _CMD, - bufsize: int = ..., - executable: _PATH = ..., - stdin: _FILE = ..., - stdout: _FILE = ..., - stderr: _FILE = ..., - preexec_fn: Callable[[], Any] = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: Optional[_PATH] = ..., - env: Optional[_ENV] = ..., - universal_newlines: bool = ..., - startupinfo: Any = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., - timeout: Optional[float] = ...) -> int: ... - -if sys.version_info >= (3, 7): - # 3.7 added text - @overload - def check_output(args: _CMD, - bufsize: int = ..., - executable: _PATH = ..., - stdin: _FILE = ..., - stderr: _FILE = ..., - preexec_fn: Callable[[], Any] = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: Optional[_PATH] = ..., - env: Optional[_ENV] = ..., - universal_newlines: bool = ..., - startupinfo: Any = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., - *, - timeout: Optional[float] = ..., - input: _TXT = ..., - encoding: Optional[str] = ..., - errors: Optional[str] = ..., - text: Literal[True], - ) -> str: ... - @overload - def check_output(args: _CMD, - bufsize: int = ..., - executable: _PATH = ..., - stdin: _FILE = ..., - stderr: _FILE = ..., - preexec_fn: Callable[[], Any] = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: Optional[_PATH] = ..., - env: Optional[_ENV] = ..., - universal_newlines: bool = ..., - startupinfo: Any = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., - *, - timeout: Optional[float] = ..., - input: _TXT = ..., - encoding: str, - errors: Optional[str] = ..., - text: Optional[bool] = ..., - ) -> str: ... - @overload - def check_output(args: _CMD, - bufsize: int = ..., - executable: _PATH = ..., - stdin: _FILE = ..., - stderr: _FILE = ..., - preexec_fn: Callable[[], Any] = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: Optional[_PATH] = ..., - env: Optional[_ENV] = ..., - universal_newlines: bool = ..., - startupinfo: Any = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., - *, - timeout: Optional[float] = ..., - input: _TXT = ..., - encoding: Optional[str] = ..., - errors: str, - text: Optional[bool] = ..., - ) -> str: ... - @overload - def check_output(args: _CMD, - bufsize: int = ..., - executable: _PATH = ..., - stdin: _FILE = ..., - stderr: _FILE = ..., - preexec_fn: Callable[[], Any] = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: Optional[_PATH] = ..., - env: Optional[_ENV] = ..., - *, - universal_newlines: Literal[True], - startupinfo: Any = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., - # where the real keyword only ones start - timeout: Optional[float] = ..., - input: _TXT = ..., - encoding: Optional[str] = ..., - errors: Optional[str] = ..., - text: Optional[bool] = ..., - ) -> str: ... - @overload - def check_output(args: _CMD, - bufsize: int = ..., - executable: _PATH = ..., - stdin: _FILE = ..., - stderr: _FILE = ..., - preexec_fn: Callable[[], Any] = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: Optional[_PATH] = ..., - env: Optional[_ENV] = ..., - universal_newlines: Literal[False] = ..., - startupinfo: Any = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., - *, - timeout: Optional[float] = ..., - input: _TXT = ..., - encoding: None = ..., - errors: None = ..., - text: Literal[None, False] = ..., - ) -> bytes: ... - @overload - def check_output(args: _CMD, - bufsize: int = ..., - executable: _PATH = ..., - stdin: _FILE = ..., - stderr: _FILE = ..., - preexec_fn: Callable[[], Any] = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: Optional[_PATH] = ..., - env: Optional[_ENV] = ..., - universal_newlines: bool = ..., - startupinfo: Any = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., - *, - timeout: Optional[float] = ..., - input: _TXT = ..., - encoding: Optional[str] = ..., - errors: Optional[str] = ..., - text: Optional[bool] = ..., - ) -> Any: ... # morally: -> _TXT -elif sys.version_info >= (3, 6): - # 3.6 added encoding and errors - @overload - def check_output(args: _CMD, - bufsize: int = ..., - executable: _PATH = ..., - stdin: _FILE = ..., - stderr: _FILE = ..., - preexec_fn: Callable[[], Any] = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: Optional[_PATH] = ..., - env: Optional[_ENV] = ..., - universal_newlines: bool = ..., - startupinfo: Any = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., - *, - timeout: Optional[float] = ..., - input: _TXT = ..., - encoding: str, - errors: Optional[str] = ..., - ) -> str: ... - @overload - def check_output(args: _CMD, - bufsize: int = ..., - executable: _PATH = ..., - stdin: _FILE = ..., - stderr: _FILE = ..., - preexec_fn: Callable[[], Any] = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: Optional[_PATH] = ..., - env: Optional[_ENV] = ..., - universal_newlines: bool = ..., - startupinfo: Any = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., - *, - timeout: Optional[float] = ..., - input: _TXT = ..., - encoding: Optional[str] = ..., - errors: str, - ) -> str: ... - @overload - def check_output(args: _CMD, - bufsize: int = ..., - executable: _PATH = ..., - stdin: _FILE = ..., - stderr: _FILE = ..., - preexec_fn: Callable[[], Any] = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: Optional[_PATH] = ..., - env: Optional[_ENV] = ..., - startupinfo: Any = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., - *, - universal_newlines: Literal[True], - timeout: Optional[float] = ..., - input: _TXT = ..., - encoding: Optional[str] = ..., - errors: Optional[str] = ..., - ) -> str: ... - @overload - def check_output(args: _CMD, - bufsize: int = ..., - executable: _PATH = ..., - stdin: _FILE = ..., - stderr: _FILE = ..., - preexec_fn: Callable[[], Any] = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: Optional[_PATH] = ..., - env: Optional[_ENV] = ..., - universal_newlines: Literal[False] = ..., - startupinfo: Any = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., - *, - timeout: Optional[float] = ..., - input: _TXT = ..., - encoding: None = ..., - errors: None = ..., - ) -> bytes: ... - @overload - def check_output(args: _CMD, - bufsize: int = ..., - executable: _PATH = ..., - stdin: _FILE = ..., - stderr: _FILE = ..., - preexec_fn: Callable[[], Any] = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: Optional[_PATH] = ..., - env: Optional[_ENV] = ..., - universal_newlines: bool = ..., - startupinfo: Any = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., - *, - timeout: Optional[float] = ..., - input: _TXT = ..., - encoding: Optional[str] = ..., - errors: Optional[str] = ..., - ) -> Any: ... # morally: -> _TXT -else: - @overload - def check_output(args: _CMD, - bufsize: int = ..., - executable: _PATH = ..., - stdin: _FILE = ..., - stderr: _FILE = ..., - preexec_fn: Callable[[], Any] = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: Optional[_PATH] = ..., - env: Optional[_ENV] = ..., - startupinfo: Any = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., - timeout: Optional[float] = ..., - input: _TXT = ..., - *, - universal_newlines: Literal[True], - ) -> str: ... - @overload - def check_output(args: _CMD, - bufsize: int = ..., - executable: _PATH = ..., - stdin: _FILE = ..., - stderr: _FILE = ..., - preexec_fn: Callable[[], Any] = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: Optional[_PATH] = ..., - env: Optional[_ENV] = ..., - universal_newlines: Literal[False] = ..., - startupinfo: Any = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., - timeout: Optional[float] = ..., - input: _TXT = ..., - ) -> bytes: ... - @overload - def check_output(args: _CMD, - bufsize: int = ..., - executable: _PATH = ..., - stdin: _FILE = ..., - stderr: _FILE = ..., - preexec_fn: Callable[[], Any] = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: Optional[_PATH] = ..., - env: Optional[_ENV] = ..., - universal_newlines: bool = ..., - startupinfo: Any = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., - timeout: Optional[float] = ..., - input: _TXT = ..., - ) -> Any: ... # morally: -> _TXT - - -PIPE: int -STDOUT: int -DEVNULL: int -class SubprocessError(Exception): ... -class TimeoutExpired(SubprocessError): - def __init__(self, cmd: _CMD, timeout: float, output: Optional[_TXT] = ..., stderr: Optional[_TXT] = ...) -> None: ... - # morally: _CMD - cmd: Any - timeout: float - # morally: Optional[_TXT] - output: Any - stdout: Any - stderr: Any - - -class CalledProcessError(Exception): - returncode: int - # morally: _CMD - cmd: Any - # morally: Optional[_TXT] - output: Any - - # morally: Optional[_TXT] - stdout: Any - stderr: Any - - def __init__(self, - returncode: int, - cmd: _CMD, - output: Optional[_TXT] = ..., - stderr: Optional[_TXT] = ...) -> None: ... - -class Popen(Generic[AnyStr]): - args: _CMD - stdin: IO[AnyStr] - stdout: IO[AnyStr] - stderr: IO[AnyStr] - pid: int - returncode: int - - # Technically it is wrong that Popen provides __new__ instead of __init__ - # but this shouldn't come up hopefully? - - if sys.version_info >= (3, 7): - # text is added in 3.7 - @overload - def __new__(cls, - args: _CMD, - bufsize: int = ..., - executable: Optional[_PATH] = ..., - stdin: Optional[_FILE] = ..., - stdout: Optional[_FILE] = ..., - stderr: Optional[_FILE] = ..., - preexec_fn: Optional[Callable[[], Any]] = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: Optional[_PATH] = ..., - env: Optional[_ENV] = ..., - universal_newlines: bool = ..., - startupinfo: Optional[Any] = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., - *, - text: Optional[bool] = ..., - encoding: str, - errors: Optional[str] = ...) -> Popen[str]: ... - @overload - def __new__(cls, - args: _CMD, - bufsize: int = ..., - executable: Optional[_PATH] = ..., - stdin: Optional[_FILE] = ..., - stdout: Optional[_FILE] = ..., - stderr: Optional[_FILE] = ..., - preexec_fn: Optional[Callable[[], Any]] = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: Optional[_PATH] = ..., - env: Optional[_ENV] = ..., - universal_newlines: bool = ..., - startupinfo: Optional[Any] = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., - *, - text: Optional[bool] = ..., - encoding: Optional[str] = ..., - errors: str) -> Popen[str]: ... - @overload - def __new__(cls, - args: _CMD, - bufsize: int = ..., - executable: Optional[_PATH] = ..., - stdin: Optional[_FILE] = ..., - stdout: Optional[_FILE] = ..., - stderr: Optional[_FILE] = ..., - preexec_fn: Optional[Callable[[], Any]] = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: Optional[_PATH] = ..., - env: Optional[_ENV] = ..., - *, - universal_newlines: Literal[True], - startupinfo: Optional[Any] = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., - # where the *real* keyword only args start - text: Optional[bool] = ..., - encoding: Optional[str] = ..., - errors: Optional[str] = ...) -> Popen[str]: ... - @overload - def __new__(cls, - args: _CMD, - bufsize: int = ..., - executable: Optional[_PATH] = ..., - stdin: Optional[_FILE] = ..., - stdout: Optional[_FILE] = ..., - stderr: Optional[_FILE] = ..., - preexec_fn: Optional[Callable[[], Any]] = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: Optional[_PATH] = ..., - env: Optional[_ENV] = ..., - universal_newlines: bool = ..., - startupinfo: Optional[Any] = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., - *, - text: Literal[True], - encoding: Optional[str] = ..., - errors: Optional[str] = ...) -> Popen[str]: ... - @overload - def __new__(cls, - args: _CMD, - bufsize: int = ..., - executable: Optional[_PATH] = ..., - stdin: Optional[_FILE] = ..., - stdout: Optional[_FILE] = ..., - stderr: Optional[_FILE] = ..., - preexec_fn: Optional[Callable[[], Any]] = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: Optional[_PATH] = ..., - env: Optional[_ENV] = ..., - universal_newlines: Literal[False] = ..., - startupinfo: Optional[Any] = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., - *, - text: Literal[None, False] = ..., - encoding: None = ..., - errors: None = ...) -> Popen[bytes]: ... - @overload - def __new__(cls, - args: _CMD, - bufsize: int = ..., - executable: Optional[_PATH] = ..., - stdin: Optional[_FILE] = ..., - stdout: Optional[_FILE] = ..., - stderr: Optional[_FILE] = ..., - preexec_fn: Optional[Callable[[], Any]] = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: Optional[_PATH] = ..., - env: Optional[_ENV] = ..., - universal_newlines: bool = ..., - startupinfo: Optional[Any] = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., - *, - text: Optional[bool] = ..., - encoding: Optional[str] = ..., - errors: Optional[str] = ...) -> Popen[Any]: ... - elif sys.version_info >= (3, 6): - @overload - def __new__(cls, - args: _CMD, - bufsize: int = ..., - executable: Optional[_PATH] = ..., - stdin: Optional[_FILE] = ..., - stdout: Optional[_FILE] = ..., - stderr: Optional[_FILE] = ..., - preexec_fn: Optional[Callable[[], Any]] = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: Optional[_PATH] = ..., - env: Optional[_ENV] = ..., - universal_newlines: bool = ..., - startupinfo: Optional[Any] = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., - *, - encoding: str, - errors: Optional[str] = ...) -> Popen[str]: ... - @overload - def __new__(cls, - args: _CMD, - bufsize: int = ..., - executable: Optional[_PATH] = ..., - stdin: Optional[_FILE] = ..., - stdout: Optional[_FILE] = ..., - stderr: Optional[_FILE] = ..., - preexec_fn: Optional[Callable[[], Any]] = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: Optional[_PATH] = ..., - env: Optional[_ENV] = ..., - universal_newlines: bool = ..., - startupinfo: Optional[Any] = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., - *, - encoding: Optional[str] = ..., - errors: str) -> Popen[str]: ... - @overload - def __new__(cls, - args: _CMD, - bufsize: int = ..., - executable: Optional[_PATH] = ..., - stdin: Optional[_FILE] = ..., - stdout: Optional[_FILE] = ..., - stderr: Optional[_FILE] = ..., - preexec_fn: Optional[Callable[[], Any]] = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: Optional[_PATH] = ..., - env: Optional[_ENV] = ..., - *, - universal_newlines: Literal[True], - startupinfo: Optional[Any] = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., - # where the *real* keyword only args start - encoding: Optional[str] = ..., - errors: Optional[str] = ...) -> Popen[str]: ... - @overload - def __new__(cls, - args: _CMD, - bufsize: int = ..., - executable: Optional[_PATH] = ..., - stdin: Optional[_FILE] = ..., - stdout: Optional[_FILE] = ..., - stderr: Optional[_FILE] = ..., - preexec_fn: Optional[Callable[[], Any]] = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: Optional[_PATH] = ..., - env: Optional[_ENV] = ..., - universal_newlines: Literal[False] = ..., - startupinfo: Optional[Any] = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., - *, - encoding: None = ..., - errors: None = ...) -> Popen[bytes]: ... - @overload - def __new__(cls, - args: _CMD, - bufsize: int = ..., - executable: Optional[_PATH] = ..., - stdin: Optional[_FILE] = ..., - stdout: Optional[_FILE] = ..., - stderr: Optional[_FILE] = ..., - preexec_fn: Optional[Callable[[], Any]] = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: Optional[_PATH] = ..., - env: Optional[_ENV] = ..., - universal_newlines: bool = ..., - startupinfo: Optional[Any] = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ..., - *, - encoding: Optional[str] = ..., - errors: Optional[str] = ...) -> Popen[Any]: ... - else: - @overload - def __new__(cls, - args: _CMD, - bufsize: int = ..., - executable: Optional[_PATH] = ..., - stdin: Optional[_FILE] = ..., - stdout: Optional[_FILE] = ..., - stderr: Optional[_FILE] = ..., - preexec_fn: Optional[Callable[[], Any]] = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: Optional[_PATH] = ..., - env: Optional[_ENV] = ..., - *, - universal_newlines: Literal[True], - startupinfo: Optional[Any] = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ...) -> Popen[str]: ... - @overload - def __new__(cls, - args: _CMD, - bufsize: int = ..., - executable: Optional[_PATH] = ..., - stdin: Optional[_FILE] = ..., - stdout: Optional[_FILE] = ..., - stderr: Optional[_FILE] = ..., - preexec_fn: Optional[Callable[[], Any]] = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: Optional[_PATH] = ..., - env: Optional[_ENV] = ..., - *, - universal_newlines: Literal[False] = ..., - startupinfo: Optional[Any] = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ...) -> Popen[bytes]: ... - @overload - def __new__(cls, - args: _CMD, - bufsize: int = ..., - executable: Optional[_PATH] = ..., - stdin: Optional[_FILE] = ..., - stdout: Optional[_FILE] = ..., - stderr: Optional[_FILE] = ..., - preexec_fn: Optional[Callable[[], Any]] = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: Optional[_PATH] = ..., - env: Optional[_ENV] = ..., - universal_newlines: bool = ..., - startupinfo: Optional[Any] = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., - pass_fds: Any = ...) -> Popen[Any]: ... - - def poll(self) -> int: ... - def wait(self, timeout: Optional[float] = ...) -> int: ... - # Return str/bytes - def communicate(self, - input: Optional[AnyStr] = ..., - timeout: Optional[float] = ..., - # morally this should be optional - ) -> Tuple[AnyStr, AnyStr]: ... - def send_signal(self, signal: int) -> None: ... - def terminate(self) -> None: ... - def kill(self) -> None: ... - def __enter__(self: _S) -> _S: ... - def __exit__(self, type: Optional[Type[BaseException]], value: Optional[BaseException], traceback: Optional[TracebackType]) -> None: ... - -# The result really is always a str. -def getstatusoutput(cmd: _TXT) -> Tuple[int, str]: ... -def getoutput(cmd: _TXT) -> str: ... - -def list2cmdline(seq: Sequence[str]) -> str: ... # undocumented - -if sys.platform == 'win32': - class STARTUPINFO: - if sys.version_info >= (3, 7): - def __init__(self, *, dwFlags: int = ..., hStdInput: Optional[Any] = ..., hStdOutput: Optional[Any] = ..., hStdError: Optional[Any] = ..., wShowWindow: int = ..., lpAttributeList: Optional[Mapping[str, Any]] = ...) -> None: ... - dwFlags: int - hStdInput: Optional[Any] - hStdOutput: Optional[Any] - hStdError: Optional[Any] - wShowWindow: int - if sys.version_info >= (3, 7): - lpAttributeList: Mapping[str, Any] - - STD_INPUT_HANDLE: Any - STD_OUTPUT_HANDLE: Any - STD_ERROR_HANDLE: Any - SW_HIDE: int - STARTF_USESTDHANDLES: int - STARTF_USESHOWWINDOW: int - CREATE_NEW_CONSOLE: int - CREATE_NEW_PROCESS_GROUP: int - if sys.version_info >= (3, 7): - ABOVE_NORMAL_PRIORITY_CLASS: int - BELOW_NORMAL_PRIORITY_CLASS: int - HIGH_PRIORITY_CLASS: int - IDLE_PRIORITY_CLASS: int - NORMAL_PRIORITY_CLASS: int - REALTIME_PRIORITY_CLASS: int - CREATE_NO_WINDOW: int - DETACHED_PROCESS: int - CREATE_DEFAULT_ERROR_MODE: int - CREATE_BREAKAWAY_FROM_JOB: int