Skip to content

Commit 161f028

Browse files
committed
[pyproject] modernize setup and install with pyproject.toml
1 parent 913af56 commit 161f028

File tree

2 files changed

+92
-0
lines changed

2 files changed

+92
-0
lines changed

pyproject.toml

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
# see also
2+
# https://packaging.python.org/en/latest/guides/modernize-setup-py-project/
3+
# https://xebia.com/blog/an-updated-guide-to-setuptools-and-pyproject-toml/
4+
# https://alpopkes.com/posts/python/packaging_tools/
5+
# https://dev.to/adamghill/python-package-manager-comparison-1g98
6+
#
7+
8+
[build-system]
9+
requires = [
10+
"setuptools >=79",
11+
# "setuptools-scm", # if we want to use git versions for versioning
12+
"wheel", # setuptools doesn't need wheel anymore, see https://pypi.org/project/wheel/
13+
]
14+
build-backend = "setuptools.build_meta"
15+
16+
[project]
17+
name = "comocma"
18+
description = "COMO-CMA-ES is the multiobjective Sofomore framework instantiated with the single-objective solver CMA-ES"
19+
authors = [
20+
{name = "Cheikh Toure"},
21+
{name = "Nikolaus Hansen"},
22+
]
23+
dependencies = [
24+
"numpy",
25+
"cma>=3",
26+
"moarchiving"
27+
]
28+
dynamic = ["version", # see tool.setuptools.dynamic below
29+
# "readme",
30+
]
31+
readme = "readme.md"
32+
license = "BSD-3-Clause"
33+
license-files = ["LICENSE"]
34+
35+
keywords = [
36+
"optimization",
37+
"COMO-CMA-ES",
38+
"Sofomore",
39+
"multi-objective",
40+
"CMA-ES",
41+
"cmaes",
42+
"evolution strategy"
43+
]
44+
maintainers = [
45+
{name = "Nikolaus Hansen", email = "authors_firstname.lastname@inria.fr"},
46+
]
47+
classifiers = [
48+
"Environment :: Console",
49+
"Framework :: IPython",
50+
"Framework :: Jupyter",
51+
"Intended Audience :: Science/Research",
52+
"Intended Audience :: Education",
53+
"Intended Audience :: Other Audience",
54+
"Topic :: Scientific/Engineering",
55+
"Topic :: Scientific/Engineering :: Mathematics",
56+
"Topic :: Scientific/Engineering :: Artificial Intelligence",
57+
"Operating System :: OS Independent",
58+
"Programming Language :: Python :: 2.7",
59+
"Programming Language :: Python :: 3",
60+
"Development Status :: 4 - Beta",
61+
]
62+
63+
[tool.setuptools]
64+
# packages = ["cma", "cma.utilities"] # fails when they are in an src/ folder
65+
include-package-data = false # true is default, false doesn't change anything
66+
67+
[tool.setuptools.packages.find] # for where=. works only in a clean folder
68+
# where = ["src"] # this doesn't work, it always takes the root too?
69+
include = ["comocma*"]
70+
exclude = ["comocma.*", "comocma-*"]
71+
72+
# namespaces = false
73+
74+
[project.optional-dependencies]
75+
plotting = ["matplotlib"]
76+
constrained-solution-tracking = ["moarchiving"]
77+
78+
[project.urls]
79+
Homepage = "https://github.com/CMA-ES/pycma"
80+
# Documentation = "" # API / notebooks / practical hints
81+
Repository = "https://github.com/CMA-ES/pycma.git"
82+
"Bug Tracker" = "https://github.com/CMA-ES/pycma/issues"
83+
84+
[tool.setuptools.dynamic]
85+
version = {attr = "comocma.como.__version__"} # any module attribute compatible with ast.literal_eval
86+
87+
# readme = {file = ["README.txt"]}
88+
# In the dynamic table, the attr directive [3] will read an attribute from the given module [4], while file will read the contents of all given files and concatenate them in a single string.
89+
90+
[tool.ruff.lint]
91+
ignore = ['F401', 'E402', 'E701', 'E722', ]
92+
# select = ["NPY201"]
File renamed without changes.

0 commit comments

Comments
 (0)