allenai / scispacy

A full spaCy pipeline and models for scientific/biomedical documents.
https://allenai.github.io/scispacy/
Apache License 2.0
1.68k stars 225 forks source link

Releasing a tool to PyPi with an `en_ner_craft_md` dependency #436

Closed hrshdhgd closed 2 years ago

hrshdhgd commented 2 years ago

We have a an NER project who has a dependency on one of your models namely en_ner_craft_md and potentially others in the future.

I'm trying to release our project to PyPi and get the error:

HTTP Error 400: Invalid value for requires_dist. Error: Can't have direct dependency: 'en_ner_craft_md @ https://s3-us-west-2.amazonaws.com/ai2-s2-scispacy/releases/v0.5.0/en_ner_craft_md-0.5.0.tar.gz'

We're using poetry as our package management tool and the dependency is declared as follows in pyproject.toml:

[tool.poetry.dependencies.en_ner_craft_md]
url = "https://s3-us-west-2.amazonaws.com/ai2-s2-scispacy/releases/v0.5.0/en_ner_craft_md-0.5.0.tar.gz"

Is there any recommendation from your team for how should we address this?

Thanks in advance!

dakinggg commented 2 years ago

From a couple of stack overflow posts and other github issues, it looks like PyPi does not support a package having non-PyPi dependencies. My suggestion would be to just put the installation of en_ner_craft_md in an installation instructions section of your readme. Another option would be to try to import it wherever you need it in your package code, and if its not installed, throw an exception that tells the user how to install it.