DiamondLightSource / dls-python3-skeleton

Archived in favour of https://github.com/DiamondLightSource/python-copier-template
Apache License 2.0
1 stars 0 forks source link

Flake8 will not be dropping importlib-metadata dependency #38

Open AlexanderWells-diamond opened 2 years ago

AlexanderWells-diamond commented 2 years ago

This comment currently exists in our setup.cfg:

    # remove this dependency once flake8 has dropped "importlib-metadata <=4.3"
    # https://github.com/PyCQA/flake8/pull/1438
    flake8 <= 3.9.2

The linked PR has been closed, and not merged, and the comments indicate there is no intention to solve this particular issue. We should consider changing the comment (or find another workaround - https://github.com/PyCQA/flake8/issues/1522 has some suggestions)

gilesknap commented 2 years ago

In python3-pip-skeleton (which is to be the successor to dls-python3-skeleton in out containerised infrastructure) I have dropped the piins on most things and it is working - can't remember the details of how I got there though!.

https://github.com/epics-containers/python3-pip-skeleton/blob/main/setup.cfg

gilesknap commented 2 years ago

Coincidentally I came across this issue today trying to build a python3-pip-skeleton project with pipenv.

So pipenv still hates the above setup.cfg I linked and fails to lock.

However pip succeeds because it has better dependency resolution. Its fix is to use sphinx==4.3.2 And indeed if I add that to the above setup.cfg then pipenv also copes OK.

This is not an ideal fix as it still locks us into importlib-metadata <=4.3.

One solution I did find to this in a previous wrestle with it was a fork of flake8 called flake9 This adds:

By the way. I notice that flake9 has

i.e. importlib-metadata is built in from python 3.9 onwards. I'm starting with 3.10 in containers so that's nice.