Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: update deps, remove isort and black. #31

Merged
merged 10 commits into from
Apr 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12']

steps:
- uses: actions/checkout@v3
Expand Down
13 changes: 7 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,15 @@ repos:
- id: check-symlinks
- id: detect-private-key
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.0.272
# Ruff version.
rev: v0.3.5
hooks:
# Run the linter.
- id: ruff
- repo: https://github.com/psf/black
rev: '23.3.0'
hooks:
- id: black
args: [--fix]
# Run the formatter.
- id: ruff-format
- repo: https://github.com/pre-commit/mirrors-mypy
rev: 'v1.3.0'
rev: 'v1.4.1'
hooks:
- id: mypy
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## [0.4.2] - 2024-04-01

### Fixes

- Fix bug with consuming abbreviated command line arguments

## [0.4.1] - 2024-02-06

### Fixes
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) [year] [fullname]
Copyright (c) 2021 Olzhas Arystanov

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
project = "pytest-watcher"
copyright = "2023, Olzhas Arystanov"
author = "Olzhas Arystanov"
release = "v0.4.1"
release = "v0.4.2"

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
Expand Down
783 changes: 368 additions & 415 deletions poetry.lock

Large diffs are not rendered by default.

37 changes: 6 additions & 31 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "pytest-watcher"
version = "0.4.1"
version = "0.4.2"
description = "Automatically rerun your tests on file modifications"
authors = ["Olzhas Arystanov <[email protected]>"]
license = "MIT"
Expand All @@ -18,9 +18,7 @@ classifiers = [
"Topic :: Software Development :: Testing",
"Topic :: Utilities",
]
include = [
"LICENSE",
]
include = ["LICENSE"]

[tool.poetry.scripts]
pytest-watcher = "pytest_watcher:run"
Expand All @@ -29,19 +27,17 @@ ptw = "pytest_watcher:run"
[tool.poetry.dependencies]
python = ">=3.7.0,<4.0.0"
watchdog = ">=2.0.0"
tomli = { version = "^2.0.1", python = "<3.11" }
tomli = { version = "^2.0.1", python = "<3.12" }

[tool.poetry.dev-dependencies]
pytest = "*"
black = "*"
ruff = "*"
mypy = "*"
isort = "*"
pytest-mock = "*"
freezegun = "*"
tox = "*"
sphinx = {version = "*", python = ">=3.8"}
coverage = {extras = ["toml"], version = "*"}
sphinx = { version = "*", python = ">=3.8" }
coverage = { extras = ["toml"], version = "*" }
myst-parser = "^1.0.0"
sphinx-rtd-theme = "^1.2.2"

Expand All @@ -53,30 +49,9 @@ build-backend = "poetry.core.masonry.api"
source = ["pytest_watcher"]
omit = ['pytest_watcher/__main__.py']

[tool.isort]
profile = 'black'
line_length = 89

[tool.black]
line-length = 89
target-version = ['py310']
include = '\.pyi?$'
exclude = '''
(
\.eggs
| \.git
| \.hg
| \.mypy_cache
| \.tox
| \.venv
| _build
| buck-out
| build
)
'''

[tool.ruff]
line-length = 89
lint.extend-select = ["I"]

[tool.mypy]
python_version = "3.7"
Expand Down
2 changes: 1 addition & 1 deletion pytest_watcher/constants.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VERSION = "0.4.1"
VERSION = "0.4.2"

DEFAULT_DELAY = 0.2
LOOP_DELAY = 0.1
1 change: 1 addition & 0 deletions pytest_watcher/parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ def _parse_patterns(arg: str):
Watch the <path> for file changes and trigger the test runner (pytest).\n
Additional arguments are passed directly to the test runner.
""",
allow_abbrev=False,
)
parser.add_argument("path", type=Path, help="The path to watch for file changes.")
parser.add_argument(
Expand Down
8 changes: 6 additions & 2 deletions tests/test_parse_arguments.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,15 @@ def test_ignore_patterns(args: List[str], ignore_patterns: List[str]):
([".", "--lf", "--nf", "-vv"], ["--lf", "--nf", "-vv"]),
([".", "--runner", "tox", "--lf", "--nf", "-vv"], ["--lf", "--nf", "-vv"]),
([".", "--lf", "--nf", "-vv", "--runner", "tox"], ["--lf", "--nf", "-vv"]),
(
[".", "--ignore", "tests/test_watcher.py"],
["--ignore", "tests/test_watcher.py"],
),
],
)
def test_runner_args(args: List[str], runner_args: List[str]):
_, runner_args = parse_arguments(args)
assert runner_args == runner_args
_, parsed_args = parse_arguments(args)
assert parsed_args == runner_args


def test_version(capsys: pytest.CaptureFixture):
Expand Down
3 changes: 2 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tox]
isolated_build = True
envlist = py37,py38,py39,py310,py311
envlist = py37,py38,py39,py310,py311,py312

[gh-actions]
python =
Expand All @@ -9,6 +9,7 @@ python =
3.9: py39
3.10: py310
3.11: py311
3.12: py312

[tox:.package]
basepython = python3
Expand Down
Loading