Re: How to call easy_install argparse after installation

2017-04-29 Thread Kubilay Kocak
On 4/28/17 7:06 PM, Hongjiang Zhang via freebsd-ports wrote:
> Hi all,
> 
> I'm trying to create a new ports app, which is a python application
> and depends on argparse. For python 2.7, argparse is builtin. 
> Unfortunately, when the app is starting, it complains:
> 
> pkg_resources.DistributionNotFound: The 'argparse' distribution was
> not found and is required by XXX
> 
> According to the argparse document, the fix is one of the followings.
> My question is how can I invoke "easy_install argparse" in my
> Makefile? By the way, argparse has already been removed from ports.
> 
> 1.  python setup.py install 2.  easy_install argparse 3.  pip install
> argparse 4.  putting argparse.py in some directory listed in sys.path
> should also work

Hi Hongjiang,

If the application or its author(s) need or want to maintain Python 2.6,
3.0, 3.1, 3.2 compatibility, the application needs to be fixed
(upstream) to only add the install_requires=['argparse'] dependency (in
setup.py) for versions ( < 2.7 OR ( > 3 AND < 3.2)). ie; only those
Python versions that *don't* contain argparse in their standard library.

In no cases should a FreeBSD port/package call easy_install, pip or
other respective setuptools/distutils functionality itself.

What I would try instead is to remove (patch out) the unconditional
install_requires=['argparse'] entry from setup.py, and test the
application functionality without it, as import argparse should "just
work" whether using the standard library or the package, and in
FreeBSD's case for all supported Python versions, argparse is available
built-in.

./koobs
___
freebsd-ports@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to "freebsd-ports-unsubscr...@freebsd.org"


How to call easy_install argparse after installation

2017-04-28 Thread Hongjiang Zhang via freebsd-ports
Hi all,

I'm trying to create a new ports app, which is a python application and depends 
on argparse. For python 2.7, argparse is builtin.
Unfortunately, when the app is starting, it complains:

pkg_resources.DistributionNotFound: The 'argparse' distribution was not found 
and is required by XXX

According to the argparse document, the fix is one of the followings. My 
question is how can I invoke "easy_install argparse" in my Makefile? By the 
way, argparse has already been removed from ports.

  1.  python setup.py install
  2.  easy_install argparse
  3.  pip install argparse
  4.  putting argparse.py in some directory listed in sys.path should also work

Thanks

Hongjiang Zhang

___
freebsd-ports@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to "freebsd-ports-unsubscr...@freebsd.org"