Skip to content
Open
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
27 changes: 6 additions & 21 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,28 +1,13 @@
repos:
- repo: https://github.com/asottile/pyupgrade
rev: v2.11.0
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.12.9
hooks:
- id: pyupgrade
args:
- --keep-percent-format

- repo: https://github.com/psf/black
rev: 20.8b1
hooks:
- id: black

- repo: https://gitlab.com/pycqa/flake8
rev: 3.9.0
hooks:
- id: flake8

- repo: https://github.com/asottile/yesqa
rev: v1.2.2
hooks:
- id: yesqa
- id: ruff-check
args: [ --fix ]
- id: ruff-format

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.4.0
rev: v6.0.0
hooks:
- id: check-merge-conflict
- id: check-toml
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ select = [
"F",
"UP",
"I",
"RUF",
]
ignore = [
"E501",
Expand Down
2 changes: 1 addition & 1 deletion src/incremental/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -548,4 +548,4 @@ def _extract_tool_incremental(data: Dict[str, object]) -> Optional[Dict[str, obj

from ._version import __version__ # noqa: E402

__all__ = ["__version__", "Version", "getVersionString"]
__all__ = ["Version", "__version__", "getVersionString"]
29 changes: 10 additions & 19 deletions src/incremental/update.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,31 +48,22 @@ def _run(
path = _findPath(_getcwd(), package)

if (
newversion
and patch
or newversion
and dev
or newversion
and rc
or newversion
and post
(newversion and patch)
or (newversion and dev)
or (newversion and rc)
or (newversion and post)
):
raise ValueError("Only give --newversion")

if dev and patch or dev and rc or dev and post:
if (dev and patch) or (dev and rc) or (dev and post):
raise ValueError("Only give --dev")

if (
create
and dev
or create
and patch
or create
and rc
or create
and post
or create
and newversion
(create and dev)
or (create and patch)
or (create and rc)
or (create and post)
or (create and newversion)
):
raise ValueError("Only give --create")

Expand Down
4 changes: 2 additions & 2 deletions tests/test_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
from subprocess import run
from tempfile import TemporaryDirectory

from build import BuildBackendException, ProjectBuilder
from build.env import DefaultIsolatedEnv
from twisted.python.filepath import FilePath
from twisted.trial.unittest import TestCase

from build import BuildBackendException, ProjectBuilder
from build.env import DefaultIsolatedEnv
from incremental import Version

TEST_DIR = FilePath(os.path.abspath(os.path.dirname(__file__)))
Expand Down