Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

floogen: Add support for installation within python virtual environment #81

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

gbellocchi
Copy link

I have added an optional installation method for floogen, exploiting a Python virtual environment (based on poetry).

  • Added script to build floogen within poetry venv.
  • Added poetry configs.
  • Updated pyproject.toml with precise dependencies versions for more reproducible builds (temporary, it can also be managed with poetry.lock).
  • Updated documentation.

Added optional installation method, which exploits python venvs based on `poetry`.
This provides an isolated and local environment which helps preventing setup conflicts.

- Added script to build `floogen` within `poetry` venv.
- Added `poetry` configs.
- Updated `pyproject.toml` with precise deps versions for more reproducible builds (temporary, it will be managed with `poetry.lock`).
- Updated documentation.
Copy link
Collaborator

@fischeti fischeti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the pull request @gbellocchi !

I have some questions about poetry, which I am not too familiar with. What was the reason to go with that? I am not necessarily against it, but it seems to me a bit more complicated than what I am used to. For instance, what is the advantage of poetry compared to a standard python or conda virtual environment (with pip install)?

Comment on lines +1 to +3
# Copyright 2023 University of Modena and Reggio Emilia.
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The linter will not like your university😉 You will have to use the ETH/Bologna header to pass the CI

#
# Author: Gianluca Bellocchi <gianluca.bellocchi@unimore.it>

#!/bin/bash
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shebang should be the first line before the license header

Comment on lines +1 to +2
[virtualenvs]
in-project = true
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couldn't this be merged in to pyproject.toml?

Comment on lines +21 to +31
"pydantic == 2.5.3",
"networkx == 3.2.1",
"matplotlib == 3.8.2",
"mako == 1.3.1",
"ruamel.yaml == 0.18.5",
"hjson == 3.1.0",
"jsonref == 1.1.0",
"click == 8.1.7",
"pylint == 3.0.3",
"pytest == 7.4.4",
"pygame == 2.6.1"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would not specify the patch version, major or minor version should be enough. The exact version is anyway locked in poetry.lock right?

Comment on lines +18 to +19
echo "$ENV_LIST" | grep "venv" &> /dev/null
if [ $? == 0 ]; then
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't poetry automatically check if there is already a python environment?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants