Skip to content

Commit

Permalink
MAINT use setuptools_scm
Browse files Browse the repository at this point in the history
  • Loading branch information
glemaitre committed May 1, 2024
1 parent d583456 commit c610690
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 10 deletions.
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.

9 changes: 8 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
[build-system]
requires = ["setuptools>=62", "setuptools_scm[toml]>=8.0"]

[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 +31,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 +66,7 @@ test = { cmd = "pytest -vsl --cov=skltemplate --cov-report=xml skltemplate" }
matplotlib = "*"
numpydoc = "*"
pydata-sphinx-theme = "*"
setuptools-scm = ">=8.0" # needed for the versioning
sphinx = "*"
sphinx-gallery = "*"
sphinx-prompt = "*"
Expand Down
18 changes: 15 additions & 3 deletions skltemplate/_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
# Authors: scikit-learn-contrib developers
# License: BSD 3 clause
# file generated by setuptools_scm
# don't change, don't track in version control
TYPE_CHECKING = False
if TYPE_CHECKING:
from typing import Tuple, Union
VERSION_TUPLE = Tuple[Union[int, str], ...]
else:
VERSION_TUPLE = object

__version__ = "0.1.0"
version: str
__version__: str
__version_tuple__: VERSION_TUPLE
version_tuple: VERSION_TUPLE

__version__ = version = '0.1.1.dev4+g0bfd40c.d20240501'
__version_tuple__ = version_tuple = (0, 1, 1, 'dev4', 'g0bfd40c.d20240501')

0 comments on commit c610690

Please sign in to comment.