Skip to content

sdist cannot be installed on Python 2 #51

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

Closed
jaraco opened this issue May 24, 2019 · 5 comments
Closed

sdist cannot be installed on Python 2 #51

jaraco opened this issue May 24, 2019 · 5 comments

Comments

@jaraco
Copy link
Member

jaraco commented May 24, 2019

Attempting to install pep517 from an sdist on Python 2.7 results in an error:

~ $ python2.7 -m pip install --no-binary=:all: pep517                                                                                                                          
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.
Collecting pep517
  Using cached https://files.pythonhosted.org/packages/79/27/1e6a8ba83dab2b243e1020e340552c129b0076fbb5518e0c2a9c44c7d056/pep517-0.5.0.tar.gz
  Installing build dependencies ... error
  Complete output from command /usr/local/opt/python@2/bin/python2.7 /usr/local/lib/python2.7/site-packages/pip install --ignore-installed --no-user --prefix /private/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-build-env-sq1HqN/overlay --no-warn-script-location --no-binary :all: --only-binary :none: -i https://pypi.org/simple -- flit:
  DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.
  Collecting flit
    Could not find a version that satisfies the requirement flit (from versions: )
  No matching distribution found for flit
  
  ----------------------------------------
Command "/usr/local/opt/python@2/bin/python2.7 /usr/local/lib/python2.7/site-packages/pip install --ignore-installed --no-user --prefix /private/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-build-env-sq1HqN/overlay --no-warn-script-location --no-binary :all: --only-binary :none: -i https://pypi.org/simple -- flit" failed with error code 1 in None
@duckinator
Copy link
Contributor

duckinator commented Oct 29, 2019

I think what's happening is that Pip tries to install+run Flit due to pep517's pyproject.toml.

However, if I'm understanding Flit's README correctly, you need Python 3 to run Flit, but Flit can distribute Python 2 modules.

If that's the case, I think that means you can never install Flit-produced sdists on Python 2?

@duckinator
Copy link
Contributor

duckinator commented Oct 29, 2019

Flit's pyproject.toml seems to confirm what I suspected:

requires-python=">=3"

@takluyver
Copy link
Member

Yes, having a bit of trouble with that. Before PEP 517, it was fine: flit would generate a setup.py which worked with setuptools for Python 2 or 3. Now that PEP 517 is in effect, tools need to install flit first.

I'm considering making the core parts of flit Python 2 compatible to allow that. I'm just dragging my feet because it's late 2019, and it feels backwards to be porting code back to Python 2.

@takluyver
Copy link
Member

It can now be installed from source with pip install --no-binary=pep517 pep517.

There's some bootstrapping problem I'm still investigating which prevents it from working with --no-binary=:all: (which means building flit_core from source too) at the moment.

@takluyver
Copy link
Member

The bootstrapping problem is pypa/pip#6599 - I've just made a PR for that.

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

No branches or pull requests

3 participants