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

Fix for Broken GitHub Actions Jobs #12

Closed
mjbear opened this issue Apr 10, 2024 · 8 comments
Closed

Fix for Broken GitHub Actions Jobs #12

mjbear opened this issue Apr 10, 2024 · 8 comments

Comments

@mjbear
Copy link
Contributor

mjbear commented Apr 10, 2024

I noticed many of the GitHub Actions jobs failed ❌ for PR #11 (Thank you for merging that! @dbarrosop)

I took some time to look at the job output for that workflow. I'm no expert on GH Actions, but I worked through them to a point where they all run (and pass ✅) now for my fork of this repo.

I'll gladly submit a PR for my branch, but wanted to check first. 😁

As a summary:

  • bumped the snok/install-poetry action version because the curl command resulted in a 404 HTTP error
  • which also led to updating the poetry version within that job
You are installing 1.1.4. When using the current installer, this version does not support updating using the 'self update' command. Please use 1.1.7 or later.

... snipped ...

ImportError: cannot import name 'PyProjectException' from 'poetry.core.pyproject' (/home/runner/.local/venv/lib/python3.12/site-packages/poetry/core/pyproject/__init__.py)
  • removed Python 3.6 version (not available anymore) and added 3.9

  • later expanded testing to Python 3.10, 3.11, and 3.12
    Error: Version 3.6 with arch x64 not found

  • bumped abatilo/actions-poetry action version as it continued to fail (see below)

  • consequently ended up bumping the poetry version within that job as well
    pyenv: no installed versions match the prefix 'install'

@dbarrosop
Copy link
Contributor

yes, that looks about right. Thank you very much.

@mjbear
Copy link
Contributor Author

mjbear commented Apr 10, 2024

Submitted PR #13
Thank you @dbarrosop

@mjbear
Copy link
Contributor Author

mjbear commented Apr 10, 2024

I noticed some jobs in the workflow (that work within the testing of my fork) ended up failing during the evaluation of this PR.
https://github.com/nornir-automation/nornir_jinja2/actions/runs/8632742206?pr=13

It fails during the installation of dependencies for the linters job - specifically related to pyzmq.

@dbarrosop
Copy link
Contributor

I think dependencies might need to be updated too, the version of pyzmq might be a bit too old.

@mjbear
Copy link
Contributor Author

mjbear commented Apr 15, 2024

It is quite ironic that the tests in my fork function with all green check marks, but when I push to my branch then things fail.

I found that I needed to update poetry dependencies to get past the pyzmq issue. The dependencies update brought with it the need to pin two more packages (pyflakes and click).

From my research (error message below), I probably need to investigate changing the pinned version for pylama (and likely other dependencies). This way the pylama version will function with Python 3.12 as well as the rest of the Python versions. (Yes, it was my choice to add 3.12 to the GH actions matrix... 😖)

 AttributeError: module 'pkgutil' has no attribute 'ImpImporter'. Did you mean: 'zipimporter'?
make: *** [Makefile:30: pylama] Error 1

Taking a break for some sleep. 💤

@dbarrosop
Copy link
Contributor

dbarrosop commented Apr 15, 2024

no worries and no rush. Really appreciate you taking the time to update all of this. A million thanks :)

@mjbear
Copy link
Contributor Author

mjbear commented Apr 21, 2024

@dbarrosop I think I've got it. 🎉 hehe

I ended up pinning the "setup python" step for the linters job to Python 3.12 and that fixed it.

Before this realization, I found from the workflow output, it seems upgrading ensurepip (for 3.12) is already taken care of and is unnecessary.

Based on my reading I thought a run command may be needed (including it below in case we need it later), but that turned out to not be the case.

AttributeError: module 'pkgutil' has no attribute 'ImpImporter'. Did you mean: 'zipimporter'?
Python 3.12 removed a few things related to importlib
Fix for changes in 3.12 is to install pip via ensurepip

In case we ever need to upgrade ensurepip the below is what I tried (before I found it to be unnecessary).

# ... snipped ...

jobs:
  linters:
    name: linters
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - name: Setup python
        uses: actions/setup-python@v1
        with:
          python-version: 3.12
      - run: python -m ensurepip --upgrade

# ... snipped ...

@dbarrosop
Copy link
Contributor

Amazing work. Thanks again!

p.s: I am closing as I think this is done but feel free to reopen otherwise.

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

No branches or pull requests

2 participants