diff --git a/pyproject.toml b/pyproject.toml index 579b312bc4b..98e44edfcb2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,17 +1,87 @@ [build-system] -# These are strictly build requirements. Runtime requirements are listed in -# INSTALL_REQUIRES in setup.py requires = [ - "setuptools>=59.2.0", + "setuptools", "cython>=0.29.26,<3", # Sync with CYTHON_MIN_VER in setup - # Workaround for oldest supported numpy using 1.21.6, but SciPy 1.9.2+ requiring 1.22.3+ - "oldest-supported-numpy; python_version!='3.10' or platform_system!='Windows' or platform_python_implementation=='PyPy'", - "numpy>=1.22.3; python_version=='3.10' and platform_system=='Windows' and platform_python_implementation != 'PyPy'", - "numpy; python_version>='3.12'", - "scipy>=1.4", + "numpy>=1.25.0", + "scipy>=1.11", "setuptools_scm[toml]~=7.0.0" ] build-backend = "setuptools.build_meta" +[project] +name = "statsmodels" +description = "Statistical computations and models for Python" +readme = "README.rst" +maintainers = [ + { name = "statsmodels Developers", email = "pystatsmodels@googlegroups.com" } +] +license = { file = "LICENSE.txt" } +classifiers = [ + "Development Status :: 4 - Beta", + "Environment :: Console", + "Programming Language :: Cython", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Operating System :: OS Independent", + "Intended Audience :: End Users/Desktop", + "Intended Audience :: Developers", + "Intended Audience :: Science/Research", + "Natural Language :: English", + "License :: OSI Approved :: BSD License", + "Topic :: Office/Business :: Financial", + "Topic :: Scientific/Engineering", +] +requires-python = ">=3.10" +dependencies = [ + "numpy>=1.25.0", + "scipy>=1.11", + "pandas>=2.0", + "patsy>=0.5.2", # released January 2018 + "packaging>=21.3" # released Nov 2021 +] + +[project.optional-dependencies] +develop = [ + # run + "matplotlib>=3", + "colorama", + "joblib", + + # test + "pytest>=7.3.0", + "pytest-randomly", + "pytest-xdist", + + # code quality + "flake8", + "isort", +] +docs = [ + "sphinx", + "nbconvert", + "jupyter_client", + "ipykernel", + "matplotlib", + "nbformat", + "numpydoc", + "pandas-datareader", +] + +[project.urls] +Homepage = "https://www.statsmodels.org/" +"Bug Tracker" = "https://github.com/statsmodels/statsmodels/issues" +"Documentation" = "https://www.statsmodels.org/stable/index.html" +"Source Code" = "https://github.com/statsmodels/statsmodels" + +[tool.setuptools.packages.find] +include = ["LICENSE.txt", "setup.cfg"] + [tool.setuptools_scm] write_to = "statsmodels/_version.py" + +[tool.pytest.ini_options] +minversion = 7 +testpaths = "statsmodels" +xfail_strict = true +addopts = "--strict" diff --git a/requirements-dev.txt b/requirements-dev.txt deleted file mode 100644 index 06fcef5930d..00000000000 --- a/requirements-dev.txt +++ /dev/null @@ -1,23 +0,0 @@ -# build -cython>=0.29.28,<3.0.0 -setuptools_scm[toml]~=7.0 -oldest-supported-numpy>=2022.4.18 - -# run -matplotlib>=3 -colorama -joblib -# Remove due to failures on azure CI -# cvxopt; os_name != "win32" - -# test -pytest>=7.3.0 -pytest-randomly -pytest-xdist - -# Pin on Win32 -pywinpty; os_name == "nt" - -# code quality -flake8 -isort diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index dd060a5bc8d..00000000000 --- a/requirements.txt +++ /dev/null @@ -1,8 +0,0 @@ -# Workaround for scipy build requirement -numpy>=1.22.3; python_version=="3.10" and platform_system=="Windows" and platform_python_implementation != "PyPy" -numpy >=1.18 # released December 2019 -scipy>=1.4,!=1.9.2 # released December 2019 -scipy>=1.4,!=1.9.2; sys_platform == "win32" # Blacklist 1.9.2 due to Windows issues -pandas>=1.0 # released January 2020 -patsy>=0.5.2 # released January 2018 -packaging>=21.3 # released Nov 2021 diff --git a/setup.cfg b/setup.cfg index 57c41e0abff..3b6667162c7 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,9 +1,5 @@ -[metadata] -license_files = - LICENSE.txt - [tool:pytest] -minversion = 6 +minversion = 7 testpaths = statsmodels xfail_strict = true addopts = --strict diff --git a/setup.py b/setup.py index a889de13c47..1a143e4cd19 100644 --- a/setup.py +++ b/setup.py @@ -45,71 +45,11 @@ ############################################################################### # Key Values that Change Each Release ############################################################################### -# These are strictly installation requirements. Builds requirements are -# managed in pyproject.toml -INSTALL_REQUIRES = [] -with open("requirements.txt", encoding="utf-8") as req: - for line in req.readlines(): - INSTALL_REQUIRES.append(line.split("#")[0].strip()) - -DEVELOP_REQUIRES = [] -with open("requirements-dev.txt", encoding="utf-8") as req: - for line in req.readlines(): - DEVELOP_REQUIRES.append(line.split("#")[0].strip()) - CYTHON_MIN_VER = "0.29.26" # released 2020 -EXTRAS_REQUIRE = { - "build": ["cython>=" + CYTHON_MIN_VER], - "develop": ["cython>=" + CYTHON_MIN_VER] + DEVELOP_REQUIRES, - "docs": [ - "sphinx", - "nbconvert", - "jupyter_client", - "ipykernel", - "matplotlib", - "nbformat", - "numpydoc", - "pandas-datareader", - ], -} - ############################################################################### # Values that rarely change ############################################################################### -DISTNAME = "statsmodels" -DESCRIPTION = "Statistical computations and models for Python" -README = SETUP_DIR.joinpath("README.rst").read_text() -LONG_DESCRIPTION = README -MAINTAINER = "statsmodels Developers" -MAINTAINER_EMAIL = "pystatsmodels@googlegroups.com" -URL = "https://www.statsmodels.org/" -LICENSE = "BSD License" -DOWNLOAD_URL = "" -PROJECT_URLS = { - "Bug Tracker": "https://github.com/statsmodels/statsmodels/issues", - "Documentation": "https://www.statsmodels.org/stable/index.html", - "Source Code": "https://github.com/statsmodels/statsmodels", -} - -CLASSIFIERS = [ - "Development Status :: 4 - Beta", - "Environment :: Console", - "Programming Language :: Cython", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Operating System :: OS Independent", - "Intended Audience :: End Users/Desktop", - "Intended Audience :: Developers", - "Intended Audience :: Science/Research", - "Natural Language :: English", - "License :: OSI Approved :: BSD License", - "Topic :: Office/Business :: Financial", - "Topic :: Scientific/Engineering", -] - -FILES_TO_INCLUDE_IN_PACKAGE = ["LICENSE.txt", "setup.cfg"] FILES_COPIED_TO_PACKAGE = [] for filename in FILES_TO_INCLUDE_IN_PACKAGE: @@ -384,27 +324,11 @@ def is_pure(self): setup( - name=DISTNAME, - maintainer=MAINTAINER, ext_modules=extensions, - maintainer_email=MAINTAINER_EMAIL, - description=DESCRIPTION, - license=LICENSE, - url=URL, - download_url=DOWNLOAD_URL, - project_urls=PROJECT_URLS, - long_description=LONG_DESCRIPTION, - classifiers=CLASSIFIERS, - platforms="any", cmdclass=cmdclass, - packages=find_packages(), package_data=package_data, distclass=BinaryDistribution, - include_package_data=False, # True will install all files in repo - install_requires=INSTALL_REQUIRES, - extras_require=EXTRAS_REQUIRE, zip_safe=False, - python_requires=">=3.8", ) # Clean-up copied files