Skip to content

Modernize #2

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

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Modernize #2

wants to merge 6 commits into from

Conversation

alexfikl
Copy link

This updates python-doi to be a bit more in line with papis and generally work with newer linting and stuff.

The commits should be fairly self-contained. Let me know if you spot anything wrong!
I have some followup things to clean up the docs as well.

@alexfikl
Copy link
Author

Also, this repository doesn't seem to have issues enabled. It would be good to turn that on as well?

@hseg
Copy link

hseg commented Apr 17, 2025

Any progress on getting this merged? I don't see anything that should cause issue.

@alexfikl
Copy link
Author

alexfikl commented Apr 17, 2025

I'm afraid I don't have access to this repo to merge it. @alejandrogallo Any chance you can find some time to give it a look and merge it? 😁

EDIT: As far as I can tell the tests still pass (locally), but it's probably a good idea to re-run the CI anyway before merging.

EDIT2: Enabled support for testing on Python 3.13 as well! 😁

@hseg
Copy link

hseg commented Jun 23, 2025

Trying to use this, I notice I needed to pass --ignore=docs to pytest, otherwise, it tries to collect from there as well and fails with

ImportError while importing test module '/home/gesh/aur/1+mine/python/python-doi/src/python-doi/docs/conf.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib/python3.13/importlib/__init__.py:88: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
docs/conf.py:130: in <module>
    from sphinx.ext.autodoc import (
E   ImportError: cannot import name 'InstanceAttributeDocumenter' from 'sphinx.ext.autodoc' (/usr/lib/python3.13/site-packages/sphinx/ext/autodoc/__init__.py)

Although the Makefile masks this by passing the relevant source directories to pytest directly, it'd be nice for python -m pytest to do the Right Thing™.

Anything left to get this merged @alejandrogallo ?

@hseg
Copy link

hseg commented Jun 23, 2025

... Actually, it turns out that on my system, this PR suffices to get the tests to pass, with no other trickery needed. I don't know what happened in the last two months to make my bug no longer reproduce, but it seems #3 can be closed without merging it (or merged if we want that redundancy, though we'd probably want to drop the commit introducing rerunfailures if it's that unnecessary). I'll rebase it on top of this PR to make it easier to merge, presuming we're merging this one in in any case.

@hseg
Copy link

hseg commented Jun 23, 2025

Ah, I see what happened -- 844fdfd fixed the urls the tests point to, making the tests no longer break

@alexfikl
Copy link
Author

Trying to use this, I notice I needed to pass --ignore=docs to pytest, otherwise, it tries to collect from there as well and fails with

Just looked at docs/conf.py and it looks like it really needs a cleanup. I'll get to that after this PR gets in.

Ah, I see what happened -- 844fdfd fixed the urls the tests point to, making the tests no longer break

I think it's ok to change these because they're just checking that the DOI parsing works as expected. However, we might want to add some more tests to check that we manage to follow redirects properly and whatnot. Maybe a follow-up to #3 could go in that direction?

@hseg
Copy link

hseg commented Jun 29, 2025

They're just checking that the DOI parsing works as expected

Yeah, I see it's just checking the https://doi.org/api/handles/ endpoint works as expected. I am trying to investigate getting the redirect code to work for robustness' sake, but OTOH given the 403's the redirected URLs are giving, I'm suspecting some of these sites aren't very scraper-friendly, and so are likely to be difficult to support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants