From 8d2923474f14bf11ed12bd1abe4a845fcd6dd7eb Mon Sep 17 00:00:00 2001 From: Josh Date: Wed, 6 Oct 2021 10:23:44 -0500 Subject: [PATCH 01/10] Bump pytest from 6.2.2 to 6.2.5 pytest 6.2.5 adds support for Python 3.10. [Link](https://github.com/pytest-dev/pytest/pull/8494) to relevant PR. --- tests/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/requirements.txt b/tests/requirements.txt index 0adbfc5..32781d9 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -1,6 +1,6 @@ coverage==5.4 pygments==2.7.4 -pytest==6.2.2 +pytest==6.2.5 pytest-cov==2.11.1 pytest-asyncio==0.14.0 pytest-mock==3.5.1 From 50a404ac5d385f3b1d320c9d532572c2e1603543 Mon Sep 17 00:00:00 2001 From: Josh Date: Wed, 6 Oct 2021 10:24:39 -0500 Subject: [PATCH 02/10] Add Python 3.10 to strategy matrix --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d0ccb6a..3c6e954 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,7 +15,7 @@ jobs: fail-fast: false matrix: os: [ubuntu, macos, windows] - python-version: ['3.6', '3.7', '3.8', '3.9'] + python-version: ['3.6', '3.7', '3.8', '3.9', "3.10"] runs-on: ${{ matrix.os }}-latest From d28a4394959ae813bc26f2d2a50dfad5a473d440 Mon Sep 17 00:00:00 2001 From: Josh Date: Wed, 6 Oct 2021 10:28:29 -0500 Subject: [PATCH 03/10] Bump `setup-python` GH action from v1 to v2 --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3c6e954..cce0584 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,7 +27,7 @@ jobs: - uses: actions/checkout@v2 - name: set up python - uses: actions/setup-python@v1 + uses: actions/setup-python@v2 with: python-version: ${{ matrix.python-version }} From 7bfc99fbc1e91617cf3f66ee79fd7524365c68e0 Mon Sep 17 00:00:00 2001 From: Josh Date: Wed, 6 Oct 2021 10:47:24 -0500 Subject: [PATCH 04/10] add Python 3.10 trove classifer --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index 84c3b41..9959da1 100644 --- a/setup.py +++ b/setup.py @@ -24,6 +24,7 @@ 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', + 'Programming Language :: Python :: 3.10', 'Intended Audience :: Developers', 'Intended Audience :: Information Technology', 'Intended Audience :: System Administrators', From 970c9638ce6199d0048c2f4c04c0c2870a765c2b Mon Sep 17 00:00:00 2001 From: Samuel Colvin Date: Sat, 12 Mar 2022 18:29:07 +0000 Subject: [PATCH 05/10] switch quotes, trigger tests --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cce0584..2c96018 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,7 +15,7 @@ jobs: fail-fast: false matrix: os: [ubuntu, macos, windows] - python-version: ['3.6', '3.7', '3.8', '3.9', "3.10"] + python-version: ['3.6', '3.7', '3.8', '3.9', '3.10'] runs-on: ${{ matrix.os }}-latest From a7812d70174abb533ac37d3cbda72f07e2bb4638 Mon Sep 17 00:00:00 2001 From: Samuel Colvin Date: Sat, 12 Mar 2022 18:35:00 +0000 Subject: [PATCH 06/10] fix ci --- .github/workflows/ci.yml | 10 +++++----- .gitignore | 2 +- setup.py | 3 +-- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2c96018..34f876f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,7 +15,7 @@ jobs: fail-fast: false matrix: os: [ubuntu, macos, windows] - python-version: ['3.6', '3.7', '3.8', '3.9', '3.10'] + python-version: ['3.7', '3.8', '3.9', '3.10'] runs-on: ${{ matrix.os }}-latest @@ -27,7 +27,7 @@ jobs: - uses: actions/checkout@v2 - name: set up python - uses: actions/setup-python@v2 + uses: actions/setup-python@v3 with: python-version: ${{ matrix.python-version }} @@ -49,9 +49,9 @@ jobs: steps: - uses: actions/checkout@v2 - - uses: actions/setup-python@v1 + - uses: actions/setup-python@v3 with: - python-version: '3.8' + python-version: '3.9' - run: pip install -r tests/requirements-linting.txt @@ -71,7 +71,7 @@ jobs: - name: set up python uses: actions/setup-python@v1 with: - python-version: '3.8' + python-version: '3.9' - name: install run: | diff --git a/.gitignore b/.gitignore index 80c1a3b..49e2078 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,6 @@ /.idea/ /env/ -/env35/ +/env*/ *.py[cod] *.egg-info/ build/ diff --git a/setup.py b/setup.py index 9959da1..1f36068 100644 --- a/setup.py +++ b/setup.py @@ -20,7 +20,6 @@ 'Programming Language :: Python', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3 :: Only', - 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', @@ -46,6 +45,6 @@ license='MIT', packages=['watchgod'], package_data={'watchgod': ['py.typed']}, - python_requires='>=3.6', + python_requires='>=3.7', zip_safe=True, ) From dcc613ead2e82e6efbba57c18eb5a01ab87b5b50 Mon Sep 17 00:00:00 2001 From: Samuel Colvin Date: Sat, 12 Mar 2022 18:42:21 +0000 Subject: [PATCH 07/10] linting on CI is behaving strangely... --- .codecov.yml | 9 +++++++++ .github/workflows/ci.yml | 6 +++--- Makefile | 2 ++ 3 files changed, 14 insertions(+), 3 deletions(-) create mode 100644 .codecov.yml diff --git a/.codecov.yml b/.codecov.yml new file mode 100644 index 0000000..a23c98b --- /dev/null +++ b/.codecov.yml @@ -0,0 +1,9 @@ +coverage: + precision: 2 + range: [90, 100] + status: + patch: false + project: false + +comment: + layout: 'header, diff, flags, files, footer' diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 34f876f..36c77a4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,7 +24,7 @@ jobs: OS: ${{ matrix.os }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: set up python uses: actions/setup-python@v3 @@ -47,7 +47,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: actions/setup-python@v3 with: @@ -66,7 +66,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: set up python uses: actions/setup-python@v1 diff --git a/Makefile b/Makefile index e4ff953..6353a7b 100644 --- a/Makefile +++ b/Makefile @@ -48,6 +48,8 @@ clean: rm -f `find . -type f -name '.*~' ` rm -rf .cache rm -rf htmlcov + rm -rf .pytest_cache + rm -rf .mypy_cache rm -rf *.egg-info rm -f .coverage rm -f .coverage.* From c43580da230f6c321d26087156af2047edf431ae Mon Sep 17 00:00:00 2001 From: Samuel Colvin Date: Sat, 12 Mar 2022 18:44:07 +0000 Subject: [PATCH 08/10] cat watcher.py --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 36c77a4..9aa53c1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -54,7 +54,7 @@ jobs: python-version: '3.9' - run: pip install -r tests/requirements-linting.txt - + - run: cat -n watchgod/watcher.py - run: make lint - run: make mypy From adf5bf070607fc3681e29fb56af30f32ff4d1cf8 Mon Sep 17 00:00:00 2001 From: Samuel Colvin Date: Sat, 12 Mar 2022 18:48:13 +0000 Subject: [PATCH 09/10] fix linting --- .github/workflows/ci.yml | 2 +- watchgod/watcher.py | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9aa53c1..36c77a4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -54,7 +54,7 @@ jobs: python-version: '3.9' - run: pip install -r tests/requirements-linting.txt - - run: cat -n watchgod/watcher.py + - run: make lint - run: make mypy diff --git a/watchgod/watcher.py b/watchgod/watcher.py index c4c07b7..61d9abb 100644 --- a/watchgod/watcher.py +++ b/watchgod/watcher.py @@ -61,17 +61,16 @@ def _walk_dir(self, dir_path: str, changes: Set['FileChange'], new_files: Dict[s if self.should_watch_dir(entry): self._walk_dir(entry.path, changes, new_files) elif self.should_watch_file(entry): - self._watch_file(entry.path, changes, new_files, entry.stat()) - except FileNotFoundError as e: + self._watch_file(entry.path, changes, new_files, entry.stat()) + except FileNotFoundError: # sometimes we can't find the file. If it was deleted since # `entry` was allocated, then it doesn't matter and can be # ignored. It might also be a bad symlink, in which case we # should silently skip it - users don't want to constantly spam - # warnings, esp if they can't remove the symlink (eg from a + # warnings, esp if they can't remove the symlink (e.g. from a # node_modules directory). pass - def check(self) -> Set['FileChange']: changes: Set['FileChange'] = set() new_files: Dict[str, float] = {} From b5900bf146a15c68a00f735ef1a08bbc4661a649 Mon Sep 17 00:00:00 2001 From: Samuel Colvin Date: Sat, 12 Mar 2022 18:51:12 +0000 Subject: [PATCH 10/10] uprev black --- tests/requirements-linting.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/requirements-linting.txt b/tests/requirements-linting.txt index 3eb0d4c..8c4b15b 100644 --- a/tests/requirements-linting.txt +++ b/tests/requirements-linting.txt @@ -1,4 +1,4 @@ -black==20.8b1 +black==22.1.0 flake8==3.8.4 flake8-quotes==3.2.0 isort==5.7.0