Skip to content

Commit 035ad65

Browse files
authored
MNT - switch to pyproject.toml to setup the package (scikit-learn-contrib#201)
1 parent 5309fd9 commit 035ad65

File tree

8 files changed

+71
-61
lines changed

8 files changed

+71
-61
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ jobs:
4141
name: Get Python running
4242
command: |
4343
python -m pip install --user --upgrade --progress-bar off pip
44-
python -m pip install --user --upgrade --progress-bar off -r doc/doc-requirements.txt
4544
python -m pip install --user -e .
45+
python -m pip install --user .[doc]
4646
4747
- save_cache:
4848
key: pip-cache

.github/workflows/main.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,14 @@ jobs:
1717
uses: actions/setup-python@v3
1818
with:
1919
python-version: 3.8
20-
- name: Install dependencies
20+
- name: Install package and testing tools
2121
run: |
2222
python -m pip install --upgrade pip
23-
pip install celer
24-
pip install pytest
25-
pip install numpydoc
2623
pip install .
24+
pip install .[test]
25+
- name: Install other dependencies
26+
run: |
27+
pip install celer
2728
pip install statsmodels cvxopt
2829
pip install git+https://github.com/jolars/pyslope.git
2930
# for testing Cox estimator

doc/conf.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,18 @@
1515
import os
1616
import sys
1717
import warnings
18-
# import os
18+
1919
import sphinx_gallery # noqa
20-
import sphinx_bootstrap_theme
20+
import sphinx_bootstrap_theme # noqa
2121
from numpydoc import numpydoc, docscrape # noqa
22-
from doc.github_link import make_linkcode_resolve
2322

2423
from skglm import __version__ as version
2524

26-
curdir = os.path.dirname(__file__)
27-
sys.path.append(os.path.abspath(os.path.join(curdir, 'sphinxext')))
25+
# include custom extension
26+
curdir = os.path.dirname(__file__) # noqa
27+
sys.path.append(os.path.abspath(os.path.join(curdir, 'sphinxext'))) # noqa
28+
29+
from github_link import make_linkcode_resolve
2830

2931

3032
# Mathurin: disable agg warnings in doc

doc/contribute.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Your contribution is welcome and highly valuable. It can be
1919
You can use the `the issue section <https://github.com/scikit-learn-contrib/skglm/issues>`_ to make suggestions.
2020

2121
**pull request**
22-
you may have fixed a bug, added a feature, or even fixed a small typo in the documentation, ...
22+
you may have fixed a bug, added a feature, or even fixed a small typo in the documentation, ...
2323
You can submit a `pull request <https://github.com/scikit-learn-contrib/skglm/pulls>`_
2424
to integrate your changes and we will reach out to you shortly.
2525

@@ -56,5 +56,5 @@ contribute with code or documentation.
5656
.. code-block:: shell
5757
5858
$ cd doc
59-
$ pip install -r doc-requirements.txt
59+
$ pip install .[doc]
6060
$ make html

doc/doc-requirements.txt

Lines changed: 0 additions & 12 deletions
This file was deleted.
File renamed without changes.

pyproject.toml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
[build-system]
2+
requires = ["setuptools"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
name = "skglm"
7+
description = "A fast and modular scikit-learn replacement for generalized linear models"
8+
authors = [
9+
{name = "Mathurin Massias", email = "[email protected]"},
10+
{name = "Badr Moufad", email = "[email protected]"},
11+
{name = "Pierre-Antoine Bannier", email = "[email protected]"},
12+
{name = "Quentin Bertrand", email = "[email protected]"},
13+
{name = "Quentin Klopfenstein", email = "[email protected]"}
14+
]
15+
license = {text = "BSD (3-Clause)"}
16+
readme = {file = "README.md", content-type = "text/markdown"}
17+
dependencies = [
18+
"numpy>=1.12",
19+
"numba",
20+
"scikit-learn>=1.0",
21+
"scipy>=0.18.0",
22+
]
23+
dynamic = ["version"]
24+
25+
26+
[tool.setuptools.dynamic]
27+
version = {attr = "skglm.__version__"}
28+
29+
30+
[project.urls]
31+
Homepage = "https://contrib.scikit-learn.org/skglm"
32+
Source = "https://github.com/scikit-learn-contrib/skglm.git"
33+
34+
35+
[project.optional-dependencies]
36+
test = [
37+
"pytest",
38+
"flake8",
39+
"coverage",
40+
"numpydoc",
41+
]
42+
43+
doc = [
44+
"benchopt",
45+
"libsvmdata>=0.2",
46+
"matplotlib>=2.0.0",
47+
"myst_parser",
48+
"numpydoc",
49+
"pillow",
50+
"sphinx-bootstrap-theme",
51+
"sphinx_copybutton",
52+
"sphinx-gallery",
53+
"pytest",
54+
"furo",
55+
"lifelines",
56+
]

setup.py

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

0 commit comments

Comments
 (0)