diff --git a/.gitignore b/.gitignore index 7bb2b81..69e8d8a 100644 --- a/.gitignore +++ b/.gitignore @@ -73,3 +73,6 @@ target/ .DS_Store .AppleDouble .LSOverride + +# auto-generated files +skltemplate/_version.py \ No newline at end of file diff --git a/doc/conf.py b/doc/conf.py index 4ca8838..d9f5655 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -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 diff --git a/doc/quick_start.rst b/doc/quick_start.rst index fc862c9..ca169c5 100644 --- a/doc/quick_start.rst +++ b/doc/quick_start.rst @@ -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 diff --git a/doc/user_guide.rst b/doc/user_guide.rst index c73d8eb..527d4c6 100644 --- a/doc/user_guide.rst +++ b/doc/user_guide.rst @@ -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:: diff --git a/pixi.lock b/pixi.lock index 8916bb2..d823524 100644 --- a/pixi.lock +++ b/pixi.lock @@ -280,6 +280,7 @@ environments: - conda: https://conda.anaconda.org/conda-forge/linux-64/scikit-learn-1.4.2-py312h394d371_0.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/scipy-1.13.0-py312heda63a1_0.conda - conda: https://conda.anaconda.org/conda-forge/noarch/setuptools-69.5.1-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/setuptools-scm-8.0.4-pyhd8ed1ab_1.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/sip-6.7.12-py312h30efb56_0.conda - conda: https://conda.anaconda.org/conda-forge/noarch/six-1.16.0-pyh6c4a22f_0.tar.bz2 - conda: https://conda.anaconda.org/conda-forge/noarch/snowballstemmer-2.2.0-pyhd8ed1ab_0.tar.bz2 @@ -398,6 +399,7 @@ environments: - conda: https://conda.anaconda.org/conda-forge/osx-64/scikit-learn-1.4.2-py312h7167a34_0.conda - conda: https://conda.anaconda.org/conda-forge/osx-64/scipy-1.13.0-py312h8adb940_0.conda - conda: https://conda.anaconda.org/conda-forge/noarch/setuptools-69.5.1-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/setuptools-scm-8.0.4-pyhd8ed1ab_1.conda - conda: https://conda.anaconda.org/conda-forge/noarch/six-1.16.0-pyh6c4a22f_0.tar.bz2 - conda: https://conda.anaconda.org/conda-forge/noarch/snowballstemmer-2.2.0-pyhd8ed1ab_0.tar.bz2 - conda: https://conda.anaconda.org/conda-forge/noarch/soupsieve-2.5-pyhd8ed1ab_1.conda @@ -497,6 +499,7 @@ environments: - conda: https://conda.anaconda.org/conda-forge/osx-arm64/scikit-learn-1.4.2-py312hd4306f4_0.conda - conda: https://conda.anaconda.org/conda-forge/osx-arm64/scipy-1.13.0-py312h9d7df2b_0.conda - conda: https://conda.anaconda.org/conda-forge/noarch/setuptools-69.5.1-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/setuptools-scm-8.0.4-pyhd8ed1ab_1.conda - conda: https://conda.anaconda.org/conda-forge/noarch/six-1.16.0-pyh6c4a22f_0.tar.bz2 - conda: https://conda.anaconda.org/conda-forge/noarch/snowballstemmer-2.2.0-pyhd8ed1ab_0.tar.bz2 - conda: https://conda.anaconda.org/conda-forge/noarch/soupsieve-2.5-pyhd8ed1ab_1.conda @@ -624,6 +627,7 @@ environments: - conda: https://conda.anaconda.org/conda-forge/win-64/scikit-learn-1.4.2-py312hcacafb1_0.conda - conda: https://conda.anaconda.org/conda-forge/win-64/scipy-1.13.0-py312h8753938_0.conda - conda: https://conda.anaconda.org/conda-forge/noarch/setuptools-69.5.1-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/setuptools-scm-8.0.4-pyhd8ed1ab_1.conda - conda: https://conda.anaconda.org/conda-forge/win-64/sip-6.7.12-py312h53d5487_0.conda - conda: https://conda.anaconda.org/conda-forge/noarch/six-1.16.0-pyh6c4a22f_0.tar.bz2 - conda: https://conda.anaconda.org/conda-forge/noarch/snowballstemmer-2.2.0-pyhd8ed1ab_0.tar.bz2 @@ -7342,6 +7346,28 @@ packages: - pkg:pypi/setuptools size: 501790 timestamp: 1713094963112 +- kind: conda + name: setuptools-scm + version: 8.0.4 + build: pyhd8ed1ab_1 + build_number: 1 + subdir: noarch + noarch: python + url: https://conda.anaconda.org/conda-forge/noarch/setuptools-scm-8.0.4-pyhd8ed1ab_1.conda + sha256: 5b0ae59e7580f8a5acc07a8390181ed63e5fdf891b9100186fee9e864bbf390c + md5: a1986ad21c766ff22f7bae93f0641020 + depends: + - packaging >=20.0 + - python >=3.8 + - setuptools >=45 + - tomli >=1.0.0 + - typing-extensions + license: MIT + license_family: MIT + purls: + - pkg:pypi/setuptools-scm + size: 36626 + timestamp: 1711030572641 - kind: conda name: sip version: 6.7.12 @@ -7406,9 +7432,9 @@ packages: timestamp: 1620240338595 - kind: pypi name: skltemplate - version: 0.1.0 + version: 0.1.1.dev7+g74ad88d path: . - sha256: 8d79263a5061925287bc2e6e2a694b6dd5d144990c0f1aabbd0ac68949fc47f4 + sha256: 83da9479016c85c52f79d636215d65781720cec119b8312538870e422e82b47a requires_dist: - scikit-learn>=1.4.2 requires_python: '>=3.9' diff --git a/pyproject.toml b/pyproject.toml index 50025ee..a26c652 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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="vighneshbirodkar@nyu.edu" }, { name="Guillaume Lemaitre", email="g.lemaitre58@gmail.com" }, @@ -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"] @@ -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 = "*" @@ -84,6 +92,7 @@ exclude = ''' | \.vscode )/ ''' +force-exclude = "skltemplate/_version.py" [tool.ruff] # max line length for black @@ -96,6 +105,7 @@ exclude=[ "doc/_build", "doc/auto_examples", "build", + "skltemplate/_version.py", ] [tool.ruff.lint] diff --git a/skltemplate/_version.py b/skltemplate/_version.py deleted file mode 100644 index 375d663..0000000 --- a/skltemplate/_version.py +++ /dev/null @@ -1,4 +0,0 @@ -# Authors: scikit-learn-contrib developers -# License: BSD 3 clause - -__version__ = "0.1.0"