Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions .github/workflows/publish_package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,12 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
curl -sSL https://install.python-poetry.org | python3 -

- name: Build package
run: python setup.py sdist bdist_wheel
run: poetry build

- name: Upload to PyPI
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: twine upload dist/*

POETRY_PYPI_TOKEN_POETRY: ${{ secrets.PYPI_API_TOKEN }}
run: poetry publish
8 changes: 6 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox tox-gh-actions
sudo apt-get update
sudo apt-get install -y --no-install-recommends curl gcc
curl -sSL https://install.python-poetry.org | python3 -
export PATH="/root/.local/bin:$PATH"
poetry install --extras cpu --with dev,github-ci
- name: Test with tox
run: tox
run: poetry run tox
2,716 changes: 2,716 additions & 0 deletions poetry.lock

Large diffs are not rendered by default.

128 changes: 124 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,122 @@
[build-system]
requires = ["setuptools", "wheel"]
build-backend = "setuptools.build_meta"
[project]
name = "TPOT"
description = "Tree-based Pipeline Optimization Tool"
license = "LGPL-3.0"
version="0.0.0" # grabbed from _version.py by poetry-dynamic-versioning (see "dynamic" instances below)
dynamic = ["version"]
# TODO: this doesn't seem to match code comments
authors = [{ name = "Pedro Ribioro", email = "[email protected]" }]
readme = "README.md"
project.urls = [
"https://epistasislab.github.io/tpot/",
"https://github.com/EpistasisLab/tpot",
]
classifiers=[
"Intended Audience :: Science/Research",
"License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Scientific/Engineering :: Artificial Intelligence"
]
keywords = [
"pipeline optimization",
"hyperparameter optimization",
"data science",
"machine learning",
"genetic programming",
"evolutionary computation"
]
requires-python=">=3.10.0,<3.14.0"

# TODO: Specifically-listed deps from setup.py that aren't included here yet.
# 'optuna>=3.0.5',
# 'dask-expr>=1.0.12',
# 'dask-jobqueue>=0.8.5',
# 'func_timeout>=4.3.5',
# 'dill>=0.3.9'

# TODO: Not yet integrated from setup.py
#extras_require={
# 'skrebate': ['skrebate>=0.3.4'],
# 'mdr': ['scikit-mdr>=0.4.4'],
# 'sklearnex' : ['scikit-learn-intelex>=2023.2.1'],
# 'amltk' : ['amltk>=1.12.1'],
#}

# TODO: several dependencies don't seem strictly needed in every context, but were needed
# to run the code as-is.

dependencies = [
"ConfigSpace>=1.1.1",
"distributed>=2024.4.2",
"func_timeout>=4.3.5",
"joblib>=1.1.1",
"lightgbm>=3.3.3",
"matplotlib>=3.6.2",
"networkx>=3.0",
"nose",
"numpy>=1.26.4",
"pandas>=2.2.0",
"scikit-learn>=1.6",
"scipy>=1.3.1",
"stopit>=1.1.1",
"tqdm>=4.36.1",
"traitlets>=5.8.0",
# TODO: setuptools was needed to make stopit work.
# stopit is a dead project.
#>>> import tpot
#Traceback (most recent call last):
# File "<stdin>", line 1, in <module>
# File "/code/tpot/__init__.py", line 48, in <module>
# from . import utils
# File "/code/tpot/utils/__init__.py", line 36, in <module>
# from . import eval_utils
# File "/code/tpot/utils/eval_utils.py", line 43, in <module>
# from stopit import threading_timeoutable, TimeoutException
# File "/root/.cache/pypoetry/virtualenvs/tpot-MATOk_fk-py3.12/lib/python3.12/site-packages/stopit/__init__.py", line 10, in <module>
# import pkg_resources
#ModuleNotFoundError: No module named 'pkg_resources'
"setuptools (>=80.9.0,<81.0.0)",
]

[project.optional-dependencies]
cpu = ["xgboost-cpu (>=3.0) ; extra != 'cuda'"]
cuda = ["xgboost (>=3.0) ; extra != 'cpu'"]
nn = ["torch"]
plot = ["matplotlib"]

[tool.poetry]

[tool.poetry.group.dev]
optional = true
[tool.poetry.group.dev.dependencies]
nose = "*"
pytest = "*"
pytest-cov = "*"
mypy = "*"
flake8 = "*"
tox = "*"

# Define in a separate group, so clients can optionally opt out.
[tool.poetry.group.updates.dependencies]
update_checker = ">=0.16"


[tool.poetry.requires-plugins]
poetry-dynamic-versioning = ">=1.0.0,<2.0.0"

[tool.poetry-dynamic-versioning]
enable = true
# version = { git-tag = true }
# version = { attr = "tpot.__version__" }

[tool.poetry.group.github-ci]
optional = true

[tool.poetry.group.github-ci.dependencies]
tox-gh-actions = "*"

[tool.pytest.ini_options]
addopts = "--cov=tpot"
Expand All @@ -20,4 +136,8 @@ warn_redundant_casts = true
warn_return_any = true
warn_unreachable = true
warn_unused_configs = true
no_implicit_reexport = true
no_implicit_reexport = true

[build-system]
requires = ["poetry-core>=1.0.0", "poetry-dynamic-versioning"]
build-backend = "poetry_dynamic_versioning.backend"
6 changes: 0 additions & 6 deletions requirements_dev.txt

This file was deleted.

13 changes: 0 additions & 13 deletions setup.cfg

This file was deleted.

69 changes: 0 additions & 69 deletions setup.py

This file was deleted.

10 changes: 6 additions & 4 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ python =
[testenv]
setenv =
PYTHONPATH = {toxinidir}
deps =
-r{toxinidir}/requirements_dev.txt
deps = poetry
commands_pre =
poetry install --extras cpu --with dev,github-ci
commands =
pytest --basetemp={envtmpdir}

Expand All @@ -28,6 +29,7 @@ commands = flake8 tpot

[testenv:mypy]
basepython = python3.10
deps =
-r{toxinidir}/requirements_dev.txt
commands_pre =
poetry install --extras cpu --with dev,github-ci
deps = poetry
commands = mypy tpot
17 changes: 14 additions & 3 deletions tpot/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
#TODO: are all the imports in the init files done correctly?
#TODO clean up import organization

import warnings

from .individual import BaseIndividual

from .graphsklearn import GraphPipeline
Expand All @@ -54,6 +56,15 @@

from .tpot_estimator import TPOTClassifier, TPOTRegressor, TPOTEstimator, TPOTEstimatorSteadyState

from update_checker import update_check
from ._version import __version__
update_check("tpot",__version__)
# Optionally import update_checker and use it to noisily complain if this isn't exactly the latest
# TPOT release.
try:
from update_checker import update_check
from ._version import __version__
update_check("tpot",__version__)
except ImportError:
warnings.warn(
ImportWarning(
"Optional update_check import is missing. Recency of TPOT version won't be checked."
)
)
2 changes: 1 addition & 1 deletion tpot/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@
License along with TPOT. If not, see <http://www.gnu.org/licenses/>.

"""
__version__ = '1.1.0'
__version__ = '0.0.0' # Managed via the git tag