diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index c91f922..10d2dfd 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -19,15 +19,15 @@ jobs: steps: - uses: actions/checkout@v3 + with: + fetch-depth: 0 # needed by setuptools_scm - uses: actions/setup-python@v4 with: python-version: "3.10" - # do not remove wheel - - run: python -m pip install --upgrade pip wheel - - run: python -m pip install --prefer-binary -e .[test] - - run: python setup.py sdist bdist_wheel - - run: python -m pip install --force-reinstall dist/*.tar.gz + - run: python -m pip install --upgrade pip build + - run: python -m build + - run: python -m pip install --prefer-binary $(echo dist/*.whl)'[test]' - run: python -m pytest - uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/pyproject.toml b/pyproject.toml index fe1db52..906e2d9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,18 +1,59 @@ [build-system] requires = [ - "setuptools >= 42", - "setuptools_scm[toml] >= 3.4", - # numpy 1.19 is first to support C-API for random - # use oldest numpy for given Python version to ensure compatible Numpy C-API - "numpy == 1.19; python_version == '3.7'", - "numpy == 1.19; python_version == '3.8'", - "numpy == 1.20; python_version == '3.9'", - "numpy == 1.21.2; python_version == '3.10'", + "setuptools >= 61", + "setuptools_scm[toml] >= 6.2", ] build-backend = "setuptools.build_meta" +[project] +name = "resample" +requires-python = ">=3.8" +dependencies = [ + "numpy >= 1.21", + "scipy >= 1.10" +] +authors = [ + { name = "Hans Dembinski", email = "hans.dembinski@gmail.com" }, + { name = "Daniel Saxton" } +] +readme = "README.rst" +description = "Resampling-based inference in Python" +license = { text = "BSD-3-Clause" } +classifiers = [ + 'Development Status :: 5 - Production', + 'Intended Audience :: Science/Research', + "License :: OSI Approved :: BSD License", + "Operating System :: OS Independent", + "Programming Language :: Python :: 3", + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3 :: Only', + 'Programming Language :: Python :: 3.8', + 'Programming Language :: Python :: 3.9', + 'Programming Language :: Python :: 3.10', + 'Programming Language :: Python :: 3.11', + 'Programming Language :: Python :: Implementation :: CPython', + 'Programming Language :: Python :: Implementation :: PyPy', +] +dynamic = ["version"] + +[project.urls] +repository = "http://github.com/resample-project/resample" +documentation = "https://resample.readthedocs.io/en/stable/" + +[project.optional-dependencies] +test = [ + "pytest", + "pytest-cov" +] +doc = [ + "ipython", + "nbsphinx" +] + +[tool.setuptools.packages.find] +where = ["src"] + [tool.setuptools_scm] -write_to = "src/resample/_version.py" [tool.isort] profile = "black" diff --git a/setup.cfg b/setup.cfg index bca0ed2..cfcbd17 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,36 +1,3 @@ -[metadata] -name = resample -version = attr: resample.__version__ -author = Daniel Saxton and Hans Dembinski -description = Randomisation-based inference in Python -long_description = file: README.rst -long_description_content_type = text/x-rst -url = http://github.com/resample-project/resample -project_urls = - Bug Tracker = https://github.com/resample-project/resample/issues -license = BSD-3-Clause -classifiers = - Programming Language :: Python :: 3 - License :: OSI Approved :: BSD License - Operating System :: OS Independent - -[options] -package_dir = - = src -packages = resample -python_requires = >=3.8 -install_requires = - numpy >= 1.21 - scipy >= 1.10 - -[options.extras_require] -test = - pytest - pytest-cov -doc = - ipython - nbsphinx - [flake8] max_line_length = 88 ignore = E203 W503 diff --git a/src/resample/__init__.py b/src/resample/__init__.py index d286064..1b48108 100644 --- a/src/resample/__init__.py +++ b/src/resample/__init__.py @@ -11,5 +11,16 @@ - Permutation-based variants of traditional statistical tests (t-test, K-S test, etc.) - Tools for working with empirical distributions (CDF, quantile, etc.) """ +from importlib.metadata import version -from ._version import version as __version__ # noqa +from resample import bootstrap, empirical, jackknife, permutation + +__version__ = version("resample") + +__all__ = [ + "jackknife", + "bootstrap", + "permutation", + "empirical", + "__version__", +]