Skip to content

Commit 83a58e0

Browse files
committed
Moved from setup.py to pyproject.toml. Added Pixi configuration too.
1 parent 1ac359d commit 83a58e0

File tree

5 files changed

+92
-162
lines changed

5 files changed

+92
-162
lines changed

capsul/__init__.py

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,28 @@
1-
from .info import __version__
1+
import importlib.metadata
2+
import re
3+
4+
try:
5+
__release__ = importlib.metadata.version("capsul")
6+
except importlib.metadata.PackageNotFoundError:
7+
__release__ = None
8+
9+
if __release__:
10+
__version__ = re.match(r"(\d+\.\d+\.\d+)[^.\d]*", __release__).group(1)
11+
else:
12+
__version__ = None
213

314
_doc_path = None
415

16+
application_name = "capsul"
17+
organization_name = "populse"
518

619
def _init_doc_path():
720
global _doc_path
821
import os
922

1023
import capsul
1124

12-
from .info import version_major, version_minor
25+
short_version = ".".join(__version__.split(".")[:2])
1326

1427
p = os.path.dirname(os.path.dirname(capsul.__file__))
1528
doc_path = os.path.join(p, "doc/build/html")
@@ -22,7 +35,7 @@ def _init_doc_path():
2235

2336
p2 = os.path.join(
2437
os.path.dirname(soma.config.BRAINVISA_SHARE),
25-
"doc/capsul-%d.%d" % (version_major, version_minor),
38+
f"doc/capsul-{short_version}",
2639
)
2740
if os.path.exists(p2):
2841
_doc_path = p2

capsul/info.py

Lines changed: 0 additions & 112 deletions
This file was deleted.

capsul/qt_gui/widgets/activation_inspector.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,7 @@ class ActivationInspectorApp(Application):
3737
"""
3838

3939
# Load some meta information
40-
from capsul.info import NAME as _application_name
41-
from capsul.info import ORGANISATION as _organisation_name
42-
from capsul.info import __version__ as _version
40+
from capsul import application_name, organisation_name, version
4341

4442
def __init__(self, pipeline_path, record_file=None, *args, **kwargs):
4543
"""Method to initialize the ActivationInspectorApp class.
@@ -65,9 +63,9 @@ def __init__(self, pipeline_path, record_file=None, *args, **kwargs):
6563
def init_window(self):
6664
"""Method to initialize the main window."""
6765
# First set some meta information
68-
self.setApplicationName(self._application_name)
69-
self.setOrganizationName(self._organisation_name)
70-
self.setApplicationVersion(self._version)
66+
self.setApplicationName(self.application_name)
67+
self.setOrganizationName(self.organisation_name)
68+
self.setApplicationVersion(self.version)
7169

7270
# Get the user interface description from capsul resources
7371
ui_file = os.path.join(os.path.dirname(__file__), "activation_inspector.ui")

pyproject.toml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
[project]
2+
name = "capsul"
3+
version = "3.0.0a1"
4+
authors = [
5+
{name = "Popolse Team", email = "contact@brainvisa.info"},
6+
]
7+
description = "CAPSUL is a powerful tool to define and share processing pipelines."
8+
readme = "README.md"
9+
requires-python = ">=3.10"
10+
license = {text = "CeCILL-B"}
11+
classifiers = [
12+
"License :: OSI Approved",
13+
"Development Status :: 5 - Production/Stable",
14+
"Environment :: Console",
15+
"Environment :: X11 Applications :: Qt",
16+
"Operating System :: OS Independent",
17+
"Programming Language :: Python",
18+
"Programming Language :: Python :: 3.11",
19+
"Programming Language :: Python :: 3.12",
20+
"Programming Language :: Python :: 3.13",
21+
"Programming Language :: SQL",
22+
"Natural Language :: English",
23+
"Topic :: Scientific/Engineering",
24+
"Topic :: Utilities",
25+
]
26+
27+
dependencies = [
28+
"soma-base ~=6.0.0a1",
29+
"graphviz",
30+
"PyQt5",
31+
"PyYAML",
32+
"nipype",
33+
]
34+
35+
[project.optional-dependencies]
36+
doc = [
37+
"sphinx >=1.0", "jupyter",
38+
]
39+
40+
[project.urls]
41+
homepage = "https://populse.github.io/soma-base/"
42+
repository = "https://github.com/populse/soma-base"
43+
44+
[build-system]
45+
requires = ["setuptools >= 61.0","setuptools-scm>=8.0"]
46+
build-backend = "setuptools.build_meta"
47+
48+
[tool.setuptools.packages.find]
49+
where = ["."]
50+
51+
[tool.brainvisa-cmake]
52+
test_commands = ["python -m capsul.test --verbose"]
53+
54+
[tool.pixi.workspace]
55+
channels = ["conda-forge"]
56+
platforms = ["linux-64"]
57+
58+
[tool.pixi.pypi-dependencies]
59+
capsul = { path = ".", editable = true, extras=["doc"] }
60+
build = "*"
61+
62+
[tool.pixi.environments]
63+
default = { solve-group = "default" }
64+
doc = { features = ["doc"], solve-group = "default" }
65+
66+
[tool.pixi.tasks]
67+
68+
[tool.pixi.dependencies]
69+
python="*"
70+
pip = "*"
71+
pytest = "*"
72+
twine = "*"

setup.py

Lines changed: 0 additions & 41 deletions
This file was deleted.

0 commit comments

Comments
 (0)