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

Allow wheels to determine the required dependencies #504

Merged
merged 1 commit into from Jan 5, 2018
Merged

Allow wheels to determine the required dependencies #504

merged 1 commit into from Jan 5, 2018

Conversation

MinchinWeb
Copy link
Contributor

This allows universal wheels to be generated and reliably installed.

Background

Version 0.11 (of arrow) introduced caching, but based on a feature that was added to the Python standard library post-2.7. This meant that arrow became un-usable with Python 2.7.

Version 0.12 was released to fix the above problem. It did this by adding the following code to setup.py:

install_requires = ['python-dateutil']
if sys.version_info[0] < 3:
    install_requires.append('backports.functools_lru_cache==1.2.1')

This code declares the required dependency, but requires code to run on install to do so. Wheels do not run code at install time, rather code is run on wheel generation. This meant that generated wheels would either always require this backports package (if the wheel was generated by a system running Python 2.7) or never require it (if the wheel was generated by a system running Python 3). Even though arrow does not provide wheels on PyPI, this can still cause issues. This is because pip, on end user machines, will generate and cache a wheel when downloading source distributions (like arrow provides), and this pip cache, and thus the generated wheel, is shared by all version of Python installed on the end user's machine, and used for later installs.

Solution

This PR declares the required dependency in a conditional way that wheel can read it on install.

Further Reading

@MinchinWeb
Copy link
Contributor Author

This also address #497, #499

@codecov-io
Copy link

codecov-io commented Dec 11, 2017

Codecov Report

Merging #504 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@          Coverage Diff          @@
##           master   #504   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files          14     14           
  Lines        3189   3189           
  Branches      229    229           
=====================================
  Hits         3189   3189

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 66ac193...61f4808. Read the comment docs.

@Gr1N
Copy link

Gr1N commented Dec 17, 2017

We really need this PR, I have so much pain with my builds on CI now...

@crsmithdev could you please take a look?

setup.py Outdated
install_requires=install_requires,
install_requires=[
'python-dateutil',
],
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you just fix this alignment? Just remove 4 spaces, everything else is LGTM.

@MinchinWeb
Copy link
Contributor Author

@ramonsaraiva updated (I believe) as you requested! Everything should be good to go!

Copy link
Contributor

@ramonsaraiva ramonsaraiva left a comment

Choose a reason for hiding this comment

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

LGTM

@ramonsaraiva ramonsaraiva merged commit abeb2c2 into arrow-py:master Jan 5, 2018
@MinchinWeb MinchinWeb deleted the conditional-dependencies branch January 5, 2018 19:03
@Gr1N
Copy link

Gr1N commented Jan 8, 2018

@ramonsaraiva, could you please upload new version of package with fix? There are too many people (#495) which are waiting for new version.

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.

None yet

4 participants