Skip to content
Draft
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
11 changes: 0 additions & 11 deletions MANIFEST.in

This file was deleted.

1 change: 1 addition & 0 deletions VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.8.10
64 changes: 64 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
project('pplpy',
['c', 'cpp', 'cython'],
version: files('VERSION'),
license: 'GPL v3',
default_options: ['cpp_std=c++17', 'python.install_env=auto'],
meson_version: '>=1.2',
)

# Python module
# https://mesonbuild.com/Python-module.html
py = import('python').find_installation(pure: false)

# Compilers
cc = meson.get_compiler('c')
cpp = meson.get_compiler('cpp')
cython = meson.get_compiler('cython')
# Workaround as described in https://cython.readthedocs.io/en/latest/src/userguide/special_methods.html#arithmetic-methods
add_project_arguments('-X c_api_binop_methods=True', language: 'cython')

# Dependencies
inc_cysignals = run_command(
py,
[
'-c',
'''
from os.path import relpath
import cysignals
path = cysignals.__file__.replace('__init__.py', '')
try:
print(relpath(path))
except Exception:
print(path)
'''.strip(),
],
check: true,
).stdout().strip()
cysignals = declare_dependency(include_directories: inc_cysignals)

# Find gmpy2 include directory
inc_gmpy2 = run_command(
py,
[
'-c',
'''
from os.path import relpath
import gmpy2
path = gmpy2.__file__.replace('__init__.py', '')
try:
print(relpath(path))
except Exception:
print(path)
'''.strip(),
],
check: true,
).stdout().strip()
gmpy2_dep = declare_dependency(include_directories: inc_gmpy2)

# Find PPL library
ppl = cpp.find_library('ppl', required: true)

# Find GMP library
gmp = cc.find_library('gmp', required: true)

subdir('ppl')
43 changes: 43 additions & 0 deletions ppl/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
py.install_sources(
'__init__.py',
'bit_arrays.pxd',
'congruence.pxd',
'constraint.pxd',
'generator.pxd',
'linear_algebra.pxd',
'mip_problem.pxd',
'polyhedron.pxd',
'ppl_decl.pxd',
'ppl_shim.hh',
subdir: 'ppl'
)

# Shared C++ source file
ppl_shim_lib = static_library(
'ppl_shim',
'ppl_shim.cc',
dependencies: [ppl, gmp],
cpp_args: [],
)

extension_data = {
'linear_algebra': files('linear_algebra.pyx'),
'mip_problem': files('mip_problem.pyx'),
'polyhedron': files('polyhedron.pyx'),
'generator': files('generator.pyx'),
'constraint': files('constraint.pyx'),
'congruence': files('congruence.pyx'),
'bit_arrays': files('bit_arrays.pyx'),
}

foreach name, pyx : extension_data
py.extension_module(
name,
sources: pyx,
subdir: 'ppl',
install: true,
dependencies: [cysignals, gmpy2_dep, ppl, gmp],
link_with: ppl_shim_lib,
override_options : ['cython_language=cpp'],
)
endforeach
22 changes: 5 additions & 17 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
[build-system]
requires = [
"setuptools>=61.2",
"Cython",
"cysignals",
"gmpy2>=2.1.0b1",
"meson-python>=0.18.0",
"Cython>=3.0",
"cysignals>=1.11.3",
]
build-backend = "setuptools.build_meta"
build-backend = "mesonpy"

[project]
name = "pplpy"
Expand Down Expand Up @@ -36,7 +35,7 @@ keywords = [
"linear-programming",
]
dependencies = [
"cysignals",
"cysignals>=1.11.3",
"gmpy2>=2.1.0b1",
]
dynamic = ["version"]
Expand All @@ -49,14 +48,3 @@ doc = [
[project.urls]
Homepage = "https://github.com/sagemath/pplpy"
Download = "https://pypi.org/project/pplpy/#files"

[tool.setuptools]
packages = ["ppl"]
platforms = ["any"]
include-package-data = false

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

[tool.setuptools.package-data]
ppl = ["*.pxd", "*.h", "*.hh"]
92 changes: 0 additions & 92 deletions setup.py

This file was deleted.

Loading