Skip to content

Conversation

@albertvillanova
Copy link
Member

@albertvillanova albertvillanova commented Aug 10, 2021

Use packaging module to handle/validate/check versions of Python packages.

Related to #2769.



if tuple(int(i) for i in pyarrow.__version__.split(".")[:3]) < (1, 0, 0):
if _version.parse(pyarrow.__version__).major < 1:
Copy link
Member Author

@albertvillanova albertvillanova Aug 10, 2021

Choose a reason for hiding this comment

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

I wonder why we make this validation here, as pyarrow least version is already pinned in setup.py install_requires.

Copy link
Member

Choose a reason for hiding this comment

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

Because in certain environments (google colab, kaggle kernels), it may create some issues.

For example on colab, pyarrow is already installed. When colab only had pyarrow 0.0.6, installing datasets would install pyarrow >= 1.0.0 BUT it would also require the kernel to be restarted for the update to take effect.
Because of that you could end up with an old version of pyarrow until your restart the kernel

Copy link
Member

@lhoestq lhoestq left a comment

Choose a reason for hiding this comment

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

Awesome ! This is much cleaner :)

@lhoestq lhoestq merged commit d03223d into huggingface:master Aug 18, 2021
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