Skip to content
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

Use poetry instead of pipenv for developer/testing #3214

Merged
merged 3 commits into from
Apr 27, 2023

Conversation

Lingepumpe
Copy link
Contributor

@Lingepumpe Lingepumpe commented Apr 22, 2023

This PR removes the (defunct) pipenv setup, which was not maintained and did not pass the tests. Instead of using requirements.txt and requirements-dev.txt, it switches to use poetry https://python-poetry.org

Installation of the flair library continues to not require poetry, it can still be installed directly via pip as before, so for flair users this change should be transparent. For the development/testing dependencies to be installed, poetry is required.

In this PR it was decided to not include the poetry.lock file, allowing the CI/CD to find the most recent legal package versions each time. This took 3 min 18s just now on the github runner. This slows down the pipeline and the first poetry install of a new developer. Alternatively we could commit the poetry.lock file, but would have to remember to do "poetry update" from time to time manually, to allow the CI/CD pipeline and the developer setups to update as new versions are released.

Update 1: After some thinking on it, I have added poetry.lock to be commited. The main downside is that there is some work involved for developers/contributors to occasionally run "poetry update", but the advantage is that the pipeline and new developer setup is faster, and that the pipeline will be more predictable (not failing because a new version introduces a issue) and that it also solves the inconsistency/version-drift issue between pre-commit hooks package versions and versions installed in the main environment:
The exact same versions can be pinned in poetry.lock and .pre-commit-config.yaml - this could (should!) then also be enforced by CI.

Update 2: Since it was decided to remove pre-commit entirely the case for using the poetry.lock in CI/CD is weaker again, so I have added "poetry lock" for each pipeline run back again. Note that I did leave the poetry.lock checked in, allowing new developers to start quicker.

@Lingepumpe Lingepumpe force-pushed the poetry_instead_of_pipenv branch 15 times, most recently from 66a6b9f to f2596b8 Compare April 23, 2023 11:44
CONTRIBUTING.md Outdated Show resolved Hide resolved
@Lingepumpe Lingepumpe force-pushed the poetry_instead_of_pipenv branch from f2596b8 to cc25050 Compare April 25, 2023 07:59
@Lingepumpe
Copy link
Contributor Author

Rebased on current master, also removed pre-commit now.

Copy link
Member

@helpmefindaname helpmefindaname left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you for implementing this!

@alanakbik alanakbik merged commit ff282a0 into flairNLP:master Apr 27, 2023
@alanakbik
Copy link
Collaborator

@Lingepumpe thanks for adding this!

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.

3 participants