Skip to content

Commit 7f0b77b

Browse files
authoredJan 5, 2023
Merge pull request #31 from iterative/get-rid-of-pytest-pylint
2 parents f77d814 + 5a927b2 commit 7f0b77b

File tree

8 files changed

+50
-100
lines changed

8 files changed

+50
-100
lines changed
 

‎.cruft.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"template": "https://github.com/iterative/cookiecutter-dvc-plugin",
3-
"commit": "5e07217326c0c136274315e550e3932668a407a7",
3+
"commit": "254d2976fe65d918e86f7612c8d6540771e9ef81",
44
"checkout": null,
55
"context": {
66
"cookiecutter": {

‎.github/workflows/release.yaml

+14-7
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,30 @@
11
name: Release
2+
23
on:
34
release:
45
types: [published]
6+
7+
permissions:
8+
contents: read
9+
510
jobs:
611
pip:
7-
runs-on: ubuntu-18.04
12+
runs-on: ubuntu-20.04
813
steps:
914
- uses: actions/checkout@v3
1015
with:
1116
fetch-depth: 0
12-
- name: Set up Python 3.8
13-
uses: actions/setup-python@v3
17+
- uses: actions/setup-python@v3
1418
with:
1519
python-version: 3.8
16-
- name: Build packages
20+
- name: Install
1721
run: |
18-
pip install -U pip
19-
pip install -U build setuptools>=58.2
20-
python -m build --sdist --wheel --outdir dist/
22+
pip install --upgrade pip wheel
23+
pip install build twine
24+
- name: Build
25+
run: |
26+
python -m build
27+
twine check dist/*
2128
- name: Publish packages to PyPI
2229
uses: pypa/gh-action-pypi-publish@release/v1
2330
with:

‎.github/workflows/tests.yaml

+26-57
Original file line numberDiff line numberDiff line change
@@ -1,87 +1,56 @@
11
name: Tests
22

33
on:
4-
pull_request: {}
5-
push: {}
4+
push:
5+
branches: [main]
6+
pull_request:
67
schedule:
78
- cron: '5 1 * * *' # every day at 01:05
8-
99
workflow_dispatch:
1010

11-
env:
12-
DVC_TEST: "true"
13-
HOMEBREW_NO_AUTO_UPDATE: 1
14-
SHELL: /bin/bash
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
13+
cancel-in-progress: true
14+
15+
permissions:
16+
contents: read
1517

1618
jobs:
17-
lint:
18-
timeout-minutes: 10
19-
runs-on: ubuntu-latest
20-
steps:
21-
- name: Cancel Previous Runs
22-
uses: styfle/cancel-workflow-action@0.9.1
23-
with:
24-
access_token: ${{ github.token }}
25-
- uses: actions/checkout@v2.4.0
26-
with:
27-
fetch-depth: 0
28-
- name: Set up Python 3.8
29-
uses: actions/setup-python@v2.2.2
30-
with:
31-
python-version: 3.8
32-
- name: Install requirements
33-
run: |
34-
pip install wheel
35-
pip install -e '.[tests]'
36-
pip install git+https://github.com/iterative/dvc pre-commit
37-
- name: Check README
38-
run: python setup.py checkdocs
39-
- uses: pre-commit/action@v2.0.3
4019
tests:
4120
timeout-minutes: 45
4221
runs-on: ${{ matrix.os }}
4322
strategy:
4423
fail-fast: false
4524
matrix:
4625
os: [ubuntu-20.04, windows-latest, macos-latest]
47-
pyv: ["3.8", "3.9", "3.10"]
48-
exclude:
49-
# no wheels for pygit2 yet
50-
- os: windows-latest
51-
pyv: "3.10"
26+
pyv: ["3.8", "3.9", "3.10", "3.11"]
27+
5228
steps:
53-
- uses: actions/checkout@v2.4.0
29+
- uses: actions/checkout@v3
5430
with:
5531
fetch-depth: 0
32+
5633
- name: Set up Python
57-
uses: actions/setup-python@v2.2.2
34+
uses: actions/setup-python@v4
5835
with:
5936
python-version: ${{ matrix.pyv }}
60-
- name: get pip cache dir
61-
id: pip-cache-dir
62-
run: |
63-
echo "::set-output name=dir::$(pip cache dir)"
64-
- name: set pip cache
65-
id: pip-cache
66-
uses: actions/cache@v2.1.6
67-
with:
68-
path: ${{ steps.pip-cache-dir.outputs.dir }}
69-
key: ${{ runner.os }}-pip-${{ hashFiles('setup.cfg') }}
70-
restore-keys: |
71-
${{ runner.os }}-pip-
37+
cache: 'pip'
38+
cache-dependency-path: setup.cfg
39+
7240
- name: install
73-
if: steps.cache.pip-cache-dir.cache-hit != 'true'
7441
run: |
75-
pip install --upgrade pip setuptools wheel
42+
pip install --upgrade pip wheel
7643
pip install -e ".[tests]"
77-
pip install "dvc[testing]@git+https://github.com/iterative/dvc"
78-
- name: setup git
79-
run: |
80-
git config --global user.email "dvctester@example.com"
81-
git config --global user.name "DVC Tester"
44+
pip install "dvc[testing] @ git+https://github.com/iterative/dvc"
45+
46+
- name: lint
47+
timeout-minutes: 10
48+
uses: pre-commit/action@v3.0.0
49+
8250
- name: run tests
83-
timeout-minutes: 40
51+
timeout-minutes: 15
8452
run: pytest -v -n=auto --cov-report=xml --cov-report=term
53+
8554
- name: upload coverage report
8655
uses: codecov/codecov-action@v2.1.0
8756
with:

‎.github/workflows/update-template.yaml

+1-3
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,13 @@ name: Update template
33
on:
44
schedule:
55
- cron: '5 1 * * *' # every day at 01:05
6-
76
workflow_dispatch:
87

98
jobs:
109
update:
1110
runs-on: ubuntu-latest
1211
steps:
13-
- uses: actions/checkout@v2
12+
- uses: actions/checkout@v3
1413
- name: Install deps
1514
run: pip install cruft
1615
- name: Update template
@@ -25,4 +24,3 @@ jobs:
2524
commit-message: update template
2625
title: update template
2726
token: ${{ secrets.WORKFLOW_TOKEN }}
28-

‎dvc_http/tests/cloud.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def mkdir(self, mode=0o777, parents=False, exist_ok=False):
1717

1818
def write_bytes(self, contents):
1919
assert isinstance(contents, bytes)
20-
response = requests.post(self.url, data=contents)
20+
response = requests.post(self.url, data=contents, timeout=300)
2121
assert response.status_code == 200
2222

2323
@property

‎dvc_http/tests/fixtures.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# pylint: disable=redefined-outer-name
12
import os
23

34
import pytest

‎pyproject.toml

+4-6
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,13 @@ files = ["dvc_http"]
5454
[tool.pylint.master]
5555
extension-pkg-whitelist = ["pygit2"]
5656
init-hook = "import sys; sys.path.append(str('tests'))"
57-
load-plugins = ["pylint_pytest"]
5857

5958
[tool.pylint.message_control]
6059
disable = [
61-
"format", "refactoring", "spelling", "design", "no-self-use",
62-
"invalid-name", "misplaced-comparison-constant", "duplicate-code", "fixme",
63-
"unused-wildcard-import", "cyclic-import", "wrong-import-order",
64-
"wrong-import-position", "ungrouped-imports", "multiple-imports",
65-
"logging-format-interpolation", "logging-fstring-interpolation",
60+
"format", "refactoring", "spelling", "design", "invalid-name",
61+
"duplicate-code", "fixme", "unused-wildcard-import", "cyclic-import",
62+
"wrong-import-order", "wrong-import-position", "ungrouped-imports",
63+
"multiple-imports", "logging-format-interpolation", "logging-fstring-interpolation",
6664
"missing-function-docstring", "missing-module-docstring",
6765
"missing-class-docstring", "raise-missing-from", "import-outside-toplevel",
6866
]

‎setup.cfg

+2-25
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ classifiers =
1717
Programming Language :: Python :: 3.8
1818
Programming Language :: Python :: 3.9
1919
Programming Language :: Python :: 3.10
20+
Programming Language :: Python :: 3.11
2021

2122
[options]
2223
setup_requires =
@@ -33,41 +34,17 @@ install_requires =
3334

3435
[options.extras_require]
3536
tests =
36-
wheel==0.37.0
3737
dvc[testing]
3838
# Test requirements
3939
pytest==6.2.5
4040
pytest-cov==3.0.0
4141
pytest-xdist==2.4.0
4242
pytest-mock==3.6.1
43-
pytest-lazy-fixture==0.6.3
44-
pytest-docker==0.10.3
4543
flaky==3.7.0
46-
mock==4.0.3
4744
rangehttpserver==1.2.0
48-
wget==3.2
49-
filelock==3.3.2
50-
wsgidav==3.1.1
51-
crc32c==2.2.post0
52-
xmltodict==0.12.0
53-
# required by collective.checkdocs
54-
Pygments==2.10.0
55-
collective.checkdocs==0.2
56-
pydocstyle==6.1.1
57-
# pylint requirements
58-
pylint==2.11.1
59-
# we use this to suppress pytest-related false positives in our tests.
60-
pylint-pytest==1.1.2
61-
# we use this to suppress some messages in tests, eg: foo/bar naming,
62-
# and, protected method calls in our tests
63-
pylint-plugin-utils==0.6
64-
# type-checking
45+
pylint==2.15.9
6546
mypy==0.910
6647
types-requests==2.25.11
67-
types-tabulate==0.8.3
68-
types-toml==0.10.1
69-
# optional dependencies
70-
pywin32>=225; sys_platform == 'win32'
7148

7249
[flake8]
7350
ignore=

0 commit comments

Comments
 (0)
Please sign in to comment.