Skip to content

Commit

Permalink
FIX installation
Browse files Browse the repository at this point in the history
  • Loading branch information
NelleV committed Jan 19, 2024
1 parent 53d7a93 commit bcb1e89
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 105 deletions.
7 changes: 1 addition & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,14 @@ jobs:
strategy:
fail-fast: true
matrix:
python-version: [3.7, 3.8, 3.9]
python-version: ["3.9", "3.10", "3.11", "3.12"]
PIP_FLAGS: [""]
MINIMUM_REQUIREMENTS: [0]
include:
- platform_id: manylinux_x86_64
python-version: 3.7
MINIMUM_REQUIREMENTS: 1
OPTIONS_NAME: "min"
- platform_id: manylinux_x86_64
python-version: 3.9
PIP_FLAGS: "--pre"
# test pre-releases
OPTIONS_NAME: "pre"

steps:
- name: Checkout 🛎️
Expand Down
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
recursive-include iced *.c *.h *.py
recursive-include *.matrix *.bed
recursive-include iced *.matrix *.bed *.mat
include pyproject.toml
2 changes: 1 addition & 1 deletion iced/normalization/_normalization_.pyx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import numpy as np
#import numpy as np
cimport cython
cimport numpy as np

Expand Down
134 changes: 37 additions & 97 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,112 +1,52 @@
import os
import sys
from setuptools import Extension, setup, find_packages
import numpy as np


DISTNAME = 'iced'
DESCRIPTION = 'ICE normalization'
MAINTAINER = 'Nelle Varoquaux'
MAINTAINER_EMAIL = '[email protected]'
VERSION = "0.6.0a0.dev0"
LICENSE = "BSD"


SCIPY_MIN_VERSION = '0.19.0'
NUMPY_MIN_VERSION = '1.16.0'

extension_config = {
"_filter": [
{"sources": ["_filter.pyx"]}
],
"normalization": [
{"sources": ["_normalization.pyx"]}
]
}


setup(
name=DISTNAME,
version=VERSION,
author=MAINTAINER,
author_email=MAINTAINER_EMAIL,
description=DESCRIPTION,
license=LICENSE,
classifiers=[
"Development Status :: 3 - Alpha",
"Topic :: Utilities",
"License :: OSI Approved :: BSD License",
],
packages=find_packages(where="."),
ext_modules=[
Extension(name="iced._filter_",
sources=["iced/_filter_.pyx"],
include_dirs=[np.get_include()]
),
Extension(name="iced.normalization/_normalization_",
sources=["iced/normalization/_normalization_.pyx"],
include_dirs=[np.get_include()]
)],
include_package_data=True,
)

# Optional setuptools features
# We need to import setuptools early, if we want setuptools features,
# as it monkey-patches the 'setup' function
# For some commands, use setuptools
SETUPTOOLS_COMMANDS = set([
'develop', 'release', 'bdist_egg', 'bdist_rpm',
'bdist_wininst', 'install_egg_info', 'build_sphinx',
'egg_info', 'easy_install', 'upload', 'bdist_wheel',
'--single-version-externally-managed',
])

if SETUPTOOLS_COMMANDS.intersection(sys.argv):
import setuptools

extra_setuptools_args = dict(
zip_safe=False, # the package can run out of an .egg file
include_package_data=True,
extras_require={
'alldeps': (
'numpy >= {0}'.format(NUMPY_MIN_VERSION),
'scipy >= {0}'.format(SCIPY_MIN_VERSION),
),
},
)
else:
extra_setuptools_args = dict()


def configuration(parent_package='', top_path=None):
if os.path.exists('MANIFEST'):
os.remove('MANIFEST')

from numpy.distutils.misc_util import Configuration

config = Configuration(None, parent_package, top_path)
# Avoid non-useful msg:
# "Ignoring attempt to set 'name' (from ... "
config.set_options(ignore_setup_xxx_py=True,
assume_default_configuration=True,
delegate_options_to_subpackages=True,
quiet=True)

config.add_subpackage('iced')

return config


def setup_package():
metadata = dict(
configuration=configuration,
name=DISTNAME,
maintainer=MAINTAINER,
maintainer_email=MAINTAINER_EMAIL,
description=DESCRIPTION,
version=VERSION,
scripts=['iced/scripts/ice'],
classifiers=[
'Intended Audience :: Science/Research',
'Intended Audience :: Developers',
'License :: OSI Approved',
'Programming Language :: C',
'Programming Language :: Python',
'Topic :: Software Development',
'Topic :: Scientific/Engineering',
'Operating System :: Microsoft :: Windows',
'Operating System :: POSIX',
'Operating System :: Unix',
'Operating System :: MacOS'],
**extra_setuptools_args)

if len(sys.argv) == 1 or (
len(sys.argv) >= 2 and ('--help' in sys.argv[1:] or
sys.argv[1] in ('--help-commands',
'egg_info',
'--version',
'clean'))):
# For these actions, NumPy is not required
#
# They are required to succeed without Numpy for example when
# pip is used to install Scikit-learn when Numpy is not yet present in
# the system.
try:
from setuptools import setup
except ImportError:
from distutils.core import setup

metadata['version'] = VERSION
else:
from numpy.distutils.core import setup

metadata['configuration'] = configuration

setup(**metadata)


if __name__ == "__main__":
setup_package()

0 comments on commit bcb1e89

Please sign in to comment.