Skip to content

Commit

Permalink
Create dependency group for gui and server
Browse files Browse the repository at this point in the history
  • Loading branch information
anxuae committed Nov 2, 2024
1 parent 5a9124c commit 8973875
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 12 deletions.
15 changes: 11 additions & 4 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Dependencies

* Python >= 3.8 (mandatory)
* PyYaml >= 5.0 (mandatory)
* WxPython >= 4.0 (optional: used for `standelone` mode)
* WxPython >= 4.0 (optional: used for `gui` mode)
* fastapi >= 0.111.1 (optional: used for `server` mode)


Expand All @@ -59,21 +59,28 @@ Download the binaries corresponding to your operating system from the page
Or install from the source downloaded on Github ::

$ pip install poetry
$ poetry install

For `gui` installation, run::

$ poetry install --with gui

For `server` installation, run::

$ poetry install --with server


Quick start
===========

Tourbillon settles and is used in a jiffy. Two interfaces are possible:

To start the `standelone` mode, run::
To start the `gui` mode, run::

$ poetry run tourbillon

To start the `server` mode, run::

$ poetry run tourbillon --backend
$ poetry run tourbillon --server

And now it turns! Note that in `server` mode, Tourbillon runs by
default on port 59290.
Expand Down
2 changes: 1 addition & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 10 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"


[tool.poetry]
name = "tourbillon"
version = "6.0.0"
Expand All @@ -21,21 +20,27 @@ include = [
{ path = "LICENSE", format = "sdist"}
]


[tool.poetry.dependencies]
python = "^3.8"
PyYAML = "^6.0"

[tool.poetry.group.gui]
optional = true

[tool.poetry.group.gui.dependencies]
wxPython = "4.2.1"
fastapi = "^0.111.0"

[tool.poetry.group.server]
optional = true

[tool.poetry.group.server.dependencies]
fastapi = "^0.111.0"

[tool.poetry.group.tests]
optional = true


[tool.poetry.group.tests.dependencies]
pytest = "^8.0"


[tool.poetry.scripts]
tourbillon = 'tourbillon.__main__:run'
2 changes: 1 addition & 1 deletion tourbillon/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def run():
else:
logger.init_logger(options.logging_level)

if options.backend:
if options.server:
from tourbillon.server.app import TourBillonServer
app = TourBillonServer(cfg)
else:
Expand Down
2 changes: 1 addition & 1 deletion tourbillon/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def parse_options():
nargs='?', default=None)
parser.add_argument('--version', help="show program's version number and exit",
action='version', version=tourbillon.__version__)
parser.add_argument("-b", "--backend", help="Start TourBillon as a HTTP RESTful server",
parser.add_argument("-s", "--server", help="Start TourBillon as a HTTP RESTful server",
action='store_true', default=False)

group = parser.add_mutually_exclusive_group()
Expand Down

0 comments on commit 8973875

Please sign in to comment.