Giter Site home page Giter Site logo

Error on windows about install-poetry HOT 14 CLOSED

snok avatar snok commented on June 11, 2024
Error on windows

from install-poetry.

Comments (14)

sondrelg avatar sondrelg commented on June 11, 2024 1

Thanks! Figured out how to make it run on Windows - just trying to clean up the implementation now and then I'll release a new version shortly 🚀

from install-poetry.

JessicaTegner avatar JessicaTegner commented on June 11, 2024 1

nice!
Do let me know when the new version is out 👍

from install-poetry.

sondrelg avatar sondrelg commented on June 11, 2024 1

Sorry for the late response, but my best bet is that one of your other commands will need to be adapted to the shell type. I've finally been able to test this properly, and I thought I would share the workflow I've run.

name: test

on: push

jobs:
  linting:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-python@v2
        with:
          python-version: "3"
      - uses: actions/cache@v2
        with:
          path: ~/.cache/pip
          key: ${{ runner.os }}-pip
          restore-keys: |
            ${{ runner.os }}-pip-
            ${{ runner.os }}-
      - run: python -m pip install black flake8 isort
      - run: |
          flake8 .
          black . --check
          isort .
  test:
    needs: linting
    defaults:
      run:
        shell: bash
    strategy:
      fail-fast: false
      matrix:
        python-version: [ "3.6", "3.7", "3.8", "3.9"]
        django-version: [ "2.2", "3.0", "3.1" ]
        os: [ubuntu-latest, windows-latest]
    runs-on: ${{ matrix.os }}
    steps:
      - name: Check out repository
        uses: actions/checkout@v2
      - name: Set up python ${{ matrix.python-version }}
        uses: actions/setup-python@v2
        with:
          python-version: ${{ matrix.python-version }}
      - run: echo "${{ runner.os }}"
      - name: Install poetry
        uses: snok/[email protected]
        with:
          virtualenvs-create: true
          virtualenvs-in-project: true
      - name: Load cached venv
        id: cached-poetry-dependencies
        uses: actions/cache@v2
        with:
          path: .venv
          key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}-1
      - name: Install dependencies
        run: poetry install
        if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
      - name: Install django ${{ matrix.django-version }}
        run: |
          source $VENV
          pip install "Django==${{ matrix.django-version }}"
      - name: Install DRF 3.11 on Django 2.2
        if: matrix.django-version == '2.2'
        run: |
          source $VENV
          poetry add "djangorestframework==3.11.1"
      - name: Run tests
        run: |
          poetry run pytest --cov=django_swagger_tester --verbose --assert=plain
          poetry run coverage report

and here is a link to the workflow run in case it could be helpful.

I believe with the changes made in v1.1.1 the poetry install should be stable, but I'm still a little stumped as to why it doesn't work on other shells than bash. Feel free to test further and make commit a PR if you want.

from install-poetry.

sondrelg avatar sondrelg commented on June 11, 2024

Hi @NicklasTegner, thanks for submitting the issue.

I'm going to take a look at this tonight and get back to you 👍

from install-poetry.

JessicaTegner avatar JessicaTegner commented on June 11, 2024

hi @sondrelg

Just to add, here's my configuration (that triggered the error)

- name: Install Poetry
  uses: snok/[email protected]
  with:
    virtualenvs-create: true
    virtualenvs-in-project: true
    virtualenvs-path: .venv

from install-poetry.

sondrelg avatar sondrelg commented on June 11, 2024

Hey @NicklasTegner,

Just released v1.1.0, and Windows should now work.

Make sure to use:

- name: Install Poetry
  uses: snok/[email protected]
  with:
    virtualenvs-create: true
    virtualenvs-in-project: true

(the path setting you've used is not necessary since the default in-project path should be .venv)

and then you will need to set the default shell like this, at the job level:

defaults:
  run:
    shell: bash

I've added a section dedicated to running this action in windows in the updated readme, here that might also be helpful.

If anything is unclear, or it still doesn't work, let me know :)

edit: If you like the repo, I hope you might also consider giving it a star, so it becomes more visible 😊

from install-poetry.

JessicaTegner avatar JessicaTegner commented on June 11, 2024

hi @sondrelg

I just tried with the updated version, and I get the following now:

Poetry (1.1.4) is installed now. Great!

To get started you need Poetry's bin directory (%USERPROFILE%\.poetry\bin) in your `PATH`
environment variable. Future applications will automatically have the
correct environment, but you may need to restart your current shell.

chmod: cannot access 'D:a_actionssnokinstall-poetryv1.1.0/main.sh': No such file or directory
Error: Process completed with exit code 1.

And my config is as follows:

Globally:

defaults:
  run:
    shell: bash

And in my Windows job:

    - name: Install Poetry
      uses: snok/[email protected]
      with:
        virtualenvs-create: true
        virtualenvs-in-project: true

from install-poetry.

sondrelg avatar sondrelg commented on June 11, 2024

Yes I see you're right. Must have changed something last minute, because my tests were passing and now they're not 🤔

I'll take another look at it today after work and get back to you! Thanks for the feedback.

from install-poetry.

sondrelg avatar sondrelg commented on June 11, 2024

When you get the opportunity, could you try using snok/[email protected]?

Version 1.1.1rcN is the pre-release for what I believe fixes the issue.

The issue seems to have been that the built-in Github Actions variable ${{ github.action_path }} doesn't work correctly on Windows. I had made a pre-release yesterday and tested remotely on ubuntu-latest runners, and I had also tested on windows-latest runner locally in this action repo; but I had of course forgotten to test windows runners remotely. Sorry about that, hopefully this works (fingers crossed).

from install-poetry.

JessicaTegner avatar JessicaTegner commented on June 11, 2024

Hi.
I see that v1.1.1rcN is here on the page, but my workflow seems unable to find download information for it:

Failed to resolve action download info. Error: Unable to resolve action snok/[email protected], unable to find version vv1.1.1rcN

from install-poetry.

sondrelg avatar sondrelg commented on June 11, 2024

I think you might have included one "v" too many. Try snok/[email protected] :)

from install-poetry.

JessicaTegner avatar JessicaTegner commented on June 11, 2024

It's working now, but my problem is, that my Windows job now fails at the end, at the "Complete job" step.
No output, but on the overview I get

github-actions/` Windows Builder
.github#L1
Process completed with exit code 1.

This error came, after I set the shell to be bash. Any suggestions?
PS: Also still need to verify that caching work, will do that while I try to fix the above error.

from install-poetry.

sondrelg avatar sondrelg commented on June 11, 2024

Is your workflow closed source? It might be easier to help if you could link me the full code.

If it is, perhaps this example can help you: https://github.com/snok/django-swagger-tester/blob/upgrade-action/.github/workflows/testing.yml

This is the branch of another repository that I've used to test an ubuntu/windows matrix on the current pre-release.

EDIT: The runners are taking longer than I expected to finish for the branch I'm currently testing, so there's a chance it will fail for my workflow too.

from install-poetry.

JessicaTegner avatar JessicaTegner commented on June 11, 2024

yes, the repository is closed, but if you want you are welcome to take a look at my workflow configuration here: https://gist.github.com/06a177cdeaa2946be83077c2f0f4352b

from install-poetry.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.