diff --git a/.cruft.json b/.cruft.json index 6c748f9..b0f680c 100644 --- a/.cruft.json +++ b/.cruft.json @@ -1,6 +1,6 @@ { "template": "https://github.com/iterative/cookiecutter-dvc-plugin", - "commit": "13d5c9b49c49d3c14106cb4f9aa61d07876c039b", + "commit": "fef394b15f2800a69b5ee11ddcc9e4c5339ae5f5", "checkout": null, "context": { "cookiecutter": { diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index adcce1c..ab963e7 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -1,23 +1,30 @@ name: Release + on: release: types: [published] + +permissions: + contents: read + jobs: pip: - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v3 with: fetch-depth: 0 - - name: Set up Python 3.8 - uses: actions/setup-python@v3 + - uses: actions/setup-python@v3 with: python-version: 3.8 - - name: Build packages + - name: Install run: | - pip install -U pip - pip install -U build setuptools>=58.2 - python -m build --sdist --wheel --outdir dist/ + pip install --upgrade pip wheel + pip install build twine + - name: Build + run: | + python -m build + twine check dist/* - name: Publish packages to PyPI uses: pypa/gh-action-pypi-publish@master with: diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index a85f28a..ecb168c 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -1,45 +1,21 @@ name: Tests on: - pull_request: {} - push: {} + push: + branches: [main] + pull_request: schedule: - cron: '5 1 * * *' # every day at 01:05 - workflow_dispatch: -env: - DVC_TEST: "true" - HOMEBREW_NO_AUTO_UPDATE: 1 - SHELL: /bin/bash +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +permissions: + contents: read jobs: - lint: - timeout-minutes: 10 - runs-on: ubuntu-latest - steps: - - name: Cancel Previous Runs - uses: styfle/cancel-workflow-action@0.9.1 - with: - access_token: ${{ github.token }} - - uses: actions/checkout@v2.4.0 - with: - fetch-depth: 0 - - name: Set up Python 3.8 - uses: actions/setup-python@v2.2.2 - with: - python-version: 3.8 - - name: Install kerb5-config - run: sudo apt-get install libkrb5-dev - - name: Install requirements - run: | - pip install wheel - pip install git+https://github.com/iterative/dvc pre-commit - pip install git+https://github.com/iterative/dvc-hdfs - pip install -e '.[tests]' - - name: Check README - run: python setup.py checkdocs - - uses: pre-commit/action@v2.0.3 tests: timeout-minutes: 45 runs-on: ${{ matrix.os }} @@ -47,50 +23,42 @@ jobs: fail-fast: false matrix: os: [ubuntu-20.04, windows-latest, macos-latest] - pyv: ["3.8", "3.9", "3.10"] - exclude: - # no wheels for pygit2 yet - - os: windows-latest - pyv: "3.10" + pyv: ["3.8", "3.9", "3.10", "3.11"] + steps: - - uses: actions/checkout@v2.4.0 + - uses: actions/checkout@v3 with: fetch-depth: 0 + - name: Set up Python - uses: actions/setup-python@v2.2.2 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.pyv }} - - name: get pip cache dir - id: pip-cache-dir - run: | - echo "::set-output name=dir::$(pip cache dir)" - - name: set pip cache - id: pip-cache - uses: actions/cache@v2.1.6 - with: - path: ${{ steps.pip-cache-dir.outputs.dir }} - key: ${{ runner.os }}-pip-${{ hashFiles('setup.cfg') }} - restore-keys: | - ${{ runner.os }}-pip- + cache: 'pip' + cache-dependency-path: setup.cfg + - name: Install kerb5-config if: matrix.os == 'ubuntu-20.04' run: sudo apt-get install libkrb5-dev + - 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 git+https://github.com/iterative/dvc pip install git+https://github.com/iterative/dvc-hdfs pip install -e ".[tests]" - - name: setup git - run: | - git config --global user.email "dvctester@example.com" - git config --global user.name "DVC Tester" + pip install "dvc[testing] @ git+https://github.com/iterative/dvc" + + - name: lint + timeout-minutes: 10 + uses: pre-commit/action@v3.0.0 + - name: run tests - timeout-minutes: 40 + timeout-minutes: 15 run: pytest -v -n=auto --cov-report=xml --cov-report=term + - name: upload coverage report - uses: codecov/codecov-action@v2.1.0 + uses: codecov/codecov-action@v3 with: file: ./coverage.xml fail_ci_if_error: false diff --git a/.github/workflows/tests.yaml.rej b/.github/workflows/tests.yaml.rej deleted file mode 100644 index 3e18982..0000000 --- a/.github/workflows/tests.yaml.rej +++ /dev/null @@ -1,10 +0,0 @@ -diff a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml (rejected hunks) -@@ -74,7 +74,7 @@ jobs: - run: | - pip install --upgrade pip setuptools wheel - pip install -e ".[tests]" -- pip install git+https://github.com/iterative/dvc -+ pip install "dvc[testing]@git+https://github.com/iterative/dvc" - - name: setup git - run: | - git config --global user.email "dvctester@example.com" diff --git a/.github/workflows/update-template.yaml b/.github/workflows/update-template.yaml index 3aa58b1..d4963aa 100644 --- a/.github/workflows/update-template.yaml +++ b/.github/workflows/update-template.yaml @@ -3,14 +3,13 @@ name: Update template on: schedule: - cron: '5 1 * * *' # every day at 01:05 - workflow_dispatch: jobs: update: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Install deps run: pip install cruft - name: Update template @@ -25,4 +24,3 @@ jobs: commit-message: update template title: update template token: ${{ secrets.WORKFLOW_TOKEN }} - diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 6893e60..2f51cd7 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -32,7 +32,7 @@ repos: - flake8-comprehensions - flake8-debugger - flake8-string-format - repo: https://gitlab.com/pycqa/flake8 + repo: https://github.com/pycqa/flake8 rev: 3.9.2 - repo: local hooks: diff --git a/dvc_webhdfs/tests/fixtures.py b/dvc_webhdfs/tests/fixtures.py index 7bb740f..f8b1c61 100644 --- a/dvc_webhdfs/tests/fixtures.py +++ b/dvc_webhdfs/tests/fixtures.py @@ -16,5 +16,5 @@ def _make_webhdfs(): @pytest.fixture -def webhdfs(make_webhdfs): +def webhdfs(make_webhdfs): # pylint: disable=redefined-outer-name return make_webhdfs() diff --git a/setup.cfg b/setup.cfg index ed87307..df7b257 100644 --- a/setup.cfg +++ b/setup.cfg @@ -17,6 +17,7 @@ classifiers = Programming Language :: Python :: 3.8 Programming Language :: Python :: 3.9 Programming Language :: Python :: 3.10 + Programming Language :: Python :: 3.11 [options] setup_requires = @@ -46,7 +47,7 @@ tests = mock==4.0.3 wget==3.2 filelock==3.3.2 - crc32c==2.2.post0 + crc32c==2.3 xmltodict==0.12.0 hdfs==2.6.0 # required by collective.checkdocs @@ -54,14 +55,14 @@ tests = collective.checkdocs==0.2 pydocstyle==6.1.1 # pylint requirements - pylint==2.11.1 + pylint==2.15.9 # we use this to suppress pytest-related false positives in our tests. pylint-pytest==1.1.2 # we use this to suppress some messages in tests, eg: foo/bar naming, # and, protected method calls in our tests pylint-plugin-utils==0.6 # type-checking - mypy==0.910 + mypy==0.991 types-requests==2.25.11 types-tabulate==0.8.3 types-toml==0.10.1