Skip to content

Commit

Permalink
Merge pull request #16 from WISDEM/mesonpy
Browse files Browse the repository at this point in the history
Mesonpy based install
  • Loading branch information
gbarter committed Jan 8, 2024
2 parents 4a2f55c + c5fbae8 commit e8f7897
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 122 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/CI_pyHAMS.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
run: |
#vcpkg install openblas
#pacman -S mingw-w64-x86_64-openblas64
'${{ steps.cp.outputs.python-path }}' -m pip install pylib-openblas
#'${{ steps.cp.outputs.python-path }}' -m pip install pylib-openblas
- name: Mac openblas
if: contains( matrix.os, 'mac')
Expand All @@ -59,7 +59,9 @@ jobs:
env:
MESON_ARGS: -Dpython_target=${{ steps.cp.outputs.python-path }}
run: |
'${{ steps.cp.outputs.python-path }}' -m pip install -v -e .
'${{ steps.cp.outputs.python-path }}' -m pip install --upgrade pip
'${{ steps.cp.outputs.python-path }}' -m pip install meson-python meson numpy ninja wheel
'${{ steps.cp.outputs.python-path }}' -m pip install --no-build-isolation -e . -v
- name: Test run
run: |
Expand Down Expand Up @@ -128,7 +130,7 @@ jobs:
env:
MESON_ARGS: ""
run: |
python setup.py develop
python -m pip install .
- name: Test run
run: |
Expand Down
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# pyHAMS

This is a python wrapper for [HAMS](https://github.com/YingyiLiu/HAMS)

Install via:

```
pip install .
```

Note that this package uses `mesonpy` for an installation backend, so there is no `setup.py` file.
2 changes: 1 addition & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ project(
'c',
# unnecessary metadata commented out until Meson supports PEP517 and installation with pip
license: 'Apache',
meson_version: '>= 0.60',
#meson_version: '>= 0.60',
default_options: [
'buildtype=debugoptimized',
'c_std=c11',
Expand Down
10 changes: 10 additions & 0 deletions pyhams/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,13 @@ py3.extension_module('_hams',
install : true)


python_sources = [
'__init__.py',
'pyhams.py',
]

py3.install_sources(
python_sources,
pure: false,
subdir: 'pyhams'
)
46 changes: 26 additions & 20 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[build-system]
requires = ["setuptools", "meson>=1.1", "numpy", "ninja", "wheel"]
build-backend = "setuptools.build_meta"
build-backend = 'mesonpy'
requires = ["meson-python", "meson>=1.1", "numpy", "ninja", "wheel"]

[project]
name = "pyHAMS"
version = "1.2.0"
version = "1.2.3"
description = "Python module wrapping around HAMS"
readme = "README.md"
requires-python = ">=3.9"
Expand Down Expand Up @@ -38,10 +38,15 @@ classifiers = [ # Optional
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Fortran",
"Operating System :: Microsoft :: Windows",
"Operating System :: POSIX :: Linux",
"Operating System :: POSIX",
"Operating System :: Unix",
"Operating System :: MacOS",
]

dependencies = [
"numpy",
"numpy","meson","ninja",
]

# List additional groups of dependencies here (e.g. development
Expand All @@ -53,7 +58,6 @@ dependencies = [
# Similar to `dependencies` above, these must be valid existing
# projects.
[project.optional-dependencies] # Optional
dev = ["meson", "ninja"]
test = ["pytest"]

# List URLs that are relevant to your project
Expand All @@ -67,31 +71,33 @@ test = ["pytest"]
# maintainers, and where to support the project financially. The key is
# what's used to render the link text on PyPI.
[project.urls] # Optional
"Homepage" = "https://github.com/WISDEM/pyHAMS"
"Project" = "https://github.com/YingyiLiu/HAMS"
homepage = "https://github.com/WISDEM/pyHAMS"
documentation = "https://github.com/YingyiLiu/HAMS"
source = "https://github.com/WISDEM/pyHAMS"
download = "https://github.com/WISDEM/pyHAMS/releases"
tracker = "https://github.com/WISDEM/pyHAMS/issues"

[tool.meson-python.args]
install = ['--tags=runtime,python-runtime,bin']

# This is configuration specific to the `setuptools` build backend.
# If you are using a different build backend, you will need to change this.
[tool.setuptools]
zip-safe = false
include-package-data = true

#[tool.setuptools.packages]
#find = {}
#[tool.setuptools]
#zip-safe = false
#include-package-data = true

[tool.setuptools.packages.find]
#where = ["wisdem"]
exclude = ["Cylinder", "test"]
namespaces = true
#[tool.setuptools.packages.find]
#exclude = ["Cylinder", "test"]
#namespaces = true

[tool.setuptools.package-data]
#[tool.setuptools.package-data]
# If there are data files included in your packages that need to be
# installed, specify them here.
"*" = ["*.yaml", "*.xlsx", "*.txt", "*.so", "*.lib", "*.pyd", "*.pdb", "*.dylib", "*.dll", "*.exe"]
#"*" = ["*.yaml", "*.xlsx", "*.txt", "*.so", "*.lib", "*.pyd", "*.pdb", "*.dylib", "*.dll", "*.exe"]

[tool.black]
line-length = 120
target-version = ['py39']
target-version = ['py311']
include = '\.pyi?$'
exclude = '''
/(
Expand Down
98 changes: 0 additions & 98 deletions setup.py

This file was deleted.

0 comments on commit e8f7897

Please sign in to comment.