Comments (14)
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.
nice!
Do let me know when the new version is out 👍
from install-poetry.
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.
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.
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.
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.
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.
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.
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.
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.
I think you might have included one "v" too many. Try snok/[email protected]
:)
from install-poetry.
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.
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.
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)
- poetry: command not found HOT 2
- Skip poetry install step with cache hit HOT 10
- Poetry fails on matrix strategies combinations HOT 4
- Add env: section to parse envs that are used in each poetry call HOT 1
- .venv caching is not working using composable actions? HOT 3
- urllib.error.URLError: <urlopen error unknown url type: https> HOT 4
- Error: `GLIBC_2.34' not found HOT 2
- poetry: command not found - When running multiple self-hosted runners on the same machine. HOT 4
- The `with` `virtualenvs-in-project` setting does not seem to work for me HOT 5
- Cache not found HOT 3
- Does not respect POETRY_HOME HOT 2
- Actions started failing recently. HOT 15
- Shared Library Error (libpython3.8.so.1.0) on builds using runner with python 3.9 or above HOT 1
- Poetry Requires Python 3.8+ HOT 3
- $VENV not set on Poetry installation cache restore HOT 3
- How to change working-directory ? HOT 5
- Install poetry in self-hosted github runner to allow different python versions HOT 9
- Virtual environment created in wrong location
- Calling poetry via CMake script on Windows HOT 4
- Update docs for Windows Server 2019 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from install-poetry.