Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
importlib in pip requirements file
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  4 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Jason Baker  
View profile  
 More options May 4 2011, 2:18 pm
From: Jason Baker <amnorv...@gmail.com>
Date: Wed, 4 May 2011 11:18:04 -0700 (PDT)
Local: Wed, May 4 2011 2:18 pm
Subject: importlib in pip requirements file
If I try to install importlib in Python 2.7, I get the following:

Downloading/unpacking importlib (from -r dev-requires.txt (line 8))
  Downloading importlib-1.0.2.tar.bz2
  Running setup.py egg_info for package importlib
    Traceback (most recent call last):
      File "<string>", line 14, in <module>
      File "/home/jason/src/apture/build/importlib/setup.py", line 6,
in <module>
        raise Exception("importlib is included in Python 2.7 and newer
for 2.x")
    Exception: importlib is included in Python 2.7 and newer for 2.x
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):

  File "<string>", line 14, in <module>

  File "/home/jason/src/apture/build/importlib/setup.py", line 6, in
<module>

    raise Exception("importlib is included in Python 2.7 and newer for
2.x")

Exception: importlib is included in Python 2.7 and newer for 2.x

This makes it kind of a pain to keep a requirements file that works
with both python 2.6 and 2.7.  Has anyone found a way around this?  I
suppose the ideal solution would be to have a way to not install
certain dependencies for certain python versions, but that may be
overkill for just this one library.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ian Bicking  
View profile  
 More options May 4 2011, 2:33 pm
From: Ian Bicking <i...@colorstudy.com>
Date: Wed, 4 May 2011 13:33:55 -0500
Local: Wed, May 4 2011 2:33 pm
Subject: Re: [venv] importlib in pip requirements file

If you have a library that uses importlib and you can do:

install_requires = [...]

if sys.version_info < (2, 7):
    install_requires.append('importlib')

setup(..., install_requires=install_requires)

This won't work with pip freeze (which may still freeze or not freeze in
importlib), but you can fix that up, and it will basically do what you want.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Carl Meyer  
View profile  
 More options May 4 2011, 3:34 pm
From: Carl Meyer <c...@oddbird.net>
Date: Wed, 04 May 2011 14:34:56 -0500
Local: Wed, May 4 2011 3:34 pm
Subject: Re: [venv] importlib in pip requirements file

On 05/04/2011 01:18 PM, Jason Baker wrote:

Yeah, I'm not really sure how to solve this in a requirements file - I
don't think we want to start complexifying the format with things like
conditionals.

A request was filed recently for an option for pip to not bomb out
entirely if a single package fails, but continue with the rest and
report which one(s) failed. I'm not sure how such an option would
interact with dependencies, but it occurs to me that option might help
in this situation, too.

Otherwise, about all I can recommend is a python26-requirements.txt file
that looks like this:

importlib
-r requirements.txt

Carl


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Paul Nasrat  
View profile  
 More options May 4 2011, 5:09 pm
From: Paul Nasrat <pnas...@gmail.com>
Date: Wed, 4 May 2011 22:09:23 +0100
Local: Wed, May 4 2011 5:09 pm
Subject: Re: [venv] importlib in pip requirements file
On 4 May 2011 20:34, Carl Meyer <c...@oddbird.net> wrote:

I'm curious if we could support a limited set similiar to

http://www.python.org/dev/peps/pep-0345/#version-specifiers

I guess there is also a question of where is the authority for modules
that have been imported into stdlib where backports exist. We could
specifically 'know' that if you are > python2.7 importlib is satisfied
as an internal dependency. It'd be like listing urllib2 or some such
in the requirements - which interestingly does:

pip install urllib2
Downloading/unpacking urllib2
  Real name of requirement urllib2 is urllib3
  Could not find any downloads that satisfy the requirement urllib2
No distributions at all found for urllib2
Storing complete log in /Users/pnasrat/.pip/pip.log

Currently we assume all requirements are external, so don't handle this well.

> A request was filed recently for an option for pip to not bomb out
> entirely if a single package fails, but continue with the rest and
> report which one(s) failed. I'm not sure how such an option would
> interact with dependencies, but it occurs to me that option might help
> in this situation, too.

I've taken a look at that bug whilst triaging, and I think we probably
need to break down the use cases for that a bit more.  I can see the
case for where you type

pip install foo bar baz

Where there is no relationship between them and say you mistyped one
should the whole thing succeed or fail. I guess it comes down to do we
want pip install to be transactional or operate on partial sets. As
you said dependencies make that more complex, and it doesn't help that
we don't have a complete set of metadata to figure out the dependency
graph at the start of the operation IIRC

Paul


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »