Replies: 10 comments 20 replies
-
The described conda+Poetry normalized combo is what's described here: https://stackoverflow.com/a/71110028/2611913, apparently used with success |
Beta Was this translation helpful? Give feedback.
-
a bonus nice thing about conda lock: no package resolution is needed ("conda-lock acts as an external presolve for conda"), so should speed up cond install command |
Beta Was this translation helpful? Give feedback.
-
I would be in favour of keeping it light and easy to understand, either conda or pip. Slow resolve of conda isn't an issue if we try to minimise the number of external packages we bring in. My personal vote would be for conda because it's what I already use and find that the environments are nicely handled. |
Beta Was this translation helpful? Give feedback.
-
Yes, definitely also in favour of "light and easy to understand" 👍 |
Beta Was this translation helpful? Give feedback.
-
The fastest onboarding is also without lock files: then users can just use already installed package versions, without having to download and install exactly pinned versions. So I would propose for the final solution to have two install options:
|
Beta Was this translation helpful? Give feedback.
-
Yeah although if people aren't using the lockfiles then it's not really fully reproducible. How about we worry about that if it becomes a problem? I think even having a standard environment and getting people to use that would be a huge improvement on what people usually do! |
Beta Was this translation helpful? Give feedback.
-
true. in general, YAGNI, bottom-up, needs-based, 'organic' organization is the way to go in my experience |
Beta Was this translation helpful? Give feedback.
-
OTOH. I then had to dive into the log files of an older github actions run that had still completed succesfully to track down the exact versions of jupyterbook's dependencies, to then pin them in the |
Beta Was this translation helpful? Give feedback.
-
There are a few options that I personally like:
Personally, I lean towards 1 in the short-term or maybe 4. I really dislike conda so I'd like if we could at least keep Poetry as an option. |
Beta Was this translation helpful? Give feedback.
-
(cross-posting from #15 as it's generally useful): Highly recommend checking out miniforge/mambaforge if you hadn't seen it before: https://github.com/conda-forge/miniforge Conda-forge is a great project & channel (the official/default conda channel is not very good) Having conda-forge as the default channel (and not just as an extra channel besides Anaconda Inc's) also greatly speeds up dependency resolution (version solving). |
Beta Was this translation helpful? Give feedback.
-
context: I'm wondering what package manager to use for installing jupyterbook (which is a PyPI-package) and its dependencies.
I then also wondered which install option we will generally recommend for the main project.
Poetry seems nice (lock files are good), though its install instructions (legacy | recommended) seem a bit daunting to adopt it as general recommended pkg manager.
I have to admit I was a bit loathe to install it as it's yet another directory in my homedir :p (same with .conda, .jupyter, ..).
I tried the install instructions: had to change
python3
topython
for it to work, and manually add%APPDATA$\Python\Scripts
to my PATH (first did it wrong and addedC:\Users\lpxtf3\AppData\Roaming\Python\Scripts%AppData%\Roaming\Python\Scripts
to my path, but should've followed the manual literally).Also, apparently you can move
.poetry/
away from your homedir usingPOETRY_HOME
, which is nice.poetry install
in the repo root then worked nicely.Conda's dependency resolver is slow (though it can be sped up with the right settings). Conda is more widespread in the compneuro community than Poetry I think, and unlike pip or Poetry, it can also define non-PyPI dependencies (including the Python version itself).
This might become especially important when GPU-training our SNNs (e.g.)
It by default has no lock files. But if using conda we should use conda-lock, which provides them (and is bound to eventually become part of base conda).
An idea is maybe to combine Conda and Poetry:
conda
and itsenvironment.yml
installs only Python and Poetry (and in the future potential other non PyPI software if needed),and Poetry install PyPI packages (and our own python package).
Then we don't have to worry about Poetry's install -- miniconda install is an executable on windows and mac, so it's a bit easier. It also adds to path for you.
We then don't have duplication of packages between
pyproject.toml > [tool.poetry.dependencies]
andenvironment.yml
.What do you guys think? (@synek)
Then one thing left to decide is what to do with
requirements.txt
.How will we keep it in sync with
pyproject.toml > [tool.poetry.dependencies]
? Or shall we simply delete it.There's a trade-off here.
Allowing a simple
pip install -f requirements.txt
oneliner makes getting started as easy as possible for new contributors. They then don't have to installconda
and wait for it to resolve the environment and install Poetry and an exact Python version, and then runpoetry install
.The 'danger' is that the dependency lists get out of sync, leading to frustration when things don't work.
Beta Was this translation helpful? Give feedback.
All reactions