BjornFJohansson / pydna

Clone with Python! Data structures for double stranded DNA & simulation of homologous recombination, Gibson assembly, cut & paste cloning.
Other
166 stars 45 forks source link

Using poetry dependencies in github actions #152

Closed manulera closed 10 months ago

manulera commented 1 year ago

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 commented 1 year ago

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

BjornFJohansson commented 11 months ago

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 commented 11 months ago

I can have a go at this one

BjornFJohansson commented 11 months ago

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

manulera commented 11 months ago

Hi @BjornFJohansson I think the cause of the problem is numpy 1.24 being incompatible with python 3.12 due to distutils, see https://github.com/numpy/numpy/issues/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 commented 10 months ago

Hi @BjornFJohansson I managed to fix this with https://github.com/BjornFJohansson/pydna/pull/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:

That should do the trick

BjornFJohansson commented 10 months ago

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 commented 10 months ago

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