ratt-ru / packratt

BSD 3-Clause "New" or "Revised" License
0 stars 2 forks source link

pyyaml < 6 requirement too strict #23

Closed landmanbester closed 2 years ago

landmanbester commented 2 years ago

I'm running into issues trying to get pfb-clean and QuartiCal running in the same stimela2 recipe. At least part of the problem stems from the pyyaml requirement here. Is there a good reason for this or can I relax it?

sjperkins commented 2 years ago

Packratt's configuration is managed by python poetry technically and the setup.py is auto-generated when poetry builds a wheel.

In fact, setup.py shouldn't even really exist, I added it because poetry didn't support development installs (at that stage).

If you modify the requirement, does packratt play nicely with other packages?

sjperkins commented 2 years ago

At least part of the problem stems from the pyyaml requirement here. Is there a good reason for this or can I relax it?

The strictness is probably due to how Poetry specifies dependencies, rather than due to any specific reason.

landmanbester commented 2 years ago

I have removed the < 6 requirement in the pyyaml branch and haven't run into any issues yet

sjperkins commented 2 years ago

The change to correctly fix this would be to remove

  1. Remove setup.py
  2. Update the pyyaml version in pyproject.toml

In fact, setup.py shouldn't even really exist, I added it because poetry didn't support development installs (at that stage).

This isn't necessary any longer due to https://github.com/python-poetry/poetry/issues/34#issuecomment-1055977321

Installing a Poetry project in editable mode via pip wasn't possible for a long time, because pip doesn't know how to do this. This have changed with PEP-660. The neccessary hooks were implemented in Poetry's master branch already for a long time and were now backported to the poetry-core 1.0 branch. pip supports editable installs according to PEP-660 since 21.3.

landmanbester commented 2 years ago

It looks like there might be a bit more to it. I get

ERROR: Project file:///home/landman/software/packratt has a 'pyproject.toml' and its build backend is missing the 'build_editable' hook. Since it does not have a 'setup.py' nor a 'setup.cfg', it cannot be installed in editable mode. Consider using a build backend that supports PEP 660.

So I guess I need to change build-backend = "poetry.masonry.api" in the pyproject.toml. I'm not sure to what though. Any ideas?

sjperkins commented 2 years ago

24 and #25 should resolve this, but your pip needs to be up to date. Please reopen if you run into further issues.

landmanbester commented 2 years ago

Thanks @sjperkins