Skip to content

Commit

Permalink
Merge pull request #6 from WFP-VAM/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
valpesendorfer authored Aug 30, 2023
2 parents 0196355 + ef05cc4 commit afe01f0
Show file tree
Hide file tree
Showing 9 changed files with 82 additions and 64 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@ on:

jobs:
build_and_test:
runs-on: ubuntu-18.04
runs-on: ubuntu-22.04
strategy:
matrix:
python-version: [3.6, 3.7, 3.8, 3.9]
python-version: [3.8, 3.9, '3.10', 3.11]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: install dependencies
run: pip install cython numpy
run: pip install cython numpy wheel
- name: build
run: pip install $GITHUB_WORKSPACE
- name: test
Expand Down
22 changes: 13 additions & 9 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@ on:

jobs:
build_wheels:
name: Build wheels
runs-on: ubuntu-latest

name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-22.04, windows-2022]

steps:
- uses: actions/checkout@v2

- uses: actions/setup-python@v2

- name: Install cibuildwheel
Expand All @@ -24,7 +26,7 @@ jobs:
CIBW_BUILD: "{cp,pp}3*-*"
CIBW_SKIP: "cp35-* *-manylinux_i686"

- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl

Expand All @@ -45,7 +47,7 @@ jobs:
- name: Build sdist
run: python setup.py sdist

- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
path: dist/*.tar.gz

Expand All @@ -54,12 +56,14 @@ jobs:
runs-on: ubuntu-latest
if: github.event_name == 'release' && github.event.action == 'published'
steps:
- uses: actions/download-artifact@v2
- uses: actions/download-artifact@v3
with:
name: artifact
path: dist

- uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository-url: https://test.pypi.org/legacy/
#user: __token__
#password: ${{ secrets.PYPI_API_TOKEN }}
22 changes: 0 additions & 22 deletions _version/__init__.py

This file was deleted.

3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["setuptools>=51.0.0", "wheel", "numpy>=1.15.1", "cython"]
build-backend = "setuptools.build_meta"
34 changes: 34 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,3 +1,37 @@
[metadata]
name = vam.whittaker
description = VAM whittaker core
version = attr: vam.whittaker._version.__version__
author = WFP-VAM
author_email =
maintainer = WFP-VAM
maintainer_email =
long_description_content_type = text/rst
long_description = file: README.rst
platforms = any
license = MIT License
url = http://github.com/WFP-VAM/vam.whittaker/
project_urls =
Bug Reporting = http://github.com/WFP-VAM/vam.whittaker/issues

classifiers =
License :: OSI Approved :: MIT License
Intended Audience :: Developers
Development Status :: 3 - Beta
Operating System :: OS Independent
Programming Language :: Python :: 3
Natural Language :: English
Topic :: Software Development :: Libraries :: Python Modules
Topic :: Scientific/Engineering :: GIS

[options]
python_requires = >=3,<4


[options.packages.find]
include =
vam*

[aliases]
test=pytest

Expand Down
50 changes: 22 additions & 28 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
#!/usr/bin/env python
# pylint: disable=invalid-name, line-too-long
"""setup.py for VAM whittaker core"""

from setuptools import setup, Extension

import numpy
import _version
USE_CYTHON = 'auto'

USE_CYTHON = True # "auto"

if USE_CYTHON:
try:
from Cython.Distutils import build_ext
if USE_CYTHON == 'auto':

if USE_CYTHON == "auto":
USE_CYTHON = True
except ImportError:
if USE_CYTHON == 'auto':
if USE_CYTHON == "auto":
USE_CYTHON = False
else:
raise
Expand All @@ -24,34 +24,28 @@

if USE_CYTHON:
ext_modules += [
Extension("vam.whittaker",
["src/_whittaker.pyx"], extra_compile_args=["-O3", "-ffast-math"])]
cmdclass.update({'build_ext': build_ext})
Extension(
"vam.whittaker._whit",
["vam/whittaker/_whittaker.pyx"],
extra_compile_args=["-O3", "-ffast-math"],
)
]
cmdclass.update({"build_ext": build_ext})
else:
ext_modules += [
Extension("vam.whittaker",
["src/_whittaker.c"], extra_compile_args=["-O3", "-ffast-math"])]
Extension(
"vam.whittaker._whit",
["vam/whittaker/_whittaker.c"],
extra_compile_args=["-O3", "-ffast-math"],
)
]

setup(
name='vam.whittaker',
description='VAM whittaker core',
version=_version.__version__,
author='Valentin Pesendorfer',
author_email='[email protected]',
url='http://github.com/WFP-VAM/vam.whittaker',
long_description='''State-of-the art whittaker smoother, implemented as fast C-extension through Cython and including a V-curve optimization of the smoothing parameter.\n\nFor more information, please visit: http://github.com/WFP-VAM/vam.whittaker''',
include_dirs=[numpy.get_include()],
cmdclass=cmdclass,
ext_modules=ext_modules,
classifiers=[
'Development Status :: 4 - Beta',
'Programming Language :: Python :: 3',
],
setup_requires=['pytest-runner'],
tests_require=['pytest'],
install_requires=[
'numpy>=1.15.1',
'mock;python_version<"3.0"'
],
python_requires='>=3, <4',
setup_requires=["pytest-runner"],
tests_require=["pytest"],
install_requires=["numpy>=1.15.1", 'mock;python_version<"3.0"'],
python_requires=">=3, <4",
)
4 changes: 4 additions & 0 deletions vam/whittaker/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from ._version import __version__
from ._whit import lag1corr, ws2d, ws2dp, ws2doptv, ws2doptvp

__all__ = ("__version__",)
1 change: 1 addition & 0 deletions vam/whittaker/_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__version__ = "2.0.2"
File renamed without changes.

0 comments on commit afe01f0

Please sign in to comment.