Skip to content

Commit 85a5969

Browse files
authored
MAINT use setuptools_scm (#81)
1 parent d583456 commit 85a5969

File tree

7 files changed

+47
-11
lines changed

7 files changed

+47
-11
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,3 +73,6 @@ target/
7373
.DS_Store
7474
.AppleDouble
7575
.LSOverride
76+
77+
# auto-generated files
78+
skltemplate/_version.py

doc/conf.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,13 @@
88

99
# -- Project information -----------------------------------------------------
1010
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
11-
from skltemplate import __version__
11+
from importlib.metadata import version as get_version
1212

1313
project = "Scikit-learn Project Template"
1414
copyright = "2016, V. Birodkar"
1515
author = "V. Birodkar"
16-
release = __version__
16+
release = get_version('skltemplate')
17+
version = ".".join(release.split(".")[:3])
1718

1819
# -- General configuration ---------------------------------------------------
1920
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration

doc/quick_start.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ Publish your package
148148
====================
149149

150150
.. _PyPi: https://packaging.python.org/tutorials/packaging-projects/
151-
.. _conda-foge: https://conda-forge.org/
151+
.. _conda-forge: https://conda-forge.org/
152152

153153
You can make your package available through PyPi_ and conda-forge_. Refer to
154154
the associated documentation to be able to upload your packages such that

doc/user_guide.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ The use case is the following:
3535

3636
In addition, scikit-learn provides a
3737
mixin_, i.e. :class:`sklearn.base.TransformerMixin`, which
38-
implement the combination of ``fit`` and ``transform`` called ``fit_transform``::
38+
implement the combination of ``fit`` and ``transform`` called ``fit_transform``.
3939

4040
One can import the mixin class as::
4141

pixi.lock

Lines changed: 28 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
1+
[build-system]
2+
requires = ["setuptools>=64", "setuptools_scm[toml]>=8"]
3+
build-backend = "setuptools.build_meta"
4+
15
[project]
26
name = "skltemplate"
3-
version = "0.1.0"
7+
dynamic = ["version"]
48
authors = [
59
{ name="Vighnesh Birodkar", email="vighneshbirodkar@nyu.edu" },
610
{ name="Guillaume Lemaitre", email="g.lemaitre58@gmail.com" },
@@ -28,6 +32,9 @@ classifiers = [
2832
Homepage = "https://github.com/scikit-learn-contrib/project-template"
2933
Issues = "https://github.com/scikit-learn-contrib/project-template/issues"
3034

35+
[tool.setuptools_scm]
36+
version_file = "skltemplate/_version.py"
37+
3138
[tool.pixi.project]
3239
channels = ["conda-forge"]
3340
platforms = ["win-64", "linux-64", "osx-64", "osx-arm64"]
@@ -60,6 +67,7 @@ test = { cmd = "pytest -vsl --cov=skltemplate --cov-report=xml skltemplate" }
6067
matplotlib = "*"
6168
numpydoc = "*"
6269
pydata-sphinx-theme = "*"
70+
setuptools-scm = ">=8" # needed for the versioning
6371
sphinx = "*"
6472
sphinx-gallery = "*"
6573
sphinx-prompt = "*"
@@ -84,6 +92,7 @@ exclude = '''
8492
| \.vscode
8593
)/
8694
'''
95+
force-exclude = "skltemplate/_version.py"
8796

8897
[tool.ruff]
8998
# max line length for black
@@ -96,6 +105,7 @@ exclude=[
96105
"doc/_build",
97106
"doc/auto_examples",
98107
"build",
108+
"skltemplate/_version.py",
99109
]
100110

101111
[tool.ruff.lint]

skltemplate/_version.py

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

0 commit comments

Comments
 (0)