sckott / habanero

client for Crossref search API
https://habanero.readthedocs.io
MIT License
188 stars 30 forks source link

bibtexparser integration #185

Open rjaiser opened 1 week ago

rjaiser commented 1 week ago

Hi

the integration of bibtexparser can lead to conflicts. As default pip and conda install v1 of bibtexparser. By default pip and conda install v1 of bibtexparser. Unfortunately, bibtexparser.parse_string is only available in v2 of bibtexparser. More problematically, v1 and v2 are not compatible. If someone is using bibtexparser v1 in their own project, and also using habanero, they will have to stick with versions prior to 1.2.6.

Thanks for looking into this Ralf

sckott commented 1 week ago

Thanks for this Ralf. I'll have a look. I thought I had set habanero up so bibtexparser is optional, but I guess it's only optional if you don't use the default format value of "bibtex"

rjaiser commented 1 week ago

My guess is that you need to check the version of bibtexparser or the availability of bibtexparser.parse_string() and bibtexparser.write_string(). Both functions are only available in the v2 branch of bibtexparser. At the moment you are just checking if bibtexparser is available at all, but you need a specific feature that is not in every version. Since v2 is not yet the stable branch, anyone installing it from pip or conda will get v1. And as I said, v2 and v1 are not compatible. In my case, I have a valid bibtex input, so I do not need to fix_bibtex(). Actually, this is because the input comes from bibtexparser v1 🤷‍♂️

rjaiser commented 1 week ago

Sorry, the last two sentences do not make sense. It runs into bibtexparser v1 afterwards.