Skip to content

Commit

Permalink
Move to poetry
Browse files Browse the repository at this point in the history
  • Loading branch information
TheBB committed Apr 12, 2023
1 parent 3c6cc82 commit e224e9c
Show file tree
Hide file tree
Showing 6 changed files with 312 additions and 7 deletions.
10 changes: 3 additions & 7 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,11 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip wheel
pip install -r requirements.txt
pip install -r requirements.dev.txt
- name: Install package
run: |
pip install -vvv .
python -m pip install --upgrade pip poetry
make install
- name: Test with pytest
run: |
pytest --benchmark-skip
make pytest
build_wheels:
name: Build wheels
Expand Down
26 changes: 26 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
.PHONY: install mypy lint pytest test fmt fmtcheck

install:
poetry install --with=dev

mypy:
poetry run mypy splipy

lint:
poetry run ruff splipy

pytest:
poetry run pytest --benchmark-skip

bench:
poetry run pytest --benchmark-only

fmt:
poetry run black splipy
poetry run isort splipy

fmtcheck:
poetry run black splipy --check
poetry run isort splipy --check

test: mypy pytest lint fmtcheck
19 changes: 19 additions & 0 deletions build_ext.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import os
import sys

from setuptools import Extension
from Cython.Build import cythonize
import numpy as np

extensions = cythonize(
Extension(
"splipy.basis_eval",
["splipy/basis_eval.pyx"],
include_dirs=[np.get_include()],
)
)

def build(setup_kwargs):
setup_kwargs.update({
"ext_modules": extensions,
})
198 changes: 198 additions & 0 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

66 changes: 66 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
[tool.poetry]
name = "splipy"
version = "1.7.4"
description = "Spline modelling library for Python"
authors = [
"Kjetil Andre Johannessen <kjetijo@gmail.com>",
"Eivind Fonn <evfonn@gmail.com>",
]
maintainers = [
"Kjetil Andre Johannessen <kjetijo@gmail.com>",
"Eivind Fonn <evfonn@gmail.com>",
]
license = "GLP-3.0-only"
readme = "README.rst"
homepage = "https://github.com/SINTEF/Splipy"
repository = "https://github.com/SINTEF/Splipy"
documentation = "https://sintef.github.io/Splipy/"
keywords = [
"Bspline",
"Splines",
"NURBS",
"Curve",
"Surface",
"Volume",
"Interpolation",
"Approximation",
"Fit",
"Integration",
"Differentiation",
]
classifiers = [
"Development Status :: 5 - Beta",
"Topic :: Multimedia :: Graphics :: 3D Modeling",
"Topic :: Scientific/Engineering :: Mathematics",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
"Programming Language :: Python :: 3",
]
include = [
"splipy/templates/*.bpt",
{ path = "splipy/*.so", format="wheel" },
]

[tool.poetry.build]
script = "build_ext.py"
generate-setup-file = true

[tool.poetry.dependencies]
python = ">=3.8,<3.12"
cython = "^0.29.34"
numpy = "^1.24.2"
scipy = "^1.10.1"

[tool.poetry.extras]
FiniteElement = ["nutils"]
Images = ["opencv-python"]
Rhino = ["rhino3dm"]

[tool.poetry.group.dev.dependencies]
mypy = "^1.2.0"
pytest = "^7.3.0"
pytest-benchmark = "^4.0.0"

[build-system]
requires = ["poetry-core", "cython", "numpy", "wheel", "setuptools"]
build-backend = "poetry.core.masonry.api"
File renamed without changes.

0 comments on commit e224e9c

Please sign in to comment.