Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add pyproject.toml, with pixi as project management tool. add pixi.lock #1459

Merged
merged 13 commits into from
Jan 2, 2025
Merged
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
12 changes: 0 additions & 12 deletions .black

This file was deleted.

3 changes: 0 additions & 3 deletions .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,3 @@ per-file-ignores =
libensemble/tests/functionality_tests/test_active_persistent_worker_abort.py:E402
libensemble/tests/unit_tests/test_persistent_aposmm.py:E402
libensemble/tests/unit_tests/RENAME_test_persistent_aposmm.py:E402

# Allow undefined name '__version__'
setup.py:F821
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,4 @@ dist/
.spyproject/

.hypothesis
.pixi
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v5.0.0
hooks:
- id: end-of-file-fixer
exclude: ^(.*\.xml|.*\.svg)$
- id: trailing-whitespace
exclude: ^(.*\.xml|.*\.svg)$

- repo: https://github.com/pycqa/isort
rev: 5.12.0
rev: 5.13.2
hooks:
- id: isort
args: [--profile=black, --line-length=120]

- repo: https://github.com/psf/black
rev: 22.12.0
rev: 24.10.0
hooks:
- id: black
args: [--line-length=120]

- repo: https://github.com/PyCQA/flake8
rev: 6.0.0
rev: 7.1.1
hooks:
- id: flake8
args: [--max-line-length=120]

- repo: https://github.com/asottile/blacken-docs
rev: v1.12.1
rev: 1.19.1
hooks:
- id: blacken-docs
additional_dependencies: [black==22.12.0]
Expand Down
21 changes: 0 additions & 21 deletions .typos.toml

This file was deleted.

1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
include pyproject.toml
include setup.py
include *.cfg
include *.rst
Expand Down
2 changes: 1 addition & 1 deletion docs/dev_guide/release_management/release_process.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Before release
- Year in ``LICENSE`` is checked for correctness.
(Note: The year generated in docs by ``docs/conf.py`` should be automatic).

- ``setup.py`` and ``libensemble/__init__.py`` are checked to ensure all
- ``pyproject.toml`` and ``libensemble/__init__.py`` are checked to ensure all
information is up to date.

- Update ``.wci.yml`` in root directory (version, date and any other
Expand Down
131 changes: 131 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
[project]

authors = [{name = "Jeffrey Larson"}, {name = "Stephen Hudson"},
{name = "Stefan M. Wild"}, {name = "David Bindel"},
{name = "John-Luke Navarro"}]

dependencies = ["numpy", "psutil", "pydantic", "pyyaml", "tomli"]

description = "A Python toolkit for coordinating asynchronous and dynamic ensembles of calculations."
name = "libensemble"
requires-python = ">=3.9"
license = {file = "LICENSE"}
readme = "README.rst"

classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: BSD License",
"Natural Language :: English",
"Operating System :: POSIX :: Linux",
"Operating System :: Unix",
"Operating System :: MacOS",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now support Python 3.13 - make sure any updates to setup.py are put in here.

"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: Implementation :: CPython",
"Topic :: Scientific/Engineering",
"Topic :: Software Development :: Libraries :: Python Modules",
]
version = "1.4.3+dev"

[project.urls]
Documentation = "https://libensemble.readthedocs.io/en/main/"
Repository = "https://github.com/Libensemble/libensemble"
Issues = "https://github.com/Libensemble/libensemble/issues"

[build-system]
build-backend = "setuptools.build_meta"
requires = ["setuptools", "wheel", "pip>=24.3.1,<25", "setuptools>=75.1.0,<76", ]

[tool.setuptools.packages.find]
where = ["."]
include = ["libensemble*"]

[tool.pixi.project]
channels = ["conda-forge"]
platforms = ["osx-arm64", "linux-64", "osx-64"]

[tool.pixi.pypi-dependencies]
libensemble = { path = ".", editable = true }

[tool.pixi.environments]
default = []
dev = ["dev"]

[tool.pixi.feature.dev.dependencies]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thinking lower bounds should be based on what we support. Or if we want to be latest, maybe make a comment to that effect.

mpi = ">=1.0.1,<2"
mpich = ">=4.2.3,<5"
mpi4py = ">=4.0.1,<5"
flake8 = ">=7.1.1,<8"
coverage = ">=7.6.4,<8"
pytest = ">=8.3.3,<9"
pytest-cov = ">=5.0.0,<6"
pytest-timeout = ">=2.3.1,<3"
mock = ">=5.1.0,<6"
python-dateutil = ">=2.9.0,<3"
anyio = ">=4.6.2.post1,<5"
matplotlib = ">=3.9.2,<4"
mpmath = ">=1.3.0,<2"
rich = ">=13.9.3,<14"
sphinx = ">=8.1.3,<9"
sphinxcontrib-bibtex = ">=2.6.3,<3"
sphinxcontrib-spelling = ">=4.3.0,<5"
sphinx-design = ">=0.6.1,<0.7"
sphinx_rtd_theme = ">=3.0.1,<4"
sphinx-copybutton = ">=0.5.2,<0.6"
pre-commit = ">=4.0.1,<5"
nlopt = ">=2.8.0,<3"
scipy = ">=1.9.1,<2"

[tool.pixi.dependencies]
python = ">=3.9,<3.14"
pip = ">=24.3.1,<25"
setuptools = ">=75.1.0,<76"
numpy = ">=1.21,<3"
pydantic = ">=1.10,<3"
pyyaml = ">=6.0,<7"
tomli = ">=1.2.1,<3"
psutil = ">=5.9.4,<7"

[tool.pixi.target.osx-arm64.dependencies]
clang_osx-arm64 = ">=19.1.2,<20"

[tool.black]
line-length = 120
target-version = ['py39', 'py310', 'py311', 'py312', 'py313']
force-exclude = '''
(
/(
| \.git
| \.github
)/
| libensemble/files/to/avoid
)
'''

[tool.typos.default]
extend-ignore-identifiers-re = [
".*NDArray.*",
"8ba9de56.*"
]

[tool.typos.default.extend-words]
als = "als"
datas = "datas"
numer = "numer"
inout = "inout"
arange = "arange"
wrk = "wrk"
EOF = "EOF"
HPE = "HPE"
RO = "RO"
lst = "lst"
noy = "noy"

[tool.typos.files]
extend-exclude = ["*.bib", "*.xml", "docs/nitpicky"]
114 changes: 1 addition & 113 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,115 +1,3 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# This is for setting up libEnsemble, license and details can be
# found at https://github.com/Libensemble/libensemble/

"""libEnsemble

libEnsemble is a Python toolkit for coordinating workflows of asynchronous
and dynamic ensembles of calculations.

libEnsemble can help users take advantage of massively parallel resources to
solve design, decision, and inference problems and expand the class of
problems that can benefit from increased parallelism.

"""

from pathlib import Path

from setuptools import setup
from setuptools.command.test import test as TestCommand

exec(open("libensemble/version.py").read())


class Run_TestSuite(TestCommand):
def run_tests(self):
import os
import sys

py_version = sys.version_info[0]
print("Python version from setup.py is", py_version)
run_string = "libensemble/tests/run-tests.sh -p " + str(py_version)
os.system(run_string)


class ToxTest(TestCommand):
user_options = []

def initialize_options(self):
TestCommand.initialize_options(self)

def run_tests(self):
import tox

tox.cmdline()


setup(
name="libensemble",
version=__version__,
description="Library to coordinate the concurrent evaluation of dynamic ensembles of calculations",
long_description=Path("README.rst").read_text(encoding="utf-8"),
url="https://github.com/Libensemble/libensemble",
author="Jeffrey Larson, Stephen Hudson, Stefan M. Wild, David Bindel and John-Luke Navarro",
author_email="libensemble@lists.mcs.anl.gov",
license="BSD 3-clause",
packages=[
"libensemble",
"libensemble.gen_funcs",
"libensemble.sim_funcs",
"libensemble.sim_funcs.branin",
"libensemble.alloc_funcs",
"libensemble.tests",
"libensemble.comms",
"libensemble.utils",
"libensemble.tools",
"libensemble.tools.live_data",
"libensemble.executors",
"libensemble.resources",
"libensemble.tests.unit_tests",
"libensemble.tests.regression_tests",
],
install_requires=["numpy>=1.21", "psutil>=5.9.4", "pydantic>=1.10", "tomli>=1.2.1", "pyyaml>=6.0"],
# numpy - oldest working version. psutil - oldest working version.
# pyyaml - oldest working version.
# If run tests through setup.py - downloads these but does not install
tests_require=[
"pytest>=3.1",
"pytest-cov>=2.5",
"pytest-pep8>=1.0",
"pytest-timeout",
"mock",
],
extras_require={
"docs": [
"autodoc_pydantic",
"sphinx<9",
"sphinx_design",
"sphinx_rtd_theme",
"sphinxcontrib-bibtex",
"sphinxcontrib-spelling",
"sphinx-copybutton",
],
},
classifiers=[
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: BSD License",
"Natural Language :: English",
"Operating System :: POSIX :: Linux",
"Operating System :: Unix",
"Operating System :: MacOS",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: Implementation :: CPython",
"Topic :: Scientific/Engineering",
"Topic :: Software Development :: Libraries :: Python Modules",
],
cmdclass={"test": Run_TestSuite, "tox": ToxTest},
)
setup()
Loading