diff --git a/.git_archival.txt b/.git_archival.txt new file mode 100644 index 00000000..8fb235d7 --- /dev/null +++ b/.git_archival.txt @@ -0,0 +1,4 @@ +node: $Format:%H$ +node-date: $Format:%cI$ +describe-name: $Format:%(describe:tags=true,match=*[0-9]*)$ +ref-names: $Format:%D$ diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..00a7b00c --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +.git_archival.txt export-subst diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index f362d080..5c64b33b 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -40,6 +40,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 + with: + fetch-depth: 0 - name: Build sdist run: pipx run build -s - uses: actions/upload-artifact@v3 @@ -66,6 +68,8 @@ jobs: steps: - uses: actions/checkout@v3 + with: + fetch-depth: 0 - name: Build wheel(s) run: pipx run cibuildwheel diff --git a/.gitignore b/.gitignore index c89e3bb3..19f336c8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,16 @@ +# Compiled python files *.pyc + +# Editor swap files *~ +.*.swp +# Build artifacts *.so *.c +*.egg-info/ build/ +dist/ + +# setuptools_scm +nitime/_version.py diff --git a/MANIFEST.in b/MANIFEST.in deleted file mode 100644 index 4911aa34..00000000 --- a/MANIFEST.in +++ /dev/null @@ -1,18 +0,0 @@ -include *.txt *.py -include THANKS -include LICENSE -include INSTALL - -graft nitime -graft doc -graft tools - -# docs subdirs we want to skip -prune doc/_build -prune doc/api/generated - -global-exclude *~ -global-exclude *.flc -global-exclude *.pyc -global-exclude .dircopy.log -global-exclude .git diff --git a/nitime/__init__.py b/nitime/__init__.py index c44f48c8..429060b0 100644 --- a/nitime/__init__.py +++ b/nitime/__init__.py @@ -21,7 +21,7 @@ __docformat__ = 'restructuredtext' -from .version import __version__ +from ._version import __version__ from . import algorithms from . import timeseries diff --git a/nitime/version.py b/nitime/version.py deleted file mode 100644 index 8c70331b..00000000 --- a/nitime/version.py +++ /dev/null @@ -1,99 +0,0 @@ -"""nitime version/release information""" - -# Format expected by setup.py and doc/source/conf.py: string of form "X.Y.Z" -_version_major = 0 -_version_minor = 11 -_version_micro = '' # use '' for first of series, number for 1 and above -_version_extra = 'dev' -# _version_extra = '' # Uncomment this for full releases - -# Construct full version string from these. -_ver = [_version_major, _version_minor] -if _version_micro: - _ver.append(_version_micro) -if _version_extra: - _ver.append(_version_extra) - -__version__ = '.'.join(map(str, _ver)) - -CLASSIFIERS = ["Development Status :: 3 - Alpha", - "Environment :: Console", - "Intended Audience :: Science/Research", - "License :: OSI Approved :: BSD License", - "Operating System :: OS Independent", - "Programming Language :: Python", - "Topic :: Scientific/Engineering"] - -description = "Nitime: timeseries analysis for neuroscience data" - -# Note: this long_description is actually a copy/paste from the top-level -# README.txt, so that it shows up nicely on PyPI. So please remember to edit -# it only in one place and sync it correctly. -long_description = """ -=================================================== - Nitime: timeseries analysis for neuroscience data -=================================================== - -Nitime is library of tools and algorithms for the analysis of time-series data -from neuroscience experiments. It contains a implementation of numerical -algorithms for time-series analysis both in the time and spectral domains, a -set of container objects to represent time-series, and auxiliary objects that -expose a high level interface to the numerical machinery and make common -analysis tasks easy to express with compact and semantically clear code. - -Website and mailing list -======================== - -Current information can always be found at the nitime `website`_. Questions and -comments can be directed to the mailing `list`_. - -.. _website: http://nipy.org/nitime -.. _list: http://mail.scipy.org/mailman/listinfo/nipy-devel - -Code -==== - -You can find our sources and single-click downloads: - -* `Main repository`_ on Github. -* Documentation_ for all releases and current development tree. -* Download as a tar/zip file the `current trunk`_. -* Downloads of all `available releases`_. - -.. _main repository: http://github.com/nipy/nitime -.. _Documentation: http://nipy.org/nitime -.. _current trunk: http://github.com/nipy/nitime/archives/master -.. _available releases: http://github.com/nipy/nitime/downloads - - -License information -=================== - -Nitime is licensed under the terms of the new BSD license. See the file -"LICENSE" for information on the history of this software, terms & conditions -for usage, and a DISCLAIMER OF ALL WARRANTIES. - -All trademarks referenced herein are property of their respective holders. - -Copyright (c) 2006-2020, NIPY Developers -All rights reserved. -""" - -NAME = "nitime" -MAINTAINER = "Nipy Developers" -MAINTAINER_EMAIL = "neuroimaging@python.org" -DESCRIPTION = description -LONG_DESCRIPTION = long_description -URL = "http://nipy.org/nitime" -DOWNLOAD_URL = "http://github.com/nipy/nitime/downloads" -LICENSE = "Simplified BSD" -AUTHOR = "Nitime developers" -AUTHOR_EMAIL = "neuroimaging@python.org" -PLATFORMS = "OS Independent" -MAJOR = _version_major -MINOR = _version_minor -MICRO = _version_micro -VERSION = __version__ -PACKAGE_DATA = {"nitime": ["LICENSE", "tests/*.txt", "tests/*.npy", - "data/*.nii.gz", "data/*.txt", "data/*.csv"]} -PYTHON_REQUIRES = ">=3.7" diff --git a/pyproject.toml b/pyproject.toml index defdd112..7db5618b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,7 @@ [build-system] requires = [ "setuptools", + "setuptools_scm[toml]>=6.2", "cython", # Newer than NEP29-minimum: compile against oldest numpy available "numpy==1.24; python_version >= '3.11'", @@ -10,10 +11,53 @@ requires = [ ] build-backend = "setuptools.build_meta" +[project] +name = "nitime" +dynamic = ["version"] +description = "Nitime: timeseries analysis for neuroscience data" +readme = "README.txt" +license = { file = "LICENSE" } +requires-python = ">=3.7" +authors = [ + { name = "Nitime developers", email = "neuroimaging@python.org" }, +] +maintainers = [ + { name = "Nipy Developers", email = "neuroimaging@python.org" }, +] +classifiers = [ + "Development Status :: 3 - Alpha", + "Environment :: Console", + "Intended Audience :: Science/Research", + "License :: OSI Approved :: BSD License", + "Operating System :: OS Independent", + "Programming Language :: Python", + "Topic :: Scientific/Engineering", +] +dependencies = [ + "matplotlib", + "numpy", + "scipy", +] + +[project.optional-dependencies] +full = [ + "networkx", + "nibabel", +] + +[project.urls] +Download = "http://github.com/nipy/nitime/downloads" +Homepage = "http://nipy.org/nitime" + +[tool.setuptools.packages.find] +include = ["nitime*"] + +[tool.setuptools_scm] +write_to = "nitime/_version.py" + [tool.cibuildwheel] -# Disable CPython 3.6 here; if project.requires-python gets defined, -# cp36* can be removed -skip = "pp* cp36*" +# Disable PyPy +skip = "pp*" # 64-bit builds only; 32-bit builds seem pretty niche these days, so # don't bother unless someone asks diff --git a/setup.py b/setup.py index 7935cb20..3974b51f 100755 --- a/setup.py +++ b/setup.py @@ -1,63 +1,29 @@ #!/usr/bin/env python -"""Setup file for the Python nitime package.""" +"""Setup file for the Python nitime package. -import os -import sys - -# BEFORE importing distutils, remove MANIFEST. distutils doesn't properly -# update it when the contents of directories change. -if os.path.exists('MANIFEST'): - os.remove('MANIFEST') - -from setuptools import find_packages, setup - -# Get version and release info, which is all stored in nitime/version.py -ver_file = os.path.join('nitime', 'version.py') -with open(ver_file) as f: - exec(f.read()) - -REQUIRES = [] - -with open('requirements.txt') as f: - ll = f.readline()[:-1] - while ll: - REQUIRES.append(ll) - ll = f.readline()[:-1] - -PACKAGES = find_packages() - - -opts = dict(name=NAME, - maintainer=MAINTAINER, - maintainer_email=MAINTAINER_EMAIL, - description=DESCRIPTION, - long_description=LONG_DESCRIPTION, - url=URL, - download_url=DOWNLOAD_URL, - license=LICENSE, - classifiers=CLASSIFIERS, - author=AUTHOR, - author_email=AUTHOR_EMAIL, - platforms=PLATFORMS, - version=VERSION, - packages=PACKAGES, - package_data=PACKAGE_DATA, - install_requires=REQUIRES, - requires=REQUIRES, - python_requires=PYTHON_REQUIRES, - ) +This file only contains cython components. +See pyproject.toml for the remaining configuration. +""" +from setuptools import setup try: from setuptools import Extension from Cython.Build import cythonize from numpy import get_include + # add Cython extensions to the setup options - exts = [Extension('nitime._utils', ['nitime/_utils.pyx'], - include_dirs=[get_include()])] - opts['ext_modules'] = cythonize(exts, language_level='3') + exts = [ + Extension( + 'nitime._utils', + ['nitime/_utils.pyx'], + include_dirs=[get_include()], + define_macros=[('NPY_NO_DEPRECATED_API', 'NPY_1_7_API_VERSION')], + ) + ] + opts = {'ext_modules': cythonize(exts, language_level='3')} except ImportError: # no loop for you! - pass + opts = {} # Now call the actual setup function if __name__ == '__main__': diff --git a/setup_egg.py b/setup_egg.py deleted file mode 100644 index 6d5d631f..00000000 --- a/setup_egg.py +++ /dev/null @@ -1,2 +0,0 @@ -from setuptools import setup -execfile('setup.py')