diff --git a/.azure/gpu-tests.yml b/.azure/gpu-tests.yml index ccf6a85c8..0bffa8285 100644 --- a/.azure/gpu-tests.yml +++ b/.azure/gpu-tests.yml @@ -18,7 +18,6 @@ jobs: # how much time to give 'run always even if cancelled tasks' before stopping them cancelTimeoutInMinutes: "2" - pool: lit-rtx-3090 variables: DEVICES: $( python -c 'name = "$(Agent.Name)" ; gpus = name.split("_")[-1] if "_" in name else "0,1"; print(gpus)' ) DEBIAN_FRONTEND: "noninteractive" @@ -32,6 +31,7 @@ jobs: image: "pytorch/pytorch:1.12.1-cuda11.3-cudnn8-runtime" #endpoint: azureContainerRegistryConnection options: "--gpus=all --shm-size=16g -v /usr/bin/docker:/tmp/docker:ro -v /var/tmp:/var/tmp" + pool: lit-rtx-3090 workspace: clean: all @@ -63,10 +63,10 @@ jobs: displayName: 'Sanity check' - bash: | - set -ex + set -e # Box2D requirement for swig - sudo apt-get remove swig -y - sudo apt-get install swig3.0 -y + sudo apt-get remove -y swig + sudo apt-get install -y swig3.0 sudo ln -s /usr/bin/swig3.0 /usr/bin/swig sudo apt-get update --fix-missing @@ -81,7 +81,7 @@ jobs: pip list displayName: 'Install pkg & dependencies' - - bash: | + - script: | set -ex mkdir -p datasets cd datasets @@ -91,13 +91,16 @@ jobs: displayName: Download ROMs - bash: | - python -m pytest pl_bolts tests -v --cov=pl_bolts --junitxml=$(Build.StagingDirectory)/test-results.xml --durations=30 + python -m pytest tests/ -v --cov=pl_bolts --junitxml=$(Build.StagingDirectory)/test-results.xml --durations=30 displayName: 'Testing' - bash: | python -m coverage report python -m coverage xml - python -m codecov --token=$(CODECOV_TOKEN) --commit=$(Build.SourceVersion) --flags=gpu,pytest --name="GPU-coverage" --env=linux,azure + + curl -Os https://uploader.codecov.io/latest/linux/codecov + chmod +x codecov + ./codecov --token=$(CODECOV_TOKEN) --commit=$(Build.SourceVersion) --flags=gpu,pytest --name="GPU-coverage" --env=linux,azure ls -l displayName: 'Statistics' @@ -116,3 +119,7 @@ jobs: # reportDirectory: '$(Build.SourcesDirectory)/htmlcov' # testRunTitle: '$(Agent.OS) - $(Build.BuildNumber)[$(Agent.JobName)] - Python $(python.version)' # condition: succeededOrFailed() + + - bash: rm -rf $(Build.SourcesDirectory) + condition: succeededOrFailed() + displayName: 'Cleanup' diff --git a/.github/workflows/ci-tests.yml b/.github/workflows/ci-tests.yml index 3b682360a..b724589c2 100644 --- a/.github/workflows/ci-tests.yml +++ b/.github/workflows/ci-tests.yml @@ -66,7 +66,7 @@ jobs: - name: Install package run: | pip install "pip==22.2.1" # todo: drop after resolving extras - pip install -e . --upgrade --find-links https://download.pytorch.org/whl/cpu/torch_stable.html + pip install -e . "coverage[toml]" --upgrade --find-links https://download.pytorch.org/whl/cpu/torch_stable.html pip list - name: Test Package [only] diff --git a/pyproject.toml b/pyproject.toml index dd6470d40..85e310c5a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,51 @@ +[metadata] +license_file = "LICENSE" +description-file = "README.md" + [build-system] requires = ["setuptools", "wheel"] + +[tool.check-manifest] +ignore = [ + "*.yml", + ".github", + ".github/*" +] + + +[tool.pytest.ini_options] +norecursedirs = [ + ".git", + ".github", + "dist", + "build", + "docs", +] +addopts = [ + "--strict-markers", + "--doctest-modules", + "--color=yes", + "--disable-pytest-warnings", +] +#filterwarnings = [ +# "error::FutureWarning", +#] +xfail_strict = false # todo +junit_duration_report = "call" + +[tool.coverage.report] +exclude_lines = [ + "pragma: no cover", + "pass", +] + +[tool.coverage.run] +parallel = true +# concurrency = "thread" +relative_files = true + + [tool.black] # https://github.com/psf/black line-length = 120 diff --git a/requirements/test.txt b/requirements/test.txt index e797ca899..b35d858f1 100644 --- a/requirements/test.txt +++ b/requirements/test.txt @@ -1,4 +1,4 @@ -# coverage>=5.0 +coverage[toml] >7.0 pytest >7.0.0, <=7.3.1 pytest-cov >=3.0.0, <4.0.0 # pytest-flake8 diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index a88776734..000000000 --- a/setup.cfg +++ /dev/null @@ -1,41 +0,0 @@ -[tool:pytest] -norecursedirs = - .git - dist - build -addopts = - --strict-markers - --doctest-modules - --durations=0 - --color=yes - - -[coverage:run] -parallel = True -#concurrency = thread, multiprocessing -concurrency = thread - -[coverage:report] -exclude_lines = - pragma: no-cover - pass - if __name__ == .__main__.: -# TODO, remove this ignores in future -omit = - pl_bolts/datamodules/*_datamodule.py - pl_bolts/datamodules/*_dataset.py - - -[check-manifest] -ignore = - *.yml - .github - .github/* - .circleci - - -[metadata] -license_file = LICENSE -description-file = README.md -# long_description = file:README.md -# long_description_content_type = text/markdown