Skip to content

Commit 59437f5

Browse files
committed
added scm
1 parent 332dc67 commit 59437f5

5 files changed

Lines changed: 36 additions & 6 deletions

File tree

.github/workflows/documentation.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ jobs:
2929
python-version: '3.11'
3030
- name: Install dependencies
3131
run: |
32+
python -m pip install --upgrade pip
3233
pip install -r docs/requirements.txt
34+
pip install -e .
3335
- name: Sphinx build
3436
run: |
3537
sphinx-build docs/source _build

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,3 +160,4 @@ cython_debug/
160160
.idea/
161161

162162
/docs/build/
163+
/dyson_equalizer/_version.py

docs/requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ intersphinx-registry
55
myst-parser
66
numpydoc
77
pydata-sphinx-theme
8+
flit_scm

docs/source/conf.py

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import numpy
22
import os
33
import sys
4+
from importlib.metadata import version
5+
46
sys.path.insert(0, os.path.abspath('..'))
57
sys.path.insert(0, os.path.abspath('../..'))
68

@@ -15,7 +17,11 @@
1517
project = 'Dyson Equalizer'
1618
copyright = '2024, Boris Landa, Francesco Strino, Yuval Kluger'
1719
author = 'Boris Landa, Francesco Strino, Yuval Kluger'
18-
release = '0.1.3'
20+
21+
# scm version (https://pypi.org/project/setuptools-scm/7.0.5/)
22+
release_scm = version('dyson-equalizer')
23+
release = '.'.join(release_scm.split('.')[:3])
24+
version = release
1925

2026
# -- General configuration ---------------------------------------------------
2127
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
@@ -44,12 +50,26 @@
4450

4551
html_context = {
4652
"default_mode": "light",
53+
"github_user": "KlugerLab",
54+
"github_repo": "DysonEqualizer",
55+
"github_version": "main",
56+
"doc_path": "docs",
4757
}
4858

4959
html_sidebars = {
50-
"examples": []
60+
"examples": []
5161
}
5262

63+
html_theme_options = {
64+
"icon_links": [
65+
{
66+
"name": "GitHub",
67+
"url": "https://github.com/KlugerLab/DysonEqualizer",
68+
"icon": "fa-brands fa-square-github",
69+
"type": "fontawesome",
70+
},
71+
],
72+
}
5373

5474
intersphinx_mapping = {
5575
'python': ('https://docs.python.org/3', None),

pyproject.toml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
[build-system]
2-
requires = ["flit_core >=3.2,<4"]
3-
build-backend = "flit_core.buildapi"
2+
requires = ["flit_core", "flit_scm"]
3+
build-backend = "flit_scm:buildapi"
44

55
[project]
66
name = "dyson-equalizer"
7-
version = "0.1.3"
7+
dynamic = ['version']
88
description = "Computes the Dyson Equalizer and related low rank approximation of the input data"
99
license = {file = "LICENSE"}
1010
readme = "README.md"
@@ -32,8 +32,14 @@ dependencies = [
3232
"numpy>=1.25",
3333
]
3434

35+
[tool.flit.sdist]
36+
exclude = [".gitignore"]
37+
38+
[tool.setuptools_scm]
39+
write_to = "dyson_equalizer/_version.py"
40+
3541
[project.optional-dependencies]
36-
dev = ["pytest", "twine"]
42+
dev = ["pytest", "flit_core", "flit_scm"]
3743

3844
[project.urls]
3945
Documentation = "https://github.com/KlugerLab/DysonEqualizer.git"

0 commit comments

Comments
 (0)