Skip to content

Commit 1932c37

Browse files
committed
Switch to pyproject.toml for installation, requires Python 3.8+
1 parent 9893f5e commit 1932c37

File tree

7 files changed

+80
-118
lines changed

7 files changed

+80
-118
lines changed

.github/workflows/python_testing.yml

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,18 @@ jobs:
1010
fail-fast: false
1111
matrix:
1212
os: [ubuntu-latest, macos-latest, windows-latest]
13-
python-version: ["2.7", "3.6", "3.7", "3.8", "3.9"]
13+
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
1414

1515
steps:
16-
- uses: actions/checkout@v2
16+
- uses: actions/checkout@v4
1717
- name: Set up Python ${{ matrix.python-version }}
18-
uses: actions/setup-python@v2
18+
uses: actions/setup-python@v5
1919
with:
2020
python-version: ${{ matrix.python-version }}
2121
- name: Install dependencies
2222
run: |
23-
python -m pip install --upgrade pip
24-
python -m pip install nose
25-
pip install -r requirements.txt
26-
- name: Build package
27-
run: |
28-
python setup.py build
23+
python -m pip install .
24+
pip install pytest
2925
- name: Run unit tests
3026
run: |
31-
nosetests -v
27+
python -m pytest --pyargs dfols

dfols/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@
3838
# Ensure compatibility with Python 2
3939
from __future__ import absolute_import, division, print_function, unicode_literals
4040

41-
from .version import __version__
42-
__all__ = ['__version__']
41+
# DFO-LS version
42+
__version__ = '1.4.0'
4343

4444
# Main solver & exit flags
4545
from .solver import *
46-
__all__ += ['solve']
46+
__all__ = ['solve']
4747

dfols/version.py

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

docs/conf.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,12 @@
1818
# documentation root, use os.path.abspath to make it absolute, like shown here.
1919
#
2020
import os
21-
import sys
22-
sys.path.insert(0, '../dfols/')
23-
from version import __version__
21+
import datetime
22+
import dfols
23+
24+
current_year = datetime.date.today().year # used for copyright information
25+
dfols_version = dfols.__version__
26+
2427

2528
# -- General configuration ------------------------------------------------
2629

@@ -47,17 +50,17 @@
4750

4851
# General information about the project.
4952
project = 'DFO-LS'
50-
copyright = '2017, Lindon Roberts'
53+
copyright = '2017-%g, Lindon Roberts' % current_year
5154
author = 'Lindon Roberts'
5255

5356
# The version info for the project you're documenting, acts as replacement for
5457
# |version| and |release|, also used in various other places throughout the
5558
# built documents.
5659
#
5760
# The short X.Y version.
58-
version = __version__
61+
version = dfols_version
5962
# The full version, including alpha/beta/rc tags.
60-
release = __version__
63+
release = dfols_version
6164

6265
# The language for content autogenerated by Sphinx. Refer to documentation
6366
# for a list of supported languages.
@@ -94,7 +97,7 @@
9497

9598
# The name for this set of Sphinx documents. If None, it defaults to
9699
# "<project> v<release> documentation".
97-
html_title = 'DFO-LS v%s documentation' % __version__
100+
html_title = 'DFO-LS v%s documentation' % dfols_version
98101

99102
# Theme options are theme-specific and customize the look and feel of a theme
100103
# further. For a list of options available for each theme, see the

pyproject.toml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
[build-system]
2+
requires = ["setuptools >= 61.0"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
name = "DFO-LS"
7+
dynamic = ["version"]
8+
dependencies = [
9+
"setuptools",
10+
"numpy",
11+
"scipy>=1.11",
12+
"pandas"
13+
]
14+
requires-python = ">=3.8"
15+
authors = [
16+
{name = "Lindon Roberts", email = "[email protected]"}
17+
]
18+
maintainers = [
19+
{name = "Lindon Roberts", email = "[email protected]"}
20+
]
21+
description = "A flexible derivative-free solver for (bound constrained) nonlinear least-squares minimization"
22+
readme = "README.rst"
23+
license = {text = "GPL-3.0-or-later"}
24+
keywords = ["mathematics", "optimization", "least squares", "derivative free optimization", "nonlinear least squares"]
25+
classifiers = [
26+
"Development Status :: 5 - Production/Stable",
27+
"Environment :: Console",
28+
"Framework :: IPython",
29+
"Framework :: Jupyter",
30+
"Intended Audience :: Science/Research",
31+
"License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)",
32+
"Operating System :: MacOS",
33+
"Operating System :: Microsoft :: Windows",
34+
"Operating System :: Unix",
35+
"Programming Language :: Python",
36+
"Programming Language :: Python :: 3",
37+
"Programming Language :: Python :: 3.8",
38+
"Programming Language :: Python :: 3.9",
39+
"Programming Language :: Python :: 3.10",
40+
"Programming Language :: Python :: 3.11",
41+
"Programming Language :: Python :: 3.12",
42+
"Topic :: Scientific/Engineering",
43+
"Topic :: Scientific/Engineering :: Mathematics"
44+
]
45+
46+
[project.optional-dependencies]
47+
dev = ["pytest", "Sphinx", "sphinx-rtd-theme"]
48+
trustregion = ["trustregion>=1.1"]
49+
50+
[project.urls]
51+
Homepage = "https://github.com/numericalalgorithmsgroup/dfols"
52+
Download = "https://github.com/numericalalgorithmsgroup/dfols/releases/"
53+
"Bug Tracker" = "https://github.com/numericalalgorithmsgroup/dfols/issues/"
54+
Documentation = "https://numericalalgorithmsgroup.github.io/dfols/"
55+
"Source Code" = "https://github.com/numericalalgorithmsgroup/dfols"
56+
57+
[tool.setuptools]
58+
packages = ["dfols"]
59+
60+
[tool.setuptools.dynamic]
61+
version = {attr = "dfols.__version__"}

requirements.txt

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

setup.py

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

0 commit comments

Comments
 (0)