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

Using poetry dependencies in github actions #152

Closed
manulera opened this issue Nov 10, 2023 · 8 comments
Closed

Using poetry dependencies in github actions #152

manulera opened this issue Nov 10, 2023 · 8 comments
Labels

Comments

@manulera
Copy link
Collaborator

Hi @BjornFJohansson,

I saw that the python dependencies for github actions are taken from yaml files, as far as I understand it, these do not use the poetry file info. Maybe it would be better to install the dependencies using poetry in the actions as well.

The tests at least can be ran like that, with what I mention in the new readme:

# If you want the virtual environment to be created in this folder
poetry config virtualenvs.in-project true

# Install dependencies (extras are required for tests to pass)
poetry install --all-extras

# Activate virtual environment
poetry shell

The action could look like this one:

https://github.com/manulera/ShareYourCloning_backend/blob/67b4ec7731fb42c8187a7fd64491c37afc48a0ed/.github/workflows/ci.yml#L12-L23

@BjornFJohansson
Copy link
Owner

I agree! I used to build conda packages, but stopped since they're no longer absolutely needed. They also take forever to build.

@BjornFJohansson
Copy link
Owner

This is done, but I have problems with Python 3.12

https://github.com/BjornFJohansson/pydna/actions/runs/7140278279/job/19445230849

There is some dependency issue I did not manage to solve

@manulera
Copy link
Collaborator Author

I can have a go at this one

@BjornFJohansson
Copy link
Owner

Thanks! Very grateful! There are problems with 3.8 on some branches, but its just a transfer
of an auxillary function.

@manulera
Copy link
Collaborator Author

manulera commented Dec 15, 2023

Hi @BjornFJohansson I think the cause of the problem is numpy 1.24 being incompatible with python 3.12 due to distutils, see numpy/numpy#23808

If the support for 3.8 is dropped in the dependencies, the tests pass:

https://github.com/BjornFJohansson/pydna/actions/runs/7221690221/job/19677189636

Funnily enough, ubuntu-latest with python 3.8 switches to 3.10 and passes the tests https://github.com/BjornFJohansson/pydna/actions/runs/7221690221/job/19677192185#step:8:13:

The currently activated Python version 3.8.18 is not supported by the project (>=3.9).
Trying to find and use a compatible version. 
Using python3.10 (3.10.12)
Creating virtualenv pydna-COc8hQSf-py3.10 in /home/runner/.cache/pypoetry/virtualenvs

I don't know if there is a workaround for this, but the easiest would be to either drop 3.8 support or postpone 3.12 support

manulera added a commit that referenced this issue Jan 16, 2024
@manulera
Copy link
Collaborator Author

manulera commented Jan 16, 2024

Hi @BjornFJohansson I managed to fix this with #177

This is what changed in pyproject.toml: https://github.com/BjornFJohansson/pydna/pull/177/files#diff-50c86b7ed8ac2cf95bd48334961bf0530cdc77b5a56f852c5c61b89d735fd711

The dependencies are installed, but the tests do not pass for different reasons, including the Tm thing that you mentioned. Maybe it's easier if you just re-include this changes in the pyproject.toml file of the "right branch" instead of merging, up to you!

To include them on the branch:

  • Delete poetry.lock
  • Remove the virtual environment dir if it's there rm -rf .venv
  • poetry install

That should do the trick

@BjornFJohansson
Copy link
Owner

Found almost the same solution, see dev_bjorn branch. Added benefit is that I know know a bit more of poetry.
I still have to figure out why this didnt happen automatically.

@manulera
Copy link
Collaborator Author

Alright! I will close this issue now, you can re-open if you think something is left to be discussed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants