diff --git a/docs/sources/CHANGELOG.md b/docs/sources/CHANGELOG.md index 093dad1d2..7dbb530b4 100755 --- a/docs/sources/CHANGELOG.md +++ b/docs/sources/CHANGELOG.md @@ -21,6 +21,9 @@ The CHANGELOG for the current development version is available at - Address NumPy deprecations to make mlxtend compatible to NumPy 1.24 - Changed the signature of the `LinearRegression` model of sklearn in the test removing the `normalize` parameter as it is deprecated. ([#1036](https://github.com/rasbt/mlxtend/issues/1036)) +- Add `pyproject.toml` to support PEP 518 builds +- Fixed installation from sdist failing +- Converted configuration to `pyproject.toml` ##### New Features and Enhancements @@ -951,4 +954,4 @@ imput arrays via `transform` and `fit_transform` ### Version 0.1.1 (2014-08-13) -- Simplified code for ColumnSelector. \ No newline at end of file +- Simplified code for ColumnSelector. diff --git a/docs/sources/CONTRIBUTING.md b/docs/sources/CONTRIBUTING.md index 3ae16a823..38e8164e4 100755 --- a/docs/sources/CONTRIBUTING.md +++ b/docs/sources/CONTRIBUTING.md @@ -446,18 +446,23 @@ Consider deploying the package to the PyPI test server first. The setup instruct **First**, install Twine if you don't have it already installed. E.g., use the following to install all recommended packages: ```bash -$ conda install wheel twine setuptools +$ python -m pip install twine build ``` - -**Second**, create the binaries +**Second**, create the distribution. This by default creates an sdist and wheel +in the ``./dist`` directory. ```bash -$ python setup.py sdist +$ python -m build ``` +Install the wheel and sdist to make sure they work. +The distributions file names will change with each version. + ```bash -$ python setup.py bdist_wheel --universal +python -m pip install ./dist/mlxtend-0.23.0.dev0.tar.gz --force-reinstall +python -m pip install ./dist/mlxtend-0.23.0.dev0-py3-none-any.whl --force-reinstall +python -m pip uninstall mlxtend ``` **Third**, upload the packages to the test server: diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 000000000..b9ce846e1 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,58 @@ +[build-system] +requires = [ + "setuptools >= 59.0.0", +] +build-backend = "setuptools.build_meta" + +[project] +name = "mlxtend" +authors = [ + {name = "Sebastian Raschka", email = "mail@sebastianraschka.com"} +] +description="Machine Learning Library Extensions" +dynamic = ["version", "dependencies"] +license= {text = "BSD 3-Clause"} +readme = "README.md" +classifiers=[ + "License :: OSI Approved :: BSD License", + "Development Status :: 5 - Production/Stable", + "Operating System :: Microsoft :: Windows", + "Operating System :: POSIX", + "Operating System :: Unix", + "Operating System :: MacOS", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Topic :: Scientific/Engineering", + "Topic :: Scientific/Engineering :: Artificial Intelligence", + "Topic :: Scientific/Engineering :: Information Analysis", + "Topic :: Scientific/Engineering :: Image Recognition", +] + +[project.optional-dependencies] +testing = ["pytest"] +docs = ["mkdocs"] + +[project.urls] +Homepage = "https://github.com/rasbt/mlxtend" +Documentation = "https://rasbt.github.io/mlxtend" +Repository = "https://github.com/rasbt/mlxtend" + +[tool.setuptools] +platforms = ["any"] + +[tool.setuptools.dynamic] +version = {attr = "mlxtend.__version__"} +dependencies = {file = "requirements.txt"} + +[tool.setuptools.package-data] +"*" = ["LICENSE-BSD3.txt", "LICENSE-CC-BY.txt", "README.md", "requirements.txt"] + +[tool.pytest.ini_options] +norecursedirs = [ + "plotting/*", + "image/*", + "build/", +] diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index ead3fa338..000000000 --- a/setup.cfg +++ /dev/null @@ -1,5 +0,0 @@ -[bdist_wheel] -universal = 1 - -[tool:pytest] -norecursedirs = plotting/* image/* \ No newline at end of file diff --git a/setup.py b/setup.py deleted file mode 100644 index 5faf64394..000000000 --- a/setup.py +++ /dev/null @@ -1,71 +0,0 @@ -# Sebastian Raschka 2014-2016 -# mlxtend Machine Learning Library Extensions -# Author: Sebastian Raschka -# -# License: BSD 3 clause - -from os.path import dirname, join, realpath - -from setuptools import find_packages, setup - -import mlxtend - -VERSION = mlxtend.__version__ -PROJECT_ROOT = dirname(realpath(__file__)) - -REQUIREMENTS_FILE = join(PROJECT_ROOT, "requirements.txt") - -with open(REQUIREMENTS_FILE) as f: - install_reqs = f.read().splitlines() - -install_reqs.append("setuptools") - - -setup( - name="mlxtend", - version=VERSION, - description="Machine Learning Library Extensions", - author="Sebastian Raschka", - author_email="mail@sebastianraschka.com", - url="https://github.com/rasbt/mlxtend", - packages=find_packages(), - package_data={ - "": ["LICENSE-BSD3.txt", "LICENSE-CC-BY.txt", "README.md", "requirements.txt"] - }, - include_package_data=True, - install_requires=install_reqs, - extras_require={"testing": ["pytest"], "docs": ["mkdocs"]}, - license="BSD 3-Clause", - platforms="any", - classifiers=[ - "License :: OSI Approved :: BSD License", - "Development Status :: 5 - Production/Stable", - "Operating System :: Microsoft :: Windows", - "Operating System :: POSIX", - "Operating System :: Unix", - "Operating System :: MacOS", - "Programming Language :: Python :: 3.7", - "Topic :: Scientific/Engineering", - "Topic :: Scientific/Engineering :: Artificial Intelligence", - "Topic :: Scientific/Engineering :: Information Analysis", - "Topic :: Scientific/Engineering :: Image Recognition", - ], - long_description=""" - -A library of Python tools and extensions for data science. - - -Contact -============= - -If you have any questions or comments about mlxtend, -please feel free to contact me via -eMail: mail@sebastianraschka.com -or Twitter: https://twitter.com/rasbt - -This project is hosted at https://github.com/rasbt/mlxtend - -The documentation can be found at https://rasbt.github.io/mlxtend/ - -""", -)