Skip to content
This repository has been archived by the owner on Jan 8, 2024. It is now read-only.

Please port tests to Python 3 #141

Open
jelly opened this issue Dec 20, 2019 · 4 comments
Open

Please port tests to Python 3 #141

jelly opened this issue Dec 20, 2019 · 4 comments
Labels

Comments

@jelly
Copy link

jelly commented Dec 20, 2019

Please port the tests to Python 3 since Python 2 is up for retirement in a few days https://pythonclock.org/

@jwilk jwilk added the wontfix label Dec 20, 2019
@dvzrv
Copy link

dvzrv commented Dec 22, 2019

@jwilk what's the rationale behind a "wontfix"? That you don't want to implement this, but would be up for pull requests, or that you don't want to see this being implemented at all?

The alternative is basically having no tests (which is not great) in a distribution context soon (as all major Linux distributions drop their support short or mid term).

@Biswa96
Copy link

Biswa96 commented Jul 28, 2021

Any progress on this issue?

@FriedrichFroebel
Copy link

Given the fact that other packages like didjvu, ocrodjvu and djvusmooth, which use pure Python, share the same wontfix labels and at least for ocrodjvu there actually is an open PR without recent activity (for didjvu there is a Python 3 port as well, although no PR given the circumstances), I am going to assume that there will not really be official support for this in the near future.

From my experience with porting didjvu to Python 3, most of it should be rather straightforward - especially as in the case of pdf2djvu where only the tests are affected where every line is being executed. Nevertheless, some care has to be taken to make the tests compatible with recent Python versions (starting at Python 3.10): The nose package has been deprecated for quite some time and the code requires some custom patching with Python >= 3.10. For the didjvu part, I recently replaced the whole nose stuff with plain stdlib unittest implementations, discovery and runners.

@FriedrichFroebel
Copy link

FriedrichFroebel commented Jul 26, 2022

I just gave it a try and with some trial-and-error I managed to get the existing tests to work on Python 3.8. Some notes about it:

  • I have mainly used GitHub Actions for fixing, as general installation instructions are rare and it seems like I would have overwrite my local poppler distribution with a custom build including xpdf headers. I might make another personal attempt to let GitHub Actions generate a suitable static build for me. (I have never actually used pdf2djvu before.) - Edit: According to https://groups.io/g/pdf2djvu/message/123, the corresponding headers are indeed available from the Ubuntu package index.
  • There are tons of small commits, which most likely should be squashed into one if ever considered for merging.
  • I had to disable pylint as recent releases seem to emit lots of new warnings. These probably should be addressed.
  • The nose package is officially deprecated and fails with Python 3.10. Some suitable migration path has to be considered, as addressed in Replace nose for tests FriedrichFroebel/didjvu#6 for example.
  • I assume that the migrated code will not run on Python 2 any more, although I did not test this.

If someone wants to address some of this stuff, feel free to check out my current fork at https://github.com/FriedrichFroebel/pdf2djvu (PRs are enabled).

archlinux-github pushed a commit to archlinux/aur that referenced this issue Sep 6, 2022
* remove temporary patch for poppler (it is fixed in upstream now)
* update the patch for migrating tests to Python 3 (unfortunately,
  upstream doesn't seem to want migrating to Python 3 :( )
  jwilk-archive/pdf2djvu#141
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

No branches or pull requests

5 participants