diff --git a/.codecov.yml b/.codecov.yml deleted file mode 100644 index 0f2bc4512..000000000 --- a/.codecov.yml +++ /dev/null @@ -1,10 +0,0 @@ -comment: false -coverage: - status: - project: - default: - target: 90 - threshold: 10% - patch: - default: - threshold: 25% diff --git a/.coveragerc b/.coveragerc deleted file mode 100644 index cca27a875..000000000 --- a/.coveragerc +++ /dev/null @@ -1,16 +0,0 @@ -[run] -branch = True -source = dvc -omit = - *__main__.py - -[report] -exclude_lines = - if __name__ == .__main__.: - if typing.TYPE_CHECKING: - if TYPE_CHECKING: - pass - raise NotImplementedError - # pragma: no cover - # pragma: no cover - \.\.\.$ diff --git a/.github/workflows/packages.yaml b/.github/workflows/packages.yaml index a1b71498e..f85667301 100644 --- a/.github/workflows/packages.yaml +++ b/.github/workflows/packages.yaml @@ -50,7 +50,7 @@ jobs: - name: Install deps run: | - pip install -U wheel pip setuptools + pip install --upgrade pip wheel setuptools pip install .[all] pip install -r scripts/build-requirements.txt @@ -84,11 +84,13 @@ jobs: python-version: 3.8 - name: Install - run: pip install -U wheel pip build setuptools_scm + run: pip install --upgrade pip wheel - name: Force version for Test PyPI uploads if: ${{ !startsWith(github.ref, 'refs/tags') }} - run: echo version=$(python -m setuptools_scm | awk -F+ '{print $1}' | tail -1) >> $GITHUB_ENV + run: | + pip install setuptools_scm + echo version=$(python -m setuptools_scm | awk -F+ '{print $1}' | tail -1) >> $GITHUB_ENV - name: Build packages run: ./scripts/build_package.sh diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index e76f0a7e6..b02b30373 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -36,11 +36,8 @@ jobs: cache-dependency-path: pyproject.toml - name: Install requirements run: | - pip install --upgrade pip setuptools wheel - pip install collective.checkdocs==0.2 + pip install --upgrade pip wheel pip install ".[dev]" - - name: Check README - run: python setup.py checkdocs - uses: pre-commit/action@v3.0.0 tests: timeout-minutes: 45 @@ -67,13 +64,12 @@ jobs: cache: pip cache-dependency-path: pyproject.toml - name: install - if: steps.cache.pip-cache-dir.cache-hit != 'true' run: | - pip install --upgrade pip setuptools wheel + pip install --upgrade pip wheel pip install -e ".[dev]" - name: run tests timeout-minutes: 20 - run: pytest -nauto -ra --durations 100 --cov=dvc --cov-report=xml --cov-report=term -k "${{ matrix.pytest-filter }}" + run: pytest -nauto --durations 100 --cov --cov-report=xml --cov-report=term -k "${{ matrix.pytest-filter }}" - name: upload coverage report uses: codecov/codecov-action@v3 with: @@ -81,9 +77,7 @@ jobs: fail_ci_if_error: false notify: if: github.ref == 'refs/heads/main' && failure() - needs: - - lint - - tests + needs: [lint, tests] runs-on: ubuntu-latest steps: - name: Slack Notification diff --git a/MANIFEST.in b/MANIFEST.in deleted file mode 100644 index de1a24c8d..000000000 --- a/MANIFEST.in +++ /dev/null @@ -1,3 +0,0 @@ -include LICENSE -recursive-include requirements *.txt -recursive-include dvc/repo/plots/templates *.json diff --git a/pyproject.toml b/pyproject.toml index 0c1770920..dc988187a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -132,8 +132,8 @@ dvc = "dvc.api:DVCFileSystem" [tool.setuptools] license-files = ["LICENSE"] -[tool.setuptools.packages.find] -exclude = ["tests", "tests.*"] +[tool.setuptools.packages] +find = {namespaces = false, exclude=["tests", "tests.*"]} [tool.setuptools_scm] write_to = "dvc/_dvc_version.py" @@ -163,13 +163,33 @@ line_length = 79 [tool.pytest.ini_options] log_level = "debug" -addopts = "-ra -p no:hydra_pytest" +addopts = "-ra -p no:hydra_pytest --cov-config pyproject.toml" markers = [ "needs_internet: Might need network access for the tests", "vscode: Tests verifying contract between DVC and VSCode plugin", "studio: Tests verifying contract between DVC and Studio", ] xfail_strict = true +testpaths = ["tests"] + +[tool.coverage.run] +branch = true +source = ["dvc", "tests"] + +[tool.coverage.paths] +source = ["dvc"] + +[tool.coverage.report] +show_missing = true +exclude_lines = [ + "pragma: no cover", + "if __name__ == .__main__.:", + "if typing.TYPE_CHECKING:", + "if TYPE_CHECKING:", + "raise NotImplementedError", + "raise AssertionError", + "@overload", +] [tool.mypy] # Error output diff --git a/scripts/build_package.sh b/scripts/build_package.sh index 2b3501bc7..cdc6b9e35 100755 --- a/scripts/build_package.sh +++ b/scripts/build_package.sh @@ -10,5 +10,6 @@ fi echo 'PKG = "pip"' >dvc/utils/build.py -python -m pip install -U build setuptools>=61 +python -m pip install build twine python -m build +twine check dist/* diff --git a/scripts/pypi_upload.sh b/scripts/pypi_upload.sh deleted file mode 100755 index 64ee9e36c..000000000 --- a/scripts/pypi_upload.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash - -set -e - -if [ ! -d "dvc" ]; then - echo "Please run this script from repository root" - exit 1 -fi - -rm -rf dist/ -pip install twine -python -m pip install -U build setuptools>=58.2 -python -m build --sdist --wheel --outdir dist/ -twine upload dist/*