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

[BUG] poetry version solving fails with floris and flasc #200

Closed
1 task done
aclerc opened this issue Aug 5, 2024 · 9 comments
Closed
1 task done

[BUG] poetry version solving fails with floris and flasc #200

aclerc opened this issue Aug 5, 2024 · 9 comments
Assignees
Labels
bug Something isn't working

Comments

@aclerc
Copy link
Contributor

aclerc commented Aug 5, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

I use poetry to define Python environments. I am making a new internal project called wakesteer-design and would like to use both FLORIS and FLASC. When I try adding one it works, but when I try adding flasc after I already added floris I get an error:

Because no versions of flasc match >2.0,<3.0
 and flasc (2.0) depends on coloredlogs (>=10.0,<11.0), flasc (>=2.0,<3.0) requires coloredlogs (>=10.0,<11.0).
And because floris (4.1.1) depends on coloredlogs (>=15.0,<16.0)
 and no versions of floris match >4.1.1,<5.0.0, flasc (>=2.0,<3.0) is incompatible with floris (>=4.1.1,<5.0.0).
So, because wakesteer-design depends on both floris (^4.1.1) and flasc (^2.0), version solving failed.

I don't think this is a major problem because I can just add flasc and use floris since floris is a dependency of flasc.

Expected Behavior

I can set up a new poetry environment and run poetry add floris and then poetry add flasc and it works.

Steps To Reproduce

  1. run poetry new test-package
  2. run poetry add floris
  3. run poetry add flasc

Environment

- OS: Windows 10

Anything else?

No response

@misi9170
Copy link
Collaborator

misi9170 commented Aug 5, 2024

It looks like these lines in the semantic versioning of the FLORIS and FLASC requirements, respectively, are what are causing the issue:
https://github.com/NREL/floris/blob/main/setup.py#L30
https://github.com/NREL/flasc/blob/main/setup.py#L34

We can likely move the FLASC dependency up to coloredlogs~=15.0 to solve the issue

@aclerc
Copy link
Contributor Author

aclerc commented Aug 6, 2024

Thanks for looking at this!

I am also trying to add pandas-stubs to my project but that also has a problem, this time because numpy is v1. If it's possible to open FLORIS and FLASC to numpy v2 that would help. I can raise a separate issue for that if you prefer.

Because no versions of pandas-stubs match >2.2.2.240805,<3.0.0.0
 and pandas-stubs (2.2.2.240805) depends on numpy (>=2.0.0), pandas-stubs (>=2.2.2.240805,<3.0.0.0) requires numpy (>=2.0.0).
And because flasc (2.0) depends on numpy (>=1.20,<2.0)
 and no versions of flasc match >2.0,<3.0, pandas-stubs (>=2.2.2.240805,<3.0.0.0) is incompatible with flasc (>=2.0,<3.0).
So, because wakesteer-design depends on both flasc (^2.0) and pandas-stubs (^2.2.2.240805), version solving failed.

@paulf81
Copy link
Collaborator

paulf81 commented Aug 10, 2024

@aclerc I opened a pull request to address the coloredlogs issue (#202), @misi9170 maybe we can do a patch release once this is in to include the fix in main?

On numpy v2 this is a little trickier, over on FLORIS (NREL/floris#939) when I made a similar bump to coloredlogs, I went through and made the changes for numpy v2 as well, but there was some pushback because it's still relatively new. I think we'll want to move to v2, both FLORIS and FLASC, but maybe need to wait just a little bit for it to be adapted more widely in our dependencies. Still, I'm open to argument we should do this now. Maybe @misi9170 or @rafmudaf you have a feeling on this one?

@paulf81 paulf81 self-assigned this Aug 10, 2024
@paulf81 paulf81 added the bug Something isn't working label Aug 10, 2024
@paulf81
Copy link
Collaborator

paulf81 commented Aug 14, 2024

Hi @aclerc , #202 should have resolved the poetry issue and then @misi9170 has pushed a patch release containing the fix (https://github.com/NREL/flasc/releases/tag/v2.0.1)

Regarding numpy v2, we've been discussing here and the consensus for now is to wait a little while for numpy v2 to be more widely adopted. Out of curiousity I was looking at the pandas github to see what approach they were taking. It seems like they were making sure the code was able to run with v2 (I had previously done this for FLORIS and remember it was not too difficult). But I think there requirement is still numpy < 2. Maybe that is a nice balance until more packages move over? @rafmudaf @aclerc @misi9170 does that sound right to you?

@misi9170
Copy link
Collaborator

@paulf81 , are you suggesting that we switch from numpy~=1.20 to numpy<=2? I'm ok with that, if we confirm that everything runs with numpy v2

@paulf81
Copy link
Collaborator

paulf81 commented Aug 14, 2024

I think the two lines are basically the same, I was just saying that while I understood pandas was 2.0 ready, they requiring < 2, which is maybe the approach we take (~=1.20 translates to something like >=1.2 & <2)

@misi9170
Copy link
Collaborator

Ah sorry, my mistake; I agree that it's nice to stick to supporting a single major version and that moving to supporting v2 seems a bit premature at this stage, so I'd prefer to stick with numpy 1.x

@paulf81
Copy link
Collaborator

paulf81 commented Nov 5, 2024

@aclerc wanted to check if good to close this one now?

@aclerc
Copy link
Contributor Author

aclerc commented Nov 6, 2024

wo lines are basically the same, I was just saying that while I understood pandas was 2.0 ready, they requiring < 2, which is

yes I tried poetry add floris then poetry add flasc and it works :)

@aclerc aclerc closed this as completed Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants