
Research
SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains
An emerging npm supply chain attack that infects repos, steals CI secrets, and targets developer AI toolchains for further compromise.
gon
Advanced tools
gon is a pure Python library that provides support
for planar geometry objects built from discrete points,
finite number of straight line segments (e.g. polylines)
and areas bound by closed polylines (e.g. polygons).
Main features are
int),
each operation corresponds to its mathematical definition
and property-based tested.O(n * log n),
for memory complexity is O(n).In what follows python is an alias for python3.7 or pypy3.7
or any later version (python3.7, pypy3.8 and so on).
Install the latest pip & setuptools packages versions
python -m pip install --upgrade pip setuptools
Download and install the latest stable version from PyPI repository
python -m pip install --upgrade gon
Download the latest version from GitHub repository
git clone https://github.com/lycantropos/gon.git
cd gon
Install dependencies
python -m pip install -r requirements.txt
Install
python setup.py install
>>> from gon.base import EMPTY, Angle, Contour, Point, Polygon
>>> square = Polygon(Contour([Point(0, 0), Point(4, 0), Point(4, 4),
... Point(0, 4)]))
>>> square == square
True
>>> square >= square
True
>>> square <= square
True
>>> square < square
False
>>> square > square
False
>>> square & square == square
True
>>> square | square == square
True
>>> square - square is EMPTY
True
>>> square ^ square is EMPTY
True
>>> Point(0, 0) in square
True
>>> square.index()
>>> Point(0, 0) in square
True
>>> len(square.border.vertices) == 4
True
>>> len(square.holes) == 0
True
>>> square.is_convex
True
>>> square.convex_hull == square
True
>>> square.area == 16
True
>>> square.perimeter == 16
True
>>> square.centroid == Point(2, 2)
True
>>> square.distance_to(Point(2, 2)) == 0
True
>>> square.distance_to(Point(7, 8)) == 5
True
>>> (square.rotate(Angle(0, 1), Point(4, 4))
... == Polygon(Contour([Point(8, 0), Point(8, 4), Point(4, 4), Point(4, 0)])))
True
>>> (square.scale(1, 2)
... == Polygon(Contour([Point(0, 0), Point(4, 0), Point(4, 8), Point(0, 8)])))
True
>>> (square.translate(1, 2)
... == Polygon(Contour([Point(1, 2), Point(5, 2), Point(5, 6), Point(1, 6)])))
True
>>> (square.triangulate().triangles()
... == [Contour([Point(0, 4), Point(4, 0), Point(4, 4)]),
... Contour([Point(0, 0), Point(4, 0), Point(0, 4)])])
True
Install bump2version.
Choose which version number category to bump following semver specification.
Test bumping version
bump2version --dry-run --verbose $CATEGORY
where $CATEGORY is the target version number category name, possible
values are patch/minor/major.
Bump version
bump2version --verbose $CATEGORY
This will set version to major.minor.patch-alpha.
Test bumping version
bump2version --dry-run --verbose release
Bump version
bump2version --verbose release
This will set version to major.minor.patch.
Install dependencies
python -m pip install -r requirements-tests.txt
Plain
pytest
Inside Docker container:
CPython
docker-compose --file docker-compose.cpython.yml up
PyPy
docker-compose --file docker-compose.pypy.yml up
Bash script:
with CPython
./run-tests.sh
or
./run-tests.sh cpython
with PyPy
./run-tests.sh pypy
PowerShell script:
CPython
.\run-tests.ps1
or
.\run-tests.ps1 cpython
PyPy
.\run-tests.ps1 pypy
FAQs
Processing of planar geometries.
We found that gon demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
An emerging npm supply chain attack that infects repos, steals CI secrets, and targets developer AI toolchains for further compromise.

Company News
Socket is proud to join the OpenJS Foundation as a Silver Member, deepening our commitment to the long-term health and security of the JavaScript ecosystem.

Security News
npm now links to Socket's security analysis on every package page. Here's what you'll find when you click through.