Skip to content

Commit

Permalink
Relax dependency version constrains
Browse files Browse the repository at this point in the history
  • Loading branch information
Argmaster committed Nov 9, 2024
1 parent 7c8569d commit 83775f6
Show file tree
Hide file tree
Showing 7 changed files with 1,368 additions and 1,030 deletions.
11 changes: 6 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,27 @@ repos:
- id: prettier

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: "v4.4.0"
rev: "v5.0.0"
hooks:
- id: check-byte-order-marker
- id: check-illegal-windows-names
- id: check-case-conflict
- id: check-merge-conflict
args: [--assume-in-merge]
- id: check-case-conflict
- id: trailing-whitespace
- id: end-of-file-fixer
- id: debug-statements
- id: end-of-file-fixer
- id: fix-byte-order-marker
- id: check-added-large-files
args: ["--maxkb=5000"]
- id: check-toml
# - id: check-json
- id: mixed-line-ending
args: ["--fix=lf"]
- id: trailing-whitespace
- id: debug-statements

- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: "v0.6.5"
rev: "v0.7.3"
hooks:
# Run the linter.
- id: ruff
Expand Down
15 changes: 3 additions & 12 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,6 @@
"name": "pygerber",
"depth": 10
},
{
"name": "matplotlib",
"depth": 2
},
{
"name": "pygls",
"depth": 10
Expand All @@ -117,7 +113,6 @@
}
],
"mypy-type-checker.importStrategy": "fromEnvironment",
"black-formatter.importStrategy": "useBundled",
"cSpell.ignoreWords": ["RRGGBB", "RRGGBBAA"],
"peacock.color": "#007fff",
"mypy-type-checker.args": ["--config-file=pyproject.toml"],
Expand All @@ -143,15 +138,11 @@
"titleBar.inactiveBackground": "#007fff99",
"titleBar.inactiveForeground": "#e7e7e799"
},
"python.analysis.addImport.heuristics": true,
"python.analysis.diagnosticMode": "workspace",
"python.analysis.extraCommitChars": true,
"python.analysis.typeCheckingMode": "basic",
"python.analysis.userFileIndexingLimit": -1,
"mypy-type-checker.path": [
"mypy",
"--config-file=pyproject.toml",
"src/pygerber",
"test"
]
"mypy-type-checker.path": ["mypy"],
"mypy-type-checker.cwd": "${workspaceFolder}",
"ruff.configurationPreference": "filesystemFirst"
}
2,304 changes: 1,320 additions & 984 deletions poetry.lock

Large diffs are not rendered by default.

54 changes: 32 additions & 22 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "pygerber"
version = "3.0.0a3"
version = "3.0.0a4"
description = "Parsing, formatting and rendering toolkit for Gerber X3 file format"
authors = ["Krzysztof Wisniewski <[email protected]>"]
license = "MIT"
Expand Down Expand Up @@ -30,6 +30,7 @@ classifiers = [
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Topic :: File Formats",
Expand All @@ -45,45 +46,54 @@ classifiers = [
]

[tool.poetry.dependencies]
python = "^3.8,<3.13"
click = "^8.1.3"
pyparsing = "^3.1.0"
pydantic = "^2.3"
tzlocal = "^5.0.1"
pillow = "^10.0.0"
python = "^3.8"
click = [{ version = ">=8.0.0", python = ">=3.8" }]
pyparsing = [
{ version = ">=3.0.0,<3.2.0", python = ">=3.8,<3.9" }, # Pyparsing dropped support for 3.8 in 3.1.0
{ version = ">=3.0.0", python = ">=3.9" }, # Constraints on version will be implied by Python version
]
pydantic = [
{ version = ">=2.0.0", python = ">=3.8" }, # Pydantic 2.10 still has support for Python 3.8
]
pillow = [
{ version = ">=8.0.0,<11.0.0", python = ">=3.8,<3.9" }, # Pillow dropped support for 3.8 in 8.0
{ version = ">=8.0.0", python = ">=3.9" },
]
numpy = [
{ version = "^1.24.4", markers = "python_version >= '3.8' and python_version <= '3.11'" },
{ version = "^1.26.1", markers = "python_version >= '3.12' and python_version < '3.13'" },
# We do not need bottom constraint as Python version implies >1.17 for 3.8 or even
# later versions for later Python versions.
{ version = "<1.25", python = ">=3.8,<3.9" }, # Numpy dropped support for 3.8 in 1.25
{ version = "<2.1", python = ">=3.9,<3.10" }, # Numpy dropped support for 3.9 in 2.1
{ version = "<3", python = ">=3.10" },
]
pygls = { version = "^1.0.2", optional = true }
lsprotocol = { version = "^2023.0.0a3", optional = true }
drawsvg = { version = "^2.3.0", optional = true }
typing-extensions = "^4.12.2"
pygments = { version = "^2.18.0", optional = true }
shapely = {version = "^2.0.6", optional = true}
pygls = { version = ">=1.0.0,<2.0.0", optional = true }
lsprotocol = { version = ">=2023,<2024", optional = true }
drawsvg = { version = ">=2.0.0,<3.0.0", optional = true }
typing-extensions = ">=4.12,<5.0"
pygments = { version = ">=2.10.0,<3.0.0", optional = true }
shapely = { version = ">=2.0.0,<3.0.0", optional = true }

[tool.poetry.group.dev.dependencies]
mypy = "^1.6.1"
poethepoet = ">=0.20,<0.28"
pytest = ">=7.4,<9.0"
ruff = ">=0.5.0,<0.7.0"
mypy = "^1.13.0"
poethepoet = "^0.29.0"
pytest = "^8.3.3"
ruff = "^0.7.3"
jinja2 = "^3.1.2"
pyyaml = "^6.0"
pre-commit = "^3.3.3"
autoflake = "^2.2.0"
types-tzlocal = "^5.0.1.1"
ipykernel = "^6.25.0"
twine = ">=4.0.2,<6.0.0"
docutils = "0.20.1"
typing-extensions = "^4.11.0"
filelock = "^3.14.0"
dulwich = "^0.22.1"
tzlocal = "^5.0.1"
pytest-xdist = { extras = ["psutil"], version = "^3.3.1" }
pytest-cov = ">=4.1,<6.0"
pytest-lsp = "^0.4.2"
pytest-asyncio = ">=0.23.7,<0.25.0"

pytest-mock = "^3.14.0"

[tool.poetry.group.docs]
optional = true

Expand Down
2 changes: 1 addition & 1 deletion src/pygerber/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

from __future__ import annotations

__version__ = "3.0.0a3"
__version__ = "3.0.0a4"
10 changes: 5 additions & 5 deletions src/pygerber/gerber/ast/state_tracking_visitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,15 +122,15 @@ def __init__(self, **kwargs: Any) -> None:
self.pack_x = self._pack_skip_trailing(self.x_integral, self.x_decimal) # type: ignore[method-assign]
self.pack_y = self._pack_skip_trailing(self.y_integral, self.y_decimal) # type: ignore[method-assign]
else:
msg = f"Unknown zeros mode: {self.zeros}"
msg = f"Unknown zeros mode: {self.zeros}" # type: ignore[unreachable]
raise ValueError(msg)

def unpack_x(self, coordinate: PackedCoordinateStr, /) -> Double: # noqa: ARG002
def unpack_x(self, coordinate: PackedCoordinateStr, /) -> Double:
"""Unpack X coordinate using the current coordinate format."""
msg = "Coordinate format was not properly set."
raise NotImplementedError(msg) # pragma: no cover

def unpack_y(self, coordinate: PackedCoordinateStr, /) -> Double: # noqa: ARG002
def unpack_y(self, coordinate: PackedCoordinateStr, /) -> Double:
"""Unpack X coordinate using the current coordinate format."""
msg = "Coordinate format was not properly set."
raise NotImplementedError(msg) # pragma: no cover
Expand Down Expand Up @@ -185,12 +185,12 @@ def _unpack_preprocess(

return sign, coordinate_str

def pack_x(self, coordinate: Double, /) -> PackedCoordinateStr: # noqa: ARG002
def pack_x(self, coordinate: Double, /) -> PackedCoordinateStr:
"""Unpack X coordinate using the current coordinate format."""
msg = "Coordinate format was not properly set."
raise NotImplementedError(msg) # pragma: no cover

def pack_y(self, coordinate: Double, /) -> PackedCoordinateStr: # noqa: ARG002
def pack_y(self, coordinate: Double, /) -> PackedCoordinateStr:
"""Pack X coordinate using the current coordinate format."""
msg = "Coordinate format was not properly set."
raise NotImplementedError(msg) # pragma: no cover
Expand Down
2 changes: 1 addition & 1 deletion test/gerberx3/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ def _walk_any(self, data: T) -> T:
return cast(T, self.on_bool(data))

if data is None:
return self.on_none(data) # type: ignore[unreachable]
return self.on_none(data) # type: ignore[unreachable, no-any-return, func-returns-value]

raise TypeError(type(data))

Expand Down

0 comments on commit 83775f6

Please sign in to comment.