Skip to content

Commit

Permalink
added scm
Browse files Browse the repository at this point in the history
  • Loading branch information
fra-pcmgf committed Aug 9, 2024
1 parent 332dc67 commit 59437f5
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 6 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ jobs:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r docs/requirements.txt
pip install -e .
- name: Sphinx build
run: |
sphinx-build docs/source _build
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -160,3 +160,4 @@ cython_debug/
.idea/

/docs/build/
/dyson_equalizer/_version.py
1 change: 1 addition & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ intersphinx-registry
myst-parser
numpydoc
pydata-sphinx-theme
flit_scm
24 changes: 22 additions & 2 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import numpy
import os
import sys
from importlib.metadata import version

sys.path.insert(0, os.path.abspath('..'))
sys.path.insert(0, os.path.abspath('../..'))

Expand All @@ -15,7 +17,11 @@
project = 'Dyson Equalizer'
copyright = '2024, Boris Landa, Francesco Strino, Yuval Kluger'
author = 'Boris Landa, Francesco Strino, Yuval Kluger'
release = '0.1.3'

# scm version (https://pypi.org/project/setuptools-scm/7.0.5/)
release_scm = version('dyson-equalizer')
release = '.'.join(release_scm.split('.')[:3])
version = release

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

html_context = {
"default_mode": "light",
"github_user": "KlugerLab",
"github_repo": "DysonEqualizer",
"github_version": "main",
"doc_path": "docs",
}

html_sidebars = {
"examples": []
"examples": []
}

html_theme_options = {
"icon_links": [
{
"name": "GitHub",
"url": "https://github.com/KlugerLab/DysonEqualizer",
"icon": "fa-brands fa-square-github",
"type": "fontawesome",
},
],
}

intersphinx_mapping = {
'python': ('https://docs.python.org/3', None),
Expand Down
14 changes: 10 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[build-system]
requires = ["flit_core >=3.2,<4"]
build-backend = "flit_core.buildapi"
requires = ["flit_core", "flit_scm"]
build-backend = "flit_scm:buildapi"

[project]
name = "dyson-equalizer"
version = "0.1.3"
dynamic = ['version']
description = "Computes the Dyson Equalizer and related low rank approximation of the input data"
license = {file = "LICENSE"}
readme = "README.md"
Expand Down Expand Up @@ -32,8 +32,14 @@ dependencies = [
"numpy>=1.25",
]

[tool.flit.sdist]
exclude = [".gitignore"]

[tool.setuptools_scm]
write_to = "dyson_equalizer/_version.py"

[project.optional-dependencies]
dev = ["pytest", "twine"]
dev = ["pytest", "flit_core", "flit_scm"]

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

0 comments on commit 59437f5

Please sign in to comment.