Skip to content

Commit

Permalink
Add support for Python 3.10 (#87)
Browse files Browse the repository at this point in the history
* Bump pytest from 6.2.2 to 6.2.5

pytest 6.2.5 adds support for Python 3.10. [Link](pytest-dev/pytest#8494) to relevant PR.

* Add Python 3.10 to strategy matrix

* Bump `setup-python` GH action from v1 to v2

* add Python 3.10 trove classifer

* switch quotes, trigger tests

* fix ci

* linting on CI is behaving strangely...

* cat watcher.py

* fix linting

* uprev black

Co-authored-by: Samuel Colvin <s@muelcolvin.com>
  • Loading branch information
joshuadavidthomas and samuelcolvin committed Mar 12, 2022
1 parent c9a4622 commit f3338e0
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 17 deletions.
9 changes: 9 additions & 0 deletions .codecov.yml
@@ -0,0 +1,9 @@
coverage:
precision: 2
range: [90, 100]
status:
patch: false
project: false

comment:
layout: 'header, diff, flags, files, footer'
16 changes: 8 additions & 8 deletions .github/workflows/ci.yml
Expand Up @@ -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.7', '3.8', '3.9', '3.10']

runs-on: ${{ matrix.os }}-latest

Expand All @@ -24,10 +24,10 @@ jobs:
OS: ${{ matrix.os }}

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: set up python
uses: actions/setup-python@v1
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}

Expand All @@ -47,11 +47,11 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- 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

Expand All @@ -66,12 +66,12 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: set up python
uses: actions/setup-python@v1
with:
python-version: '3.8'
python-version: '3.9'

- name: install
run: |
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
@@ -1,6 +1,6 @@
/.idea/
/env/
/env35/
/env*/
*.py[cod]
*.egg-info/
build/
Expand Down
2 changes: 2 additions & 0 deletions Makefile
Expand Up @@ -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.*
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Expand Up @@ -20,10 +20,10 @@
'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',
'Programming Language :: Python :: 3.10',
'Intended Audience :: Developers',
'Intended Audience :: Information Technology',
'Intended Audience :: System Administrators',
Expand All @@ -45,6 +45,6 @@
license='MIT',
packages=['watchgod'],
package_data={'watchgod': ['py.typed']},
python_requires='>=3.6',
python_requires='>=3.7',
zip_safe=True,
)
2 changes: 1 addition & 1 deletion 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
Expand Down
2 changes: 1 addition & 1 deletion 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
Expand Down
7 changes: 3 additions & 4 deletions watchgod/watcher.py
Expand Up @@ -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] = {}
Expand Down

0 comments on commit f3338e0

Please sign in to comment.