Skip to content
Closed
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
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
*.sh text eol=lf
copulae/_version.py export-subst
36 changes: 21 additions & 15 deletions .github/workflows/test-build-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
strategy:
matrix:
os: [ ubuntu-latest, windows-latest, macos-latest ]
python-version: [ 3.9, '3.10', '3.11', '3.12' ]
python-version: [ '3.9', '3.10', '3.11', '3.12', '3.13' ]

steps:
- name: Checkout Repository
Expand Down Expand Up @@ -51,8 +51,10 @@ jobs:
python -m pip install --upgrade pip
pip install -r build-requirements.txt

- name: Build Extensions
run: python setup.py build_ext --inplace
- name: Build and install
run: |
python -m build --wheel --no-isolation
pip install -e .

- name: Test package
run: python -m pytest tests/
Expand All @@ -65,7 +67,7 @@ jobs:
pip install wheel coveralls
coveralls --service=github

build-src:
build-sdist:
name: Build SDist (Source)
needs: test-code
runs-on: ubuntu-latest
Expand All @@ -78,11 +80,13 @@ jobs:
with:
python-version: '3.10'

- name: Package source distribution
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r build-requirements.txt
python setup.py sdist
pip install build wheel numpy cython scipy

- name: Package source distribution
run: python -m build sdist sdist

- name: List items
run: |
Expand All @@ -97,7 +101,7 @@ jobs:
if-no-files-found: error

build-wheel:
name: Build wheels
name: Build wheels on ${{ matrix.os }}
needs: test-code
runs-on: ${{ matrix.os }}
strategy:
Expand All @@ -113,18 +117,20 @@ jobs:
with:
python-version: '3.10'

- name: Install cibuildwheel
run: |
python -m pip install --upgrade pip
pip install cibuildwheel

- name: Build BDist Package
env:
# specify python environments. Skip 32-bit builds
CIBW_BUILD: cp39-* cp310-* cp311-* cp312-*
CIBW_BUILD: cp39-* cp310-* cp311-* cp312-* cp313-*
CIBW_SKIP: "*-win32 *-manylinux_i686 *-musllinux_*"
# install dependencies, these are the minimum dependencies for building the wheels
CIBW_BEFORE_BUILD: pip install numpy cython scipy
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
run: |
python -m pip install --upgrade pip
pip install cibuildwheel
python -m cibuildwheel --output-dir dist
run: python -m cibuildwheel --output-dir dist

- name: List items
run: |
Expand All @@ -142,12 +148,12 @@ jobs:
# by running a mock import of copulae
install-package:
name: Test package installation
needs: [ build-src, build-wheel ]
needs: [ build-sdist, build-wheel ]
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
python-version: [ 3.9, '3.10', '3.11', '3.12' ]
python-version: [ '3.9', '3.10', '3.11', '3.12', '3.13' ]
# ext: [ tar.gz, whl ]
ext: [ whl ]

Expand Down
5 changes: 4 additions & 1 deletion Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,11 @@ typing-extensions = "*"
coverage = "*"
pytest-cov = "*"
ipython = "*"
setuptools = "*"
build = "*"
versioneer = {extras = ["toml"], version = "*"}

[dev-packages]

[requires]
python_version = "3.10"
python_version = "3.13"
783 changes: 436 additions & 347 deletions Pipfile.lock

Large diffs are not rendered by default.

13 changes: 8 additions & 5 deletions build-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
cython>=0.29
numpy>=1.24
build>=1.1
cython>=3.0
numpy>=2.0
pandas>=2.0
pytest>=7
pytest-cov>=2.10
scikit-learn>=1.2
pytest>=8
pytest-cov>=6
scikit-learn>=1.5
scipy>=1.10
setuptools>=67
statsmodels>=0.14
twine>=2.0.0
typing-extensions>=4.0.0; python_version < '3.11'
versioneer[toml] >= 0.29
wheel
wrapt>=1.12
45 changes: 45 additions & 0 deletions build_ext.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
"""Custom build extensions for Cython compilation"""
import platform

import numpy
from Cython.Build import cythonize
from setuptools.command.build_ext import build_ext as _build_ext


class build_ext(_build_ext):
def finalize_options(self):
super().finalize_options()
if self.include_dirs is None:
self.include_dirs = []
self.include_dirs.append(numpy.get_include())

def build_extensions(self):
# Read dev mode settings from pyproject.toml
for ext in self.extensions:
ext.include_dirs.append(numpy.get_include())

ext.define_macros.extend([
("NPY_NO_DEPRECATED_API", 1),
("NPY_1_7_API_VERSION", 1)
])

if platform.system() == 'Windows':
ext.extra_compile_args.append('/openmp')
elif platform.system() == 'Linux':
ext.extra_compile_args.append('-fopenmp')
ext.extra_link_args.append('-fopenmp')

# Cythonize with settings from pyproject.toml
self.extensions = cythonize(
self.extensions,
compiler_directives={
'language_level': 3,
'binding': True,
'wraparound': False,
'boundscheck': False,
'nonecheck': False,
'cdivision': True,
},
include_dirs=[numpy.get_include()],
)
super().build_extensions()
10 changes: 8 additions & 2 deletions copulae/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,15 @@
from copulae.marginal import *
from copulae.mixtures import *

__version__ = "0.7.9"


def doc():
import webbrowser
webbrowser.open('https://copulae.readthedocs.io/en/latest')


from copulae._version import get_versions

v = get_versions()
__version__ = v.get("closest-tag", v["version"])
__git_version__ = v.get("full-revisionid")
del get_versions, v
Loading