Has anyone gotten `poetry` actions to work in a CI...
# singer-tap-development
s
Has anyone gotten
poetry
actions to work in a CI/CD environment such as Github Actions? I was trying to setup some boilerplate actions that would run
poetry publish
and
poetry run pytest
for my tap, but there is apparently an issue with poetry deleting the
setuptools
module (https://github.com/python-poetry/poetry/issues/3139). Plenty of ways around it, but I was thinking -- if the SDK can help standardize the taps and testing, it would also be nice to have standard, poetry-based CI/CD. My question, I guess, is whether anyone has encountered this before and knows whether there's something I should change in my
pyproject.toml
file or
poetry.lock
?
e
Hi @stephen_bailey! I have some GH actions working for tap-dbt using poetry. I have one workflow for testing the tap with
poetry run tap-dbt --test --config=ENV
and another for releasing to PyPI triggered by a GitHub release, which uses an action maintained by PyPA. You're right that the cookiecutters could include an optional set of github or gitlab CI/CD workflows.
s
niiiice! i knew someone had done this already, and better 🙂 will give it a shot and share if i hit any roadbumps
coming back to this. it looks like this is an issue that is being actively worked on, and it seems to be more common in docker deployments, where the how of how poetry is installed is.a little less controlled. https://github.com/python-poetry/poetry/issues/3139#issuecomment-820164065 the issue that is happening for me, is that i am unable to generate a
poetry.lock
file locally that can be reused successfully in the github actions container, even when using the same simple action script. If i remove the
poetry.lock
file, it all works well. it sounds like they are going to add something akin to
poetry install --no-remove
to handle this
Update here on the
poetry
issue: they are releasing a fix in the next version of Poetry to prevent the "uninstallation" packages that were not managed by Poetry. My current fix for this in the action is to install the Preview version is:
Copy code
- name: Install Poetry
        run: |
          curl -sSL <https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py> | python -
          export PATH=$PATH:$HOME/.local/bin
          poetry self update --preview