Skip to content

Commit 1a9627c

Browse files
committed
Removed usage of info.py and fixed share/doc directory location
1 parent e952f2c commit 1a9627c

File tree

2 files changed

+9
-19
lines changed

2 files changed

+9
-19
lines changed

capsul/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
_doc_path = None
1515

1616
application_name = "capsul"
17-
organization_name = "populse"
17+
organization_name = "BrainVISA team"
18+
1819

1920
def _init_doc_path():
2021
global _doc_path

doc/source/conf.py

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,6 @@
3636

3737
# -- General configuration -----------------------------------------------------
3838

39-
# We load the release info into a dict by explicit execution
40-
release_info = {}
41-
finfo = os.path.join("..", "..", "capsul", "info.py")
42-
with open(finfo) as f:
43-
exec(compile(f.read(), finfo, "exec"), release_info)
44-
4539
# Add any Sphinx extension module names here, as strings. They can be extensions
4640
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
4741
try:
@@ -138,17 +132,16 @@ def null(*args, **kwargs):
138132

139133
# General information about the project.
140134
project = "CAPSUL"
141-
release_info["COPYRIGHT_YEAR"] = time.strftime("%Y")
142-
copyright = "%(COPYRIGHT_YEAR)s, %(AUTHOR)s <%(AUTHOR_EMAIL)s>" % release_info
135+
copyright = f"{time.strftime('%Y')}, {capsul.organization_name}"
143136

144137
# The version info for the project you're documenting, acts as replacement for
145138
# |version| and |release|, also used in various other places throughout the
146139
# built documents.
147140
#
148141
# The short X.Y version.
149-
version = release_info["__version__"]
142+
version = capsul.__version__
150143
# The full version, including alpha/beta/rc tags.
151-
release = version
144+
release = capsul.__release__
152145

153146
# The language for content autogenerated by Sphinx. Refer to documentation
154147
# for a list of supported languages.
@@ -323,17 +316,13 @@ def null(*args, **kwargs):
323316
somaworkflow_version = swver.shortVersion
324317
except ImportError:
325318
somaworkflow_version = "2.9"
326-
try:
327-
import soma.info
328319

329-
somabase_version = "%d.%d" % (soma.info.version_major, soma.info.version_minor)
330-
except ImportError:
331-
somabase_version = "4.6"
320+
import soma
332321

333322
pyversion = "%d.%d" % sys.version_info[:2]
334323

335324
extlinks = {
336-
#'somabase': ('https://brainvisa.info/soma-base-' + somabase_version + '/sphinx/%s',
325+
#'somabase': ('https://brainvisa.info/soma-base-' + soma.short_version + '/sphinx/%s',
337326
#'somabase '),
338327
#'somaworkflow': ('https://brainvisa.info/soma-workflow-' + somaworkflow_version + '/sphinx/%s',
339328
#'somaworkflow '),
@@ -345,14 +334,14 @@ def null(*args, **kwargs):
345334
# intersphinx_mapping = {'https://docs.python.org/': None}
346335

347336
docpath = os.path.join(
348-
os.path.dirname(os.path.dirname(os.path.dirname(soma.__file__))), "share", "doc"
337+
os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(soma.__path__[1])))), "share", "doc"
349338
)
350339

351340
intersphinx_mapping = {
352341
"somabase": (
353342
os.environ.get(
354343
"SOMABASE_INTERSPHINX_URL",
355-
os.path.join(docpath, "soma-base-" + somabase_version + "/sphinx"),
344+
os.path.join(docpath, "soma-base-" + soma.short_version + "/sphinx"),
356345
),
357346
None,
358347
),

0 commit comments

Comments
 (0)