Skip to content

Commit

Permalink
Fix build (#169)
Browse files Browse the repository at this point in the history
Modernize and fix build
  • Loading branch information
HDembinski committed Mar 19, 2023
1 parent b6ded3d commit 89fa18c
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 48 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
59 changes: 50 additions & 9 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
33 changes: 0 additions & 33 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -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
Expand Down
13 changes: 12 additions & 1 deletion src/resample/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__",
]

0 comments on commit 89fa18c

Please sign in to comment.