I tried really hard to work with poetry when I sta...
# singer-tap-development
s
I tried really hard to work with poetry when I started developing my first meltano SDK tap a few months ago (previously just used
miniconda/pip-tools
). It seemed to work ok, and I even tried it in another project, but ended up abandoning it there because it seemed to raise dependency conflicts that didn’t make sense. Then it let me uninstall a package that it depended on itself and stopped working altogether! I have to make a change to the tap I built a few months ago now and when check out the code anew and run
poetry install
, I’m getting errors during the installation of sqlalchemy! I’ve got the same lock file, so it shouldn’t do that! I tried updating packages, but still no dice. I think I’m done with it. Anyone else just got fed up with it, or does my experience clearly seem like an outlier?
e
Hi @sterling_paramore , I’ve seen some folks struggle a bit with poetry specially if they’re coming from a setup.py world or from other dependency management tools. That said, I use it all my projects and don’t face any of those issues so here’s a few suggestions:
Then it let me uninstall a package that it depended on itself and stopped working altogether!
You mean a package required by poetry? That shouldn’t happen if poetry is correctly isolated by using either the official installer or
pipx
. I use the latter and it’s what we recommend for SDK users.
I have to make a change to the tap I built a few months ago now and when check out the code anew and run
poetry install
, I’m getting errors during the installation of sqlalchemy!
Depending on how many versions (of Poetry) ago you generated the lock file, Poetry might’ve made changes to its resolver so previously “compatible” versions during installation may no longer be.
s
That’s possible, I was trying to run poetry in a conda environment. I really like conda environments because it gives me easy control over which python version I’m running.
From the docs I read, I recall that running in a conda env is supported, and makes it so you don’t have to preface all commands with
poetry run
, which really bothered me.
e
You can also drop in a shell with the right venv activated using
poetry shell
s
So I found that my problem was that I had used python 3.9 when originally developing my tap. Then when I started it today, I used 3.8 since another project I’m working on that will use this tap can only run on 3.8. So when I ran
poetry install
on 3.8 with a lock file created on 3.9, I got installation errors.
poetry update
didn’t fix the issue. However, deleting the lock file and running
poetry install
again did work. If it were just that I had dependencies in the lock file that were incompatible with 3.8, I would have assumed
poetry update
would have resolved them, but unfortunately it did not.
a
I highly recommend pyenv It should be the (almost) defacto standard for managing multiple python installations. I avoid conda because it makes it harder to containerize what you build, its a bit heavy size and dependency wise, and complicates things when using more "native" tooling like venv, poetry, etc. The only plus which I havent had to deal with in awhile was the ease of using things like CUDA related packages since it does well with external C deps and whatnot Poetry is fire in my experience FWIW