diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 93adead..6c7a85c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index b4622a4..ffee56a 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -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 @@ -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 @@ -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 @@ -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 }} diff --git a/_version/__init__.py b/_version/__init__.py deleted file mode 100644 index 63ecbb5..0000000 --- a/_version/__init__.py +++ /dev/null @@ -1,22 +0,0 @@ -""" -_version - -Version information for MODAPE whittaker core - -""" - -__all__ = [ - 'VERSION_MAJOR', - 'VERSION_MINOR', - 'VERSION_PATCH', - 'VERSION_STRING', - '__version__', -] - -VERSION_MAJOR = 2 -VERSION_MINOR = 0 -VERSION_PATCH = 2 - -VERSION_STRING = '%s.%s.%s' % (VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH) - -__version__ = VERSION_STRING diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..e4ca2ec --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["setuptools>=51.0.0", "wheel", "numpy>=1.15.1", "cython"] +build-backend = "setuptools.build_meta" diff --git a/setup.cfg b/setup.cfg index 18fa5e2..043f12a 100644 --- a/setup.cfg +++ b/setup.cfg @@ -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 diff --git a/setup.py b/setup.py index 43994ab..854f838 100644 --- a/setup.py +++ b/setup.py @@ -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 @@ -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='valentin.pesendorfer@wfp.org', - 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", ) diff --git a/vam/whittaker/__init__.py b/vam/whittaker/__init__.py new file mode 100644 index 0000000..a26c4f5 --- /dev/null +++ b/vam/whittaker/__init__.py @@ -0,0 +1,4 @@ +from ._version import __version__ +from ._whit import lag1corr, ws2d, ws2dp, ws2doptv, ws2doptvp + +__all__ = ("__version__",) diff --git a/vam/whittaker/_version.py b/vam/whittaker/_version.py new file mode 100644 index 0000000..0309ae2 --- /dev/null +++ b/vam/whittaker/_version.py @@ -0,0 +1 @@ +__version__ = "2.0.2" diff --git a/src/_whittaker.pyx b/vam/whittaker/_whittaker.pyx similarity index 100% rename from src/_whittaker.pyx rename to vam/whittaker/_whittaker.pyx