Skip to content

Commit

Permalink
MAINT use setuptools_scm (#81)
Browse files Browse the repository at this point in the history
  • Loading branch information
glemaitre authored May 1, 2024
1 parent d583456 commit 85a5969
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 11 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,6 @@ target/
.DS_Store
.AppleDouble
.LSOverride

# auto-generated files
skltemplate/_version.py
5 changes: 3 additions & 2 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@

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

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

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
Expand Down
2 changes: 1 addition & 1 deletion doc/quick_start.rst
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ Publish your package
====================

.. _PyPi: https://packaging.python.org/tutorials/packaging-projects/
.. _conda-foge: https://conda-forge.org/
.. _conda-forge: https://conda-forge.org/

You can make your package available through PyPi_ and conda-forge_. Refer to
the associated documentation to be able to upload your packages such that
Expand Down
2 changes: 1 addition & 1 deletion doc/user_guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ The use case is the following:

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

One can import the mixin class as::

Expand Down
30 changes: 28 additions & 2 deletions pixi.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 11 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
[build-system]
requires = ["setuptools>=64", "setuptools_scm[toml]>=8"]
build-backend = "setuptools.build_meta"

[project]
name = "skltemplate"
version = "0.1.0"
dynamic = ["version"]
authors = [
{ name="Vighnesh Birodkar", email="[email protected]" },
{ name="Guillaume Lemaitre", email="[email protected]" },
Expand Down Expand Up @@ -28,6 +32,9 @@ classifiers = [
Homepage = "https://github.com/scikit-learn-contrib/project-template"
Issues = "https://github.com/scikit-learn-contrib/project-template/issues"

[tool.setuptools_scm]
version_file = "skltemplate/_version.py"

[tool.pixi.project]
channels = ["conda-forge"]
platforms = ["win-64", "linux-64", "osx-64", "osx-arm64"]
Expand Down Expand Up @@ -60,6 +67,7 @@ test = { cmd = "pytest -vsl --cov=skltemplate --cov-report=xml skltemplate" }
matplotlib = "*"
numpydoc = "*"
pydata-sphinx-theme = "*"
setuptools-scm = ">=8" # needed for the versioning
sphinx = "*"
sphinx-gallery = "*"
sphinx-prompt = "*"
Expand All @@ -84,6 +92,7 @@ exclude = '''
| \.vscode
)/
'''
force-exclude = "skltemplate/_version.py"

[tool.ruff]
# max line length for black
Expand All @@ -96,6 +105,7 @@ exclude=[
"doc/_build",
"doc/auto_examples",
"build",
"skltemplate/_version.py",
]

[tool.ruff.lint]
Expand Down
4 changes: 0 additions & 4 deletions skltemplate/_version.py

This file was deleted.

0 comments on commit 85a5969

Please sign in to comment.