Skip to content

Commit 6385444

Browse files
Switch to pyproject.toml from setup.py
1 parent ee02083 commit 6385444

File tree

4 files changed

+131
-42
lines changed

4 files changed

+131
-42
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
4444
- **New Example**: Better Lunar Lander example
4545

4646
### Changed
47+
- Switch to pyproject.toml instead of setup.py.
4748
- Dropped support for Python 3.6 and 3.7; neat-python now requires Python 3.8 or newer.
4849
- Modernized internal implementation in `neat/` and `examples/` to use Python 3 features
4950
such as f-strings, comprehensions, dataclasses for internal helpers, and type hints,

docs/installation.rst

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ Note that the examples are not included with the package installed from PyPI, so
2020
for release 1.1.0
2121
<https://github.com/CodeReclaimers/neat-python/releases/tag/v1.0.0>`_ and use the example code contained in it.
2222

23-
You may also just get the 1.1.0 release source, and install it directly using `setup.py` (as shown below)
23+
You may also just get the 1.1.0 release source, and install it directly (as shown below)
2424
instead of `pip`.
2525

26-
Install neat-python from source using setup.py
27-
----------------------------------------------
26+
Install neat-python from source
27+
--------------------------------
2828
Obtain the source code by either cloning the source repository::
2929

3030
git clone https://github.com/CodeReclaimers/neat-python.git
@@ -36,8 +36,14 @@ Note that the most current code in the repository may not always be in the most
3636
tests pass and that most of the examples run. If you encounter any problems, please open an `issue on GitHub
3737
<https://github.com/CodeReclaimers/neat-python/issues>`_.
3838

39-
To install from source, simply run::
39+
To install from source, run::
4040

41-
python setup.py install
41+
pip install .
4242

43-
from the directory containing setup.py.
43+
from the project root directory.
44+
45+
For development (editable install with dev dependencies)::
46+
47+
pip install -e ".[dev]"
48+
49+
This installs the package in editable mode with testing tools (pytest, coverage, etc.).

pyproject.toml

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
[build-system]
2+
requires = ["setuptools>=61.0", "wheel"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
name = "neat-python"
7+
version = "1.1.0"
8+
description = "A NEAT (NeuroEvolution of Augmenting Topologies) implementation"
9+
readme = "README.md"
10+
requires-python = ">=3.8"
11+
license = "BSD-3-Clause"
12+
authors = [
13+
{name = "Alan McIntyre", email = "[email protected]"},
14+
{name = "Cesar Gomes Miguel"},
15+
{name = "Carolina Feher da Silva"},
16+
{name = "Marcio Lobo Netto"},
17+
]
18+
maintainers = [
19+
{name = "Alan McIntyre", email = "[email protected]"},
20+
]
21+
keywords = ["neat", "neuroevolution", "genetic-algorithm", "neural-network", "evolutionary-algorithm"]
22+
classifiers = [
23+
"Development Status :: 5 - Production/Stable",
24+
"Intended Audience :: Developers",
25+
"Intended Audience :: Education",
26+
"Intended Audience :: Science/Research",
27+
"Operating System :: OS Independent",
28+
"Programming Language :: Python :: 3",
29+
"Programming Language :: Python :: 3 :: Only",
30+
"Programming Language :: Python :: 3.8",
31+
"Programming Language :: Python :: 3.9",
32+
"Programming Language :: Python :: 3.10",
33+
"Programming Language :: Python :: 3.11",
34+
"Programming Language :: Python :: 3.12",
35+
"Programming Language :: Python :: 3.13",
36+
"Programming Language :: Python :: 3.14",
37+
"Programming Language :: Python :: Implementation :: PyPy",
38+
"Topic :: Scientific/Engineering",
39+
]
40+
41+
[project.urls]
42+
Homepage = "https://github.com/CodeReclaimers/neat-python"
43+
Documentation = "https://neat-python.readthedocs.io"
44+
Repository = "https://github.com/CodeReclaimers/neat-python"
45+
Issues = "https://github.com/CodeReclaimers/neat-python/issues"
46+
Changelog = "https://github.com/CodeReclaimers/neat-python/blob/master/CHANGELOG.md"
47+
48+
[project.optional-dependencies]
49+
# Development dependencies
50+
dev = [
51+
"pytest>=7.0",
52+
"pytest-cov>=4.0",
53+
"coveralls>=3.0",
54+
]
55+
56+
# Documentation dependencies
57+
docs = [
58+
"sphinx>=7.0",
59+
"sphinx_rtd_theme>=3.0",
60+
"sphinx-copybutton>=0.5",
61+
"sphinx-design>=0.6",
62+
]
63+
64+
# Example dependencies (optional, for running examples)
65+
examples = [
66+
"numpy",
67+
"matplotlib",
68+
"graphviz",
69+
"gymnasium[box2d,mujoco]",
70+
"pygame",
71+
"gizeh",
72+
"moviepy",
73+
]
74+
75+
# All optional dependencies combined
76+
all = [
77+
"neat-python[dev,docs,examples]",
78+
]
79+
80+
[tool.setuptools]
81+
# Package discovery
82+
packages = ["neat", "neat.nn", "neat.iznn", "neat.ctrnn", "neat.export"]
83+
84+
[tool.setuptools.package-data]
85+
neat = ["py.typed"]
86+
87+
# Pytest configuration
88+
[tool.pytest.ini_options]
89+
testpaths = ["tests"]
90+
python_files = ["test_*.py"]
91+
addopts = [
92+
"-v",
93+
"--strict-markers",
94+
"--strict-config",
95+
]
96+
97+
# Coverage configuration
98+
[tool.coverage.run]
99+
source = ["neat"]
100+
branch = true
101+
omit = [
102+
"*/tests/*",
103+
"*/__pycache__/*",
104+
]
105+
106+
[tool.coverage.report]
107+
precision = 2
108+
show_missing = true
109+
skip_covered = false
110+
exclude_lines = [
111+
"pragma: no cover",
112+
"def __repr__",
113+
"raise AssertionError",
114+
"raise NotImplementedError",
115+
"if __name__ == .__main__.:",
116+
"if TYPE_CHECKING:",
117+
"@abstractmethod",
118+
]

setup.py

Lines changed: 0 additions & 36 deletions
This file was deleted.

0 commit comments

Comments
 (0)