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
2 changes: 2 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[flake8]
max-line-length = 120
6 changes: 4 additions & 2 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ['3.8', '3.11']
python-version: ['3.9', '3.13']

steps:
- name: Checkout
Expand All @@ -25,12 +25,14 @@ jobs:
- name: Upgrade pip
run: python -m pip install --upgrade pip
- name: Install tools
run: pip install flake8 black
run: pip install flake8 black mypy
- name: Install package
run: pip install -e ".[test]"
- name: Run black
run: black --quiet --check .
- name: Run flake8
run: flake8 .
- name: Run mypy
run: mypy
- name: Run tests
run: pytest
19 changes: 19 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 23.9.1
hooks:
- id: black
- repo: https://github.com/pycqa/flake8
rev: 6.1.0
hooks:
- id: flake8
- repo: https://github.com/regebro/pyroma
rev: '4.2'
hooks:
- id: pyroma
21 changes: 20 additions & 1 deletion CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,31 @@ Changelog
=========


6.4 (unreleased)
7.1 (unreleased)
----------------

- Nothing changed yet.


7.0 (2025-07-06)
----------------

- Make the Move class a Path Segment, for type annotation consistency.
If anyone is using isinstance() expecting that only draw commands are
PathSegments, this will break that. Instead the test has to be explicitly
that it is NOT a Move segment.

- Paths can now be sliced to return Paths.


6.4b1 (2025-02-27)
------------------

- Improved test reliability [bdrung]

- Added type annotations. [udifuchs]


6.3 (2023-04-29)
----------------

Expand Down
3 changes: 3 additions & 0 deletions CONTRIBUTORS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,6 @@ the relative setting when parsing.

Taewoong Jang [twjang] implemented boundingbox functions.

Benjamin Drung [bdrung] added a font to make tests non-flakey.

Udi Fuchs [udifuchs] added type annotations.
6 changes: 5 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
include *.rst
include *.txt
include src/svg/path/py.typed

exclude Makefile
exclude Makefile .flake8
recursive-exclude tests *


# added by check-manifest
include *.yaml
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ all: devenv check test

# The fullrelease script is a part of zest.releaser, which is the last
# package installed, so if it exists, the devenv is installed.
devenv: $(bin_dir)fullrelease setup.cfg
devenv: $(bin_dir)fullrelease

$(bin_dir):
virtualenv ve --python python3.9
Expand All @@ -23,6 +23,7 @@ $(bin_dir)fullrelease: $(bin_dir)
check: devenv
$(bin_dir)black src tests
$(bin_dir)flake8 src tests
$(bin_dir)mypy
$(bin_dir)pyroma -d .
$(bin_dir)check-manifest

Expand Down
66 changes: 66 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
[build-system]
requires = ["setuptools>=61.2"]
build-backend = "setuptools.build_meta"

[project]
name = "svg.path"
version = "7.1.dev0"
description = "SVG path objects and parser"
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: Implementation :: PyPy",
"Topic :: Multimedia :: Graphics",
]
keywords = ["svg", "path", "maths"]
authors = [{name = "Lennart Regebro", email = "regebro@gmail.com"}]
license = {text = "MIT"}
urls = {Homepage = "https://github.com/regebro/svg.path"}
dynamic = ["readme"]
requires-python = ">=3.8"

[project.optional-dependencies]
test = [
"pytest",
"pytest-cov",
"Pillow",
"black",
"flake8",
"pyroma",
"check-manifest",
"mypy",
"zest.releaser[recommended]",
]

[tool.setuptools]
zip-safe = true
include-package-data = true
package-dir = {"" = "src"}

[tool.setuptools.packages.find]
where = ["src"]
namespaces = false

[tool.setuptools.dynamic]
readme = {file = ["README.rst", "CONTRIBUTORS.txt", "CHANGES.txt"]}

[tool.distutils.bdist_wheel]
universal = 1

[tool.pytest.ini_options]
testpaths = ["tests"]

[tool.mypy]
files = ["src", "tests"]

strict = true
56 changes: 0 additions & 56 deletions setup.cfg

This file was deleted.

3 changes: 0 additions & 3 deletions setup.py

This file was deleted.

22 changes: 18 additions & 4 deletions src/svg/path/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
from .path import Path, Move, Line, Arc, Close # noqa: 401
from .path import CubicBezier, QuadraticBezier # noqa: 401
from .path import PathSegment, Linear, NonLinear # noqa: 401
from .parser import parse_path # noqa: 401
from .path import Path, Move, Line, Arc, Close
from .path import CubicBezier, QuadraticBezier
from .path import PathSegment, Linear, NonLinear
from .parser import parse_path

__all__ = (
"Path",
"Move",
"Line",
"Arc",
"Close",
"CubicBezier",
"QuadraticBezier",
"PathSegment",
"Linear",
"NonLinear",
"parse_path",
)
Loading
Loading