[Distutils] How to exclude a directory from a module that has tests?

2015-11-13 Thread Nagy László Zsolt
  Hello,

My source distribution contains a single module. It is **not** a
package. I have used this:


setup(name='yubistorm',
  version=__version__,
  description='Asnychronous two factor authentication client for
YubiCloud with Tornado',
  long_description="""Provides a simple module that can be used from
a Tornado server to authenticate users """ +
   """ with YubiCloud
(https://www.yubico.com/products/services-software/yubicloud/)""",
  author='László Zsolt Nagy',
  author_email='nagy...@gmail.com',
  license="LGPL v3",
  py_modules=['yubistorm'],
  requires=['tornado (>=4.3)'],
  url="https://bitbucket.org/nagylzs/yubistorm";,
  classifiers=[
'Topic :: Security', 'Topic :: Internet :: WWW/HTTP',
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: Implementation :: CPython",
],
  )

The problem is that there is a "test" directory and it is added to the
source distribution. I want to exclude that. I know that there is an
"exclude" parameter for find_packages(). But this is not a package. This
is a single module. How do I exclude a directory then?

Thanks,

   Laszlo

___
Distutils-SIG maillist  -  Distutils-SIG@python.org
https://mail.python.org/mailman/listinfo/distutils-sig


Re: [Distutils] Current PyPI storage requirements?

2015-11-13 Thread Donald Stufft

> On Nov 13, 2015, at 2:07 AM, Nick Coghlan  wrote:
> 
> This isn't an urgent question, but rather a "if the stats are readily
> available, I'm curious as to the answer" one: what are PyPi's current
> storage requirements? The warehouse.python.org front page indicates
> how many objects there are, but not the amount of space they take up.


According to the usage reports in Amazon S3, we’re looking at roughly 215GB for 
PyPI and 10GB for TestPyPI.

-
Donald Stufft
PGP: 0x6E3CBCE93372DCFA // 7C6B 7C5D 5E2B 6356 A926 F04F 6E3C BCE9 3372 DCFA



signature.asc
Description: Message signed with OpenPGP using GPGMail
___
Distutils-SIG maillist  -  Distutils-SIG@python.org
https://mail.python.org/mailman/listinfo/distutils-sig


[Distutils] "option --single-version-externally-managed not recognized" when pip install mysql-connector-python-rf

2015-11-13 Thread Chris Withers

Hi All,

My Travis nightly builds of a package started failing this morning with 
the following:


https://travis-ci.org/Mortar/mortar_rdb/jobs/90919221

pip install mysql-connector-python-rf

You are using pip version 6.0.7, however version 7.1.2 is available.

You should consider upgrading via the 'pip install --upgrade pip' command.

Collecting mysql-connector-python-rf

Downloading mysql-connector-python-rf-2.1.3.tar.gz (271kB)

100% || 274kB 2.1MB/s

Installing collected packages: mysql-connector-python-rf

Running setup.py install for mysql-connector-python-rf

usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]

or: -c --help [cmd1 cmd2 ...]

or: -c --help-commands

or: -c cmd --help

error: option --single-version-externally-managed not recognized

Complete output from command 
/home/travis/virtualenv/python3.4.2/bin/python -c "import setuptools, 
tokenize;__file__='/tmp/pip-build-_f5a57lj/mysql-connector-python-rf/setup.py';exec(compile(getattr(tokenize, 
'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 
'exec'))" install --record /tmp/pip-jd_zku67-record/install-record.txt 
--single-version-externally-managed --compile --install-headers 
/home/travis/virtualenv/python3.4.2/include/site/python3.4:


usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]

or: -c --help [cmd1 cmd2 ...]

or: -c --help-commands

or: -c cmd --help

error: option --single-version-externally-managed not recognized

mysql-connector-python-rf hasn't changed in ages, and I haven't pushed 
any commits to mortar_rdb in some time.

Has pip or setuptools changed in the last 24 hrs?
This something that might have changed on TravisCI?

cheers,

Chris
___
Distutils-SIG maillist  -  Distutils-SIG@python.org
https://mail.python.org/mailman/listinfo/distutils-sig


Re: [Distutils] How to exclude a directory from a module that has tests?

2015-11-13 Thread Ionel Cristian Mărieș
On Fri, Nov 13, 2015 at 1:50 PM, Nagy László Zsolt 
wrote:

> The problem is that there is a "test" directory and it is added to the
> source distribution. I want to exclude that. I know that there is an
> "exclude" parameter for find_packages(). But this is not a package. This is
> a single module. How do I exclude a directory then?


​People usually include the tests in their sdist - you might want to do
that too. If you still don't then you can control the contents of sdist via
MANIFEST.in - "test"​ is inlcuded by default afaik so just add a "prune
test" in MANIFEST.in. Still, take note that sdist is not what gets
installed in site-packages, so you should have all your source files in it.
IOW: don't do prune test.



Thanks,
-- Ionel Cristian Mărieș, http://blog.ionelmc.ro
___
Distutils-SIG maillist  -  Distutils-SIG@python.org
https://mail.python.org/mailman/listinfo/distutils-sig


Re: [Distutils] "option --single-version-externally-managed not recognized" when pip install mysql-connector-python-rf

2015-11-13 Thread Ionel Cristian Mărieș
On Fri, Nov 13, 2015 at 2:26 PM, Chris Withers 
wrote:

> ​​
> mysql-connector-python-rf hasn't changed in ages


​Looks like ​mysql-connector-python-rf 2.1.3 was released today, strange
setup.py customization inside ...



Thanks,
-- Ionel Cristian Mărieș, http://blog.ionelmc.ro
___
Distutils-SIG maillist  -  Distutils-SIG@python.org
https://mail.python.org/mailman/listinfo/distutils-sig


Re: [Distutils] "option --single-version-externally-managed not recognized" when pip install mysql-connector-python-rf

2015-11-13 Thread Chris Withers

On 13/11/2015 12:56, Ionel Cristian Mărieș wrote:


On Fri, Nov 13, 2015 at 2:26 PM, Chris Withers > wrote:


​​
mysql-connector-python-rf hasn't changed in ages


​Looks like ​mysql-connector-python-rf 2.1.3 was released today, 
strange setup.py customization inside ...

Good spot, sorry I missed that.

Anyone happen to know how to contact the ​mysql-connector-python 
maintainers? All the links from pypi are pretty devoid of content...


Chris

___
Distutils-SIG maillist  -  Distutils-SIG@python.org
https://mail.python.org/mailman/listinfo/distutils-sig


Re: [Distutils] The future of invoking pip

2015-11-13 Thread Chris Barker
On Thu, Nov 12, 2015 at 11:16 PM, Nathaniel Smith  wrote:

> >  > If we waved our hands and were able to magically make Python package
> >> management perfect, what would that look like?
> >
> > well, I think the command would be:
> >
> > python install package_name
> >
> > I know there are good reasons to keep package installer development out
> of
> > core, but if have ensurepip-- we could do this.
>
> 1) What about 'pip uninstall', 'pip freeze', 'pip list', 'pip show',
> 'pip search', 'pip wheel'?
>

hmm -- half of those are "advanced" features, but yes, there are a few that
newbies want easy access to, so how about :

python pip install
python pip search
...

just doesn't need the  "-m" -- which is a bit of advanced python voodoo
(OK, not very advanced...)

or maybe:

python install search
python install list
python install 

though that would make it tough to have a package called "search", etc...

what I'm getting at is that it makes plenty of sense for package management
to be seen as a feature of the python interpreter itself -- maybe slightly
more typing that "pip" (less than easy_install?) -- but no one is going to
be surprised that you use python to manage your python installation.

\2) If it requires python 3.6 it's kinda a non-starter...
>

well, this was a response to "magically make Python package management
perfect"

but anyway, there is always 2.7.11 :-) -- or would it even be possible to
hack a change to the command line handling with a package install? somehow
I doubt it.

and it may not be SO bad to require the -m pip for all legacy versions

-CHB


-- 

Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

chris.bar...@noaa.gov
___
Distutils-SIG maillist  -  Distutils-SIG@python.org
https://mail.python.org/mailman/listinfo/distutils-sig


Re: [Distutils] Installing packages using pip

2015-11-13 Thread Chris Barker
On Fri, Nov 6, 2015 at 8:06 AM, Paul Moore  wrote:

> That's the correct command, but you need to run it from the Windows
> command prompt, not from within IDLE.
>

Now that we are talking about how to invoke the installer on other
threads...

This is NOT the least bit a rare mistake for newbies. Maybe we should have
a way to install right from inside the python REPL.

That would certainly clear up the "which python is this going to get
installed into" problem.

-CHB







-- 

Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

chris.bar...@noaa.gov
___
Distutils-SIG maillist  -  Distutils-SIG@python.org
https://mail.python.org/mailman/listinfo/distutils-sig


Re: [Distutils] Installing packages using pip

2015-11-13 Thread Alexander Walters

import pip
pip.install(PACKAGESPEC)

something like that?

On 11/13/2015 12:42, Chris Barker wrote:
On Fri, Nov 6, 2015 at 8:06 AM, Paul Moore > wrote:


That's the correct command, but you need to run it from the Windows
command prompt, not from within IDLE.


Now that we are talking about how to invoke the installer on other 
threads...


This is NOT the least bit a rare mistake for newbies. Maybe we should 
have a way to install right from inside the python REPL.


That would certainly clear up the "which python is this going to get 
installed into" problem.


-CHB






--

Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

chris.bar...@noaa.gov 


___
Distutils-SIG maillist  -  Distutils-SIG@python.org
https://mail.python.org/mailman/listinfo/distutils-sig


___
Distutils-SIG maillist  -  Distutils-SIG@python.org
https://mail.python.org/mailman/listinfo/distutils-sig


Re: [Distutils] Installing packages using pip

2015-11-13 Thread Nathaniel Smith
On Nov 13, 2015 12:00 PM, "Alexander Walters" 
wrote:
>
> import pip
> pip.install(PACKAGESPEC)
>
> something like that?

This would be extremely handy if it could be made to work reliably... But
I'm skeptical about whether it can be made to work reliably. Consider all
the fun things that could happen once you start upgrading packages while
python is running, and might e.g. have half of an upgraded package already
loaded into memory. It's like the reloading problem but even more so.

-n
___
Distutils-SIG maillist  -  Distutils-SIG@python.org
https://mail.python.org/mailman/listinfo/distutils-sig


Re: [Distutils] Installing packages using pip

2015-11-13 Thread Chris Barker
On Fri, Nov 13, 2015 at 12:09 PM, Nathaniel Smith  wrote:

> On Nov 13, 2015 12:00 PM, "Alexander Walters" 
> wrote:
> >
> > import pip
> > pip.install(PACKAGESPEC)
> >
> > something like that?
>
> This would be extremely handy if it could be made to work reliably... But
> I'm skeptical about whether it can be made to work reliably. Consider all
> the fun things that could happen once you start upgrading packages while
> python is running, and might e.g. have half of an upgraded package already
> loaded into memory. It's like the reloading problem but even more so.
>
indeed -- does seem risky.

also, if were are in fantasy land, and want to be really newbie friendly, a
new built in:

pip.install(PACKAGESPEC)

with no import required

-CHB


-- 

Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

chris.bar...@noaa.gov
___
Distutils-SIG maillist  -  Distutils-SIG@python.org
https://mail.python.org/mailman/listinfo/distutils-sig


Re: [Distutils] Installing packages using pip

2015-11-13 Thread Alexander Walters
While I like the concept of calling pip via an api (and let me pat 
myself on the back for suggesting it in the first place in this thread), 
I honestly think that if it is something that is allowed, it should be 
implemented with a fair bit of guards.  It would probably end up being a 
power-user feature - something to help manage deployments in some tricky 
environments - than a newbie feature.


Python is an IDE-less language, and I say this knowing full well what 
IDLE is.  We don't default to eclipse like java does, or Visual Studio 
like .NET languages (and C(++) on windows).  We do not have the default 
tooling in place to avoid using the command line. Learning the command 
line is a vital skill for newbies.


Now, while this thread may or may not be about Windows newbies 
specifically, I do not tend to see this brought up for *nix newbies.  Is 
this because we assume that a *nix user will have to know the command 
line?  or that they are inherently power users?  If it is the latter, 
then I need to say that being a programmer also means being a power 
user.  We should guide new users to power user tools (the command line, 
powershell, etc), instead of trying to bend python to regular users who 
will eventually be power users anyways.


I guess I am suggesting maybe we try and find a way to shallow the 
learning curve into using the command line than to just implement 
commands in the repl itself.


all that said, IDLE could be tooled to intercept the syntax 'pip install 
foo' and print a more helpful message.


On 11/13/2015 15:27, Chris Barker wrote:



On Fri, Nov 13, 2015 at 12:09 PM, Nathaniel Smith > wrote:


On Nov 13, 2015 12:00 PM, "Alexander Walters"
mailto:tritium-l...@sdamon.com>> wrote:
>
> import pip
> pip.install(PACKAGESPEC)
>
> something like that?

This would be extremely handy if it could be made to work
reliably... But I'm skeptical about whether it can be made to work
reliably. Consider all the fun things that could happen once you
start upgrading packages while python is running, and might e.g.
have half of an upgraded package already loaded into memory. It's
like the reloading problem but even more so.

indeed -- does seem risky.

also, if were are in fantasy land, and want to be really newbie 
friendly, a new built in:


pip.install(PACKAGESPEC)

with no import required

-CHB


--

Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

chris.bar...@noaa.gov 


___
Distutils-SIG maillist  -  Distutils-SIG@python.org
https://mail.python.org/mailman/listinfo/distutils-sig


Re: [Distutils] Installing packages using pip

2015-11-13 Thread R. David Murray
On Fri, 13 Nov 2015 12:09:28 -0800, Nathaniel Smith  wrote:
> On Nov 13, 2015 12:00 PM, "Alexander Walters" 
> wrote:
> >
> > import pip
> > pip.install(PACKAGESPEC)
> >
> > something like that?
> 
> This would be extremely handy if it could be made to work reliably... But
> I'm skeptical about whether it can be made to work reliably. Consider all
> the fun things that could happen once you start upgrading packages while
> python is running, and might e.g. have half of an upgraded package already
> loaded into memory. It's like the reloading problem but even more so.

If I remember correctly, this is something that R supports that I
thought was cool when I saw it.  We could have a command analogous
to the 'help' command, so you wouldn't even have to do an explicit
import.  But yeah, making it work may be hard.

--David
___
Distutils-SIG maillist  -  Distutils-SIG@python.org
https://mail.python.org/mailman/listinfo/distutils-sig


Re: [Distutils] Installing packages using pip

2015-11-13 Thread Nathaniel Smith
On Nov 13, 2015 3:07 PM, "R. David Murray"  wrote:
>
> On Fri, 13 Nov 2015 12:09:28 -0800, Nathaniel Smith  wrote:
> > On Nov 13, 2015 12:00 PM, "Alexander Walters" 
> > wrote:
> > >
> > > import pip
> > > pip.install(PACKAGESPEC)
> > >
> > > something like that?
> >
> > This would be extremely handy if it could be made to work reliably...
But
> > I'm skeptical about whether it can be made to work reliably. Consider
all
> > the fun things that could happen once you start upgrading packages while
> > python is running, and might e.g. have half of an upgraded package
already
> > loaded into memory. It's like the reloading problem but even more so.
>
> If I remember correctly, this is something that R supports that I
> thought was cool when I saw it.  We could have a command analogous
> to the 'help' command, so you wouldn't even have to do an explicit
> import.  But yeah, making it work may be hard.

Yeah, I've long used this in R and it really is awesome -- I wasn't kidding
in the first sentence I wrote above :-). It leads to a really short
frustration cycle:

>>> import somepkg
error
>>> install("somepkg")
installing...done.
>>> import somepkg
:-)

But details of R's execution model make this easier to do. Maybe it could
be supported for the special case of installing new packages with no
upgrades?

A good way to environment with the possibilities would be to write a %pip
magic for ipython:

http://ipython.readthedocs.org/en/stable/interactive/tutorial.html#magic-functions
http://ipython.readthedocs.org/en/stable/config/custommagics.html

-n
___
Distutils-SIG maillist  -  Distutils-SIG@python.org
https://mail.python.org/mailman/listinfo/distutils-sig