Comments (8)
You should restore your cache before installing poetry
https://github.com/SickChill/SickChill/blob/develop/.github/workflows/upgrade_dependencies.yml
from install-poetry.
I've not changed working directory with Github actions before, so not sure exactly how it works, but is it possible that your venv is not located at .venv
but instead at ../.venv
?
from install-poetry.
from install-poetry.
Whats strange is running the following step, before source .venv/bin/activate
works. But this just installs the dependencies again, which we're trying to avoid.
#----------------------------------------------
# install your root project, if required
#----------------------------------------------
- name: Install library
run: poetry install --no-interaction
from install-poetry.
If you have the opportunity to create a demo project or some reproducible example that would help me a lot. Otherwise, maybe it would be helpful to sprinkle in a few ls
statements to get a sense of where the venv is located relative to your working directory.
from install-poetry.
@sondrelg This still does not fix it!
from install-poetry.
on:
push:
branches-ignore:
- main
name: Local Tests - Vital Background Pull
jobs:
test-vital-background-pull:
name: Local Tests - Vital Background Pull
runs-on: ubuntu-latest
defaults:
run:
shell: bash
working-directory: vital-background-pull
steps:
- uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v3
with:
python-version: 3.9
- uses: harmon758/postgresql-action@v1
with:
postgresql version: "11"
postgresql db: vital-test-db
postgresql user: postgres
postgresql password: local_password
- name: Check running containers
run: docker ps -a
- name: Restore pip cache
uses: actions/cache@v3
with:
path: $(python -m pip cache dir)
key: ubuntu-latest-pip-3.9-${{ hashFiles('**/pyproject.toml') }}
restore-keys: |
ubuntu-latest-pip-3.9-
#----------------------------------------------
# ----- install & configure poetry -----
#----------------------------------------------
- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: 1.1.10
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: false
- name: Restore poetry cache
uses: actions/cache@v3
with:
path: $(poetry config cache-dir)
key: ubuntu-latest-poetry-3.9-${{ hashFiles('**/pyproject.toml') }}
- name: Restore virtualenv
uses: actions/cache@v3
id: cache-venv
with:
path: .venv
key: ubuntu-latest-virtualenv-3.9-${{ hashFiles('**/pyproject.toml') }}
#----------------------------------------------
# install dependencies if cache does not exist
#----------------------------------------------
- name: Install dependencies
if: steps.cache-venv.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root
#----------------------------------------------
# run test suite
#----------------------------------------------
- name: Run tests
run: |
source .venv/bin/activate
make check-format
make mypy
make lint
make test
from install-poetry.
Can you use something like path: "$( poetry env list --full-path | grep Activated | cut -d' ' -f1 )"
for the cache? Maybe you need the full path of the venv if your runner cwd is different. I haven't tested this command, but it should work I think.
from install-poetry.
Related Issues (20)
- Native `setup-python` cache way HOT 3
- 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
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.