Skip to content
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 .bumpversion.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tool.bumpversion]
current_version = "0.4.4"
current_version = "0.4.5"
parse = "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)(\\-(?P<release>[a-z]+))?"
serialize = [
"{major}.{minor}.{patch}-{release}",
Expand Down
16 changes: 16 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"name": "pode",
"image": "python:3.14-bookworm",
"features": {
"ghcr.io/devcontainers/features/common-utils:2": {},
"ghcr.io/devcontainers-extra/features/poetry:2": {
"version": "2.3.1"
}
},
"workspaceFolder": "/opt/pode",
"workspaceMount": "source=${localWorkspaceFolder},target=/opt/pode,type=bind,consistency=cached",
"runArgs": ["--runtime=runc"],
"onCreateCommand": ". /opt/pode/.devcontainer/setup_user.sh",
"postCreateCommand": "poetry config virtualenvs.create false && poetry install --with dev --no-root",
"remoteUser": "${localEnv:USER}"
}
17 changes: 17 additions & 0 deletions .devcontainer/setup_user.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash
set -eux

uid=$(stat -c '%u' "$(pwd)")
gid=$(stat -c '%g' "$(pwd)")
current_user=$(whoami)

if [ "$gid" -ne 1000 ]; then
sudo groupadd -g "$gid" hostgroup
if [ "$uid" -ne 1000 ]; then
sudo usermod -u "$uid" -g hostgroup "$current_user"
else
sudo usermod -g hostgroup "$current_user"
fi
elif [ "$uid" -ne 1000 ]; then
sudo usermod -u "$uid" "$current_user"
fi
33 changes: 12 additions & 21 deletions .github/workflows/github-actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,28 +11,19 @@ on:
jobs:
test:
name: 'Test'
runs-on: ${{ matrix.platform.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
python_version: ['3.8', '3.9', '3.10', '3.11', '3.12']
platform: [
{
os: 'macos-latest',
python_architecture: 'x64'
},
{
os: 'ubuntu-latest',
python_architecture: 'x64'
},
{
os: 'windows-latest',
python_architecture: 'x64'
},
{
os: 'windows-latest',
python_version: ['3.10', '3.11', '3.12', '3.13', '3.14']
os: ['macos-latest', 'ubuntu-latest', 'windows-latest']
python_architecture: ['x64', 'x86']
exclude:
- os: 'macos-latest'
python_architecture: 'x86'
},
]
- os: 'ubuntu-latest'
python_architecture: 'x86'
- os: 'macos-latest'
python_version: '3.10'
steps:
- name: 'Checkout'
uses: actions/checkout@v3
Expand All @@ -42,13 +33,13 @@ jobs:
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python_version }}
architecture: ${{ matrix.platform.python_architecture }}
architecture: ${{ matrix.python_architecture }}
- name: 'Install packaging tools'
run: python -m pip install -U pip setuptools
- name: 'Install coverage dependencies'
run: python -m pip install -U coverage
- name: 'Install Poetry'
run: python -m pip install poetry==1.3.1
run: python -m pip install poetry==2.1.4
- name: 'Turn off virtual environment of Poetry'
run: poetry config virtualenvs.create false
- name: 'Install dependencies'
Expand Down
20 changes: 9 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
ARG PYTHON_IMAGE_VERSION
ARG IMAGE_TYPE

FROM python:${PYTHON_IMAGE_VERSION}

FROM python:${PYTHON_IMAGE_VERSION} AS base
ARG POETRY_VERSION
ARG DEV_IMAGE

WORKDIR /opt/pode

Expand All @@ -15,11 +14,10 @@ COPY tests/ tests/
COPY pode/ pode/
COPY pyproject.toml .

RUN if [ "${DEV_IMAGE}" = "true" ]; then \
poetry install; \
elif [ "${DEV_IMAGE}" = "false" ]; then \
poetry install --without dev; \
else \
echo "Invalid value specified for DEV_IMAGE: '${DEV_IMAGE}'"; \
exit 1; \
fi
FROM base AS prod
RUN poetry install

FROM base AS dev
RUN poetry install --with dev

FROM ${IMAGE_TYPE}
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ pode
===========


[![](https://codecov.io/gh/LostFan123/pode/branch/master/graph/badge.svg)](https://codecov.io/gh/LostFan123/pode "Codecov")
[![](https://img.shields.io/github/license/LostFan123/pode.svg)](https://github.com/LostFan123/pode/blob/master/LICENSE "License")
[![](https://github.com/GeorgySk/pode/workflows/CI/badge.svg)](https://github.com/GeorgySk/pode/actions/workflows/ci.yml "Github Actions")
[![](https://codecov.io/gh/GeorgySk/gon/branch/master/graph/badge.svg)](https://codecov.io/gh/GeorgySk/pode "Codecov")
[![](https://readthedocs.org/projects/pode/badge/?version=latest)](https://pode.readthedocs.io/en/latest "Documentation")
[![](https://img.shields.io/github/license/GeorgySk/pode.svg)](https://github.com/GeorgySk/pode/blob/master/LICENSE "License")
[![](https://badge.fury.io/py/pode.svg)](https://badge.fury.io/py/pode "PyPI")

Summary
Expand Down
4 changes: 1 addition & 3 deletions compose.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: '3'

services:
pode:
build:
Expand All @@ -8,7 +6,7 @@ services:
- PYTHON_IMAGE_VERSION=${PYTHON_IMAGE_VERSION}
- POETRY_VERSION=${POETRY_VERSION}
- DEV_IMAGE=${DEV_IMAGE}
image: georgysk/pode:0.4.4
image: georgysk/pode:0.4.5
volumes:
- .:/opt/pode
stdin_open: true
Expand Down
2 changes: 1 addition & 1 deletion pode/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""Polygon decomposition"""
__version__ = '0.4.4'
__version__ = '0.4.5'

from .pode import (divide,
Contour,
Expand Down
32 changes: 18 additions & 14 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,28 +1,32 @@
[tool.poetry]
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

[project]
name = "pode"
version = "0.4.4"
version = "0.4.5"
description = "Implementation of an algorithm for a polygon decomposition by Hert, S. and Lumelsky, V., 1998"
authors = ["GeorgySk <skorobogatovgeorgy+github@gmail.com>"]
authors = [
{ name = "Georgy Skorobogatov", email = "skorobogatovgeorgy+github@gmail.com" },
]
readme = "README.md"

[tool.poetry.dependencies]
python = "^3.8"
gon = "^5.0.0"
ground = "^8.1.0"
networkx = "^2.8.8"
sect = "^6.1.0"
license-files = ["LICENSE"]
requires-python = "^3.10"
dependencies = [
"gon (>=5.0.0,<6.0.0)",
"ground (>=8.1.0,<9.0.0)",
"networkx (>=2.8.8,<3.0.0)",
"sect (>=6.1.0,<7.0.0)"
]

[tool.poetry.group.dev.dependencies]
bump-my-version = "^0.18.3"
pytest = "^7.2.0"
pytest-cov = "^4.0.0"
# fixed for easier way to reproduce across various machines
hypothesis = "6.99.1"
hypothesis-geometry = "^7.3.0"

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

[tool.coverage.run]
source = ["pode"]

Expand Down