File tree Expand file tree Collapse file tree 6 files changed +47
-11
lines changed
Expand file tree Collapse file tree 6 files changed +47
-11
lines changed Original file line number Diff line number Diff line change 99project = 'psyflow'
1010copyright = '2025, Zhipeng Cao'
1111author = 'Zhipeng Cao'
12- release = '0.1.0'
12+ import os
13+ import sys
14+ sys .path .insert (0 , os .path .abspath (".." )) # so Sphinx can find your package
15+ from psyflow ._version import read_version
16+ release = read_version ()
1317
1418# -- General configuration ---------------------------------------------------
1519# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
2731html_theme = 'alabaster'
2832html_static_path = ['_static' ]
2933
30-
31- import os
32- import sys
33- sys .path .insert (0 , os .path .abspath (".." )) # so Sphinx can find your package
34-
3534# Enable extensions
3635extensions = [
3736 "myst_parser" , # Markdown support
Original file line number Diff line number Diff line change @@ -35,6 +35,12 @@ Start with one of the tutorials below or explore the API reference.
3535
3636 modules
3737
38+ .. toctree ::
39+ :maxdepth: 1
40+ :caption: Development
41+
42+ release
43+
3844
3945Indices and tables
4046==================
Original file line number Diff line number Diff line change 1+ # Release workflow
2+
3+ 1 . Update the version number in ` pyproject.toml ` under the ` [project] ` section.
4+ 2 . Commit the change with a message that includes ` [publish] ` to trigger the release pipeline.
5+ 3 . Build and upload the package as usual.
Original file line number Diff line number Diff line change 1- """
2- psyflow: A utility package for modular PsychoPy experiment development
3- """
4- __version__ = "0.1.0"
1+ """psyflow: A utility package for modular PsychoPy experiment development."""
2+
3+ from ._version import __version__
54from .BlockUnit import BlockUnit
65from .StimBank import StimBank
76from .SubInfo import SubInfo
Original file line number Diff line number Diff line change 1+ from __future__ import annotations
2+ from pathlib import Path
3+ import re
4+
5+
6+ def read_version () -> str :
7+ """Return project version from pyproject.toml."""
8+ root = Path (__file__ ).resolve ().parent .parent
9+ pyproject = root / "pyproject.toml"
10+ text = pyproject .read_text ()
11+ match = re .search (r'^version\s*=\s*"([^"]+)"' , text , re .MULTILINE )
12+ if not match :
13+ raise RuntimeError ("Version not found in pyproject.toml" )
14+ return match .group (1 )
15+
16+
17+ __version__ = read_version ()
Original file line number Diff line number Diff line change 1+ from pathlib import Path
2+ import re
13from setuptools import setup , find_packages
24
5+
6+ def read_version () -> str :
7+ text = Path (__file__ ).with_name ("pyproject.toml" ).read_text ()
8+ match = re .search (r'^version\s*=\s*"([^"]+)"' , text , re .MULTILINE )
9+ if not match :
10+ raise RuntimeError ("Version not found in pyproject.toml" )
11+ return match .group (1 )
12+
313setup (
414 name = "psyflow" ,
5- version = "0.1.0" ,
15+ version = read_version () ,
616 description = "A utility package for building modular PsychoPy experiments." ,
717 author = "Zhipeng Cao" ,
818
You can’t perform that action at this time.
0 commit comments