Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

This patch adds builds for Windows (amd64) #43

Merged
merged 34 commits into from
Oct 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
25743c3
This patch adds builds for Windows (amd64)
ybubnov Oct 21, 2024
ee25545
Enable back workflows, but make them manually launchable.
ybubnov Oct 21, 2024
b95fad2
Install torch on win64 system platform.
ybubnov Oct 21, 2024
a1fd998
Use a well-known license from classifiers.
ybubnov Oct 21, 2024
6dfa422
Change sys platform to win32.
ybubnov Oct 21, 2024
d05b243
Limit windows builds to 3.10
ybubnov Oct 21, 2024
8b1da0f
Explicitly skip 3.9 for Win.
ybubnov Oct 21, 2024
d34b638
Try to build only for 3.10.
ybubnov Oct 21, 2024
2ee638d
Attempt to install pytorch manually.
ybubnov Oct 21, 2024
5764198
Install torch.
ybubnov Oct 21, 2024
bd7bd82
Specify platform marker.
ybubnov Oct 21, 2024
92c5315
Change index URL for windows.
ybubnov Oct 22, 2024
b63766e
Launch cibuildwheel.
ybubnov Oct 22, 2024
c1de496
Change the PyPI.
ybubnov Oct 22, 2024
db80b15
Specify URLs separately for each os.
ybubnov Oct 22, 2024
b2196a6
Build on CPython 3.10
ybubnov Oct 22, 2024
4b9b6e2
Do not build on windows 32-bit.
ybubnov Oct 22, 2024
3394b5d
Explicitly skip win32.
ybubnov Oct 22, 2024
6a85388
Remove unnecessary markers.
ybubnov Oct 22, 2024
5c19e8d
Install from pytorch.org.
ybubnov Oct 22, 2024
b13a08c
Fix typo.
ybubnov Oct 22, 2024
a6a3283
Build correct architecture.
ybubnov Oct 22, 2024
0a1b289
Install 2.5.0 for windows builds.
ybubnov Oct 22, 2024
b78a0fb
Expect win sys platform.
ybubnov Oct 22, 2024
d7d10f4
Remove marker.
ybubnov Oct 22, 2024
c6223f8
Specify marker again.
ybubnov Oct 22, 2024
a29d3b5
Produce an artifact.
ybubnov Oct 22, 2024
d0ea492
Attempt to build on 3.9
ybubnov Oct 22, 2024
f6959c4
Update package dependencies, build for all pythons.
ybubnov Oct 23, 2024
0bd0dea
Exclude cpp files.
ybubnov Oct 23, 2024
a930b0f
Enable builds on MacOS.
ybubnov Oct 23, 2024
01ed5cf
Change the order of imports.
ybubnov Oct 23, 2024
dc42adc
Build packages for ubuntu as well, bump version.
ybubnov Oct 23, 2024
312d396
Restore publication to PyPI.
ybubnov Oct 23, 2024
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
4 changes: 2 additions & 2 deletions .github/workflows/python_build_wheel.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-14]
os: [macos-14, windows-latest, ubuntu-latest]

steps:
- uses: actions/checkout@v4
Expand All @@ -24,7 +24,7 @@ jobs:
platforms: all

- name: Build wheels
uses: pypa/cibuildwheel@v2.17.0
uses: pypa/cibuildwheel@v2.20

- uses: actions/upload-artifact@v4
with:
Expand Down
1 change: 0 additions & 1 deletion include/torch_delaunay/triangle.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ circumcircle2d_kernel(
const at::TensorAccessor<scalar_t, 1> p2
)
{
const auto ax = p0[0], ay = p0[1];
const auto bx = p1[0] - p0[0], by = p1[1] - p0[1];
const auto cx = p2[0] - p0[0], cy = p2[1] - p0[1];

Expand Down
22 changes: 16 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
[project]
name = "torch-delaunay"
dynamic = ["version"]
license = {file = "LICENSE"}

description = "The Delaunay triangulation for PyTorch"
authors = [
Expand Down Expand Up @@ -31,7 +30,10 @@ classifiers = [
"Operating System :: MacOS"
]

dependencies = ["shapely>=2.0.0", "torch >= 2.3.0, < 2.4.0"]
dependencies = [
"torch >= 2.3.0, < 2.6.0; sys_platform == 'darwin' or sys_platform == 'linux'",
"torch >= 2.5.0, < 2.6.0; sys_platform == 'win32'",
]


[project.urls]
Expand All @@ -49,13 +51,18 @@ test = [
]


[tool.setuptools]
include-package-data = false

[tool.setuptools.dynamic]
version = {attr = "torch_delaunay.__version__"}


[tool.setuptools.packages.find]
include = ["torch_delaunay*"]

[tool.setuptools.package-data]
torch_delaunay = ["*.cc"]


[build-system]
build-backend = "setuptools.build_meta"
Expand All @@ -66,8 +73,10 @@ requires = [
"numpy >= 1.4.0, < 2.0.0",
"pybind11 >= 2.0.0, < 3.0.0",
"setuptools ~= 70.0.0",
"torch >= 2.3.0, < 2.4.0; sys_platform == 'linux'",
"torch >= 2.3.0, < 2.4.0; sys_platform == 'darwin' or sys_platform == 'win'",
"torch >= 2.3.0, < 2.4.0; sys_platform == 'darwin' or sys_platform == 'linux'",
# Windows package build requires a fix with library import path, which is available
# only after 2.5.0.
"torch >= 2.5.0, < 2.6.0; sys_platform == 'win32'",
"typing-extensions >= 4.8.0",
"wheel >= 0.43.0"
]
Expand Down Expand Up @@ -101,9 +110,10 @@ repair-wheel-command = ""
PIP_INDEX_URL = "https://download.pytorch.org/whl/cpu"
PIP_EXTRA_INDEX_URL = "https://pypi.python.org/simple"

[tool.cibuildwheel.windows]
archs = ["AMD64"]
[tool.cibuildwheel.macos]
archs = ["arm64"]

[tool.cibuildwheel.linux]
archs = ["aarch64", "x86_64"]
manylinux-x86_64-image = "manylinux2014"
Expand Down
9 changes: 5 additions & 4 deletions src/sweephull.cc
Original file line number Diff line number Diff line change
Expand Up @@ -258,12 +258,13 @@ struct shull {
inline void
push_halfedge(int64_t a, int64_t b)
{
TORCH_CHECK(a <= halfedges.size(), "shull2d: encountered wrong half-edge: ", a, " -> ", b);
int64_t halfedges_size = static_cast<int64_t>(halfedges.size());
TORCH_CHECK(a <= halfedges_size, "shull2d: encountered wrong half-edge: ", a, " -> ", b);

if (a < halfedges.size()) {
if (a < halfedges_size) {
halfedges[a] = b;
}
if (a == halfedges.size()) {
if (a == halfedges_size) {
halfedges.push_back(b);
}
}
Expand Down Expand Up @@ -399,7 +400,7 @@ shull2d_seed_kernel(const torch::Tensor& points, std::optional<scalar_t> eps)

// For points p0 and p1, radii of circumscribed circle will be set to `nan`, therefore
// at 0 index will be a point with the minimum radius.
std::size_t i = 0;
int64_t i = 0;
for (; i < values.size(0); i++) {
index2 = indices[i];
p2 = points.index({index2}).view({-1, 2});
Expand Down
2 changes: 1 addition & 1 deletion torch_delaunay/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
from typing import Final

__version__: Final[str] = "1.0.0rc3"
__version__: Final[str] = "1.0.0"
3 changes: 2 additions & 1 deletion torch_delaunay/functional.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@

from typing import Optional

import torch_delaunay._C as _C
from torch import Tensor

import torch_delaunay._C as _C


def shull2d(points: Tensor, eps: Optional[float] = None) -> Tensor:
"""Computes Delaunay tessellation for 2-dimensional coordinates.
Expand Down