flairNLP / flair

A very simple framework for state-of-the-art Natural Language Processing (NLP)
https://flairnlp.github.io/flair/
Other
13.92k stars 2.1k forks source link

Packaging and dependency management #1329

Closed severinsimmler closed 4 years ago

severinsimmler commented 4 years ago

TL;DR I think using Poetry as packaging and dependency management tool would make a developer's life easier and the repository more clear relying only on a pyproject.toml.


This issue is not related to NLP, but to a convenient development workflow for this library. I am not quite sure how your packaging and dependency management workflow looks like or how you publish new releases on PyPI, but I'd say the following files in the repository are related to this:

Managing four files seems a bit cumberstone to me. Since you already have a pyproject.toml (PEP 518 for more details), I highly recommend Poetry as a tool for packaging and dependency management, as I have made very good experiences with it in other projects.

Poetry and a pyproject.toml make the setup.py, requirements.txt and Pipfile (see this section for Pipenv vs. Poetry) obsolete, gives you dependency resolution and detereministic builds, a manager for virtual environments, a manager for building and publishing new releases, plus Poetry's great user experience.

Poetry's usage in short. Setting up the project (incl. a fresh virtual environment) is easy as:

poetry install

running e.g. pytest in the virtualenv:

poetry run pytest

or publishing a new version on PyPI:

poetry publish

Poetry's documentation is also great.

However, I don't know if you are happy with the current workflow and it is not worthwhile to invest work here, but if so, I would like to do a PR.

alanakbik commented 4 years ago

@severinsimmler thanks for the pointer - poetry looks very interesting. For now, I'm hesitant about changing the dependency management as I am happy enough with the current workflow (the setup.py reads the requirements.txt so all dependencies are in one spot), also the requirements.txt way of declaring dependencies is supported by PyCharm plugins which I find useful.

I'll definitely keep an eye on poetry in the future though and maybe trial it in some smaller projects first.

severinsimmler commented 4 years ago

Alright, thanks for the feedback :)

Closing this issue for now then, feel free to contact me again.