Skip to content

Commit 80de3bf

Browse files
committed
try new packaging from opus
1 parent f8af823 commit 80de3bf

5 files changed

Lines changed: 46 additions & 53 deletions

File tree

.github/workflows/python_packages.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,10 +173,10 @@ jobs:
173173
- name: Install deps
174174
run: |
175175
pip install --upgrade pip
176-
pip install setuptools twine scikit-build wheel cmake
176+
pip install build twine
177177
178178
- name: Build sdist
179-
run: python setup.py sdist
179+
run: python -m build --sdist
180180

181181
- uses: actions/upload-artifact@v4
182182
with:

geodiff/CMakeLists.txt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# GEODIFF (MIT License)
22
# Copyright (C) 2019 Peter Petrik
33

4-
CMAKE_MINIMUM_REQUIRED(VERSION 3.10)
4+
CMAKE_MINIMUM_REQUIRED(VERSION 3.15)
55
PROJECT(geodiffproject)
66
SET(CMAKE_CXX_VISIBILITY_PRESET hidden)
77
SET(CMAKE_VISIBILITY_INLINES_HIDDEN 1)
@@ -26,7 +26,11 @@ ENDIF()
2626

2727
IF(SKBUILD)
2828
MESSAGE(STATUS "The geodiff is built using scikit-build for pygeodiff Python package")
29-
FIND_PACKAGE(PythonExtensions REQUIRED)
29+
# scikit-build-core provides the project version as SKBUILD_PROJECT_VERSION;
30+
# allow an explicit -DPYGEODIFFVERSION override for standalone invocations.
31+
IF(NOT PYGEODIFFVERSION)
32+
SET(PYGEODIFFVERSION "${SKBUILD_PROJECT_VERSION}")
33+
ENDIF()
3034
SET(GEODIFF_NAME "pygeodiff-${PYGEODIFFVERSION}-python${GEODIFF_NAME_SUFFIX}")
3135
IF (CMAKE_GENERATOR_PLATFORM STREQUAL "Win32")
3236
SET(GEODIFF_NAME "${GEODIFF_NAME}-win32")

pyproject.toml

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,36 @@
11
[build-system]
2-
requires = ["setuptools", "wheel", "scikit-build", "cmake"]
2+
requires = ["scikit-build-core>=0.10"]
3+
build-backend = "scikit_build_core.build"
4+
5+
[project]
6+
name = "pygeodiff"
7+
version = "2.3.0"
8+
description = "Python wrapper around GeoDiff library"
9+
readme = "README.md"
10+
authors = [{ name = "Lutra Consulting Ltd.", email = "info@merginmaps.com" }]
11+
license = { text = "MIT" }
12+
requires-python = ">=3.7"
13+
keywords = ["diff", "gis", "geo", "geopackage", "merge"]
14+
classifiers = [
15+
"Programming Language :: Python :: 3",
16+
"License :: OSI Approved :: MIT License",
17+
]
18+
19+
[project.urls]
20+
Homepage = "https://github.com/MerginMaps/geodiff"
21+
22+
[tool.scikit-build]
23+
# The geodiff C++ library (CMakeLists.txt) lives in the geodiff/ subdirectory.
24+
cmake.source-dir = "geodiff"
25+
# Pure-Python package shipped alongside the compiled library.
26+
wheel.packages = ["pygeodiff"]
27+
# The old setup.py used packages=["pygeodiff"], which did not ship the tests.
28+
wheel.exclude = ["pygeodiff/tests/**"]
29+
# CMakeLists.txt declares 3.15; let scikit-build-core fetch a matching CMake.
30+
cmake.version = ">=3.15"
31+
32+
[tool.scikit-build.cmake.define]
33+
ENABLE_TESTS = "OFF"
34+
ENABLE_COVERAGE = "OFF"
35+
BUILD_TOOLS = "OFF"
36+
PEDANTIC = "OFF"

scripts/update_version.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,6 @@ def replace_in_file(filepath, regex, sub):
2828
print("patching " + about_file)
2929
replace_in_file(about_file, "__version__\s=\s\".*", "__version__ = \"" + ver + "\"")
3030

31-
setup_file = os.path.join(dir_path, os.pardir, "setup.py")
32-
print("patching " + setup_file)
33-
replace_in_file(setup_file, "VERSION\s=\s\".*", "VERSION = \"" + ver + "\"")
31+
pyproject_file = os.path.join(dir_path, os.pardir, "pyproject.toml")
32+
print("patching " + pyproject_file)
33+
replace_in_file(pyproject_file, r'^version = ".*"', 'version = "' + ver + '"')

setup.py

Lines changed: 0 additions & 45 deletions
This file was deleted.

0 commit comments

Comments
 (0)