Bug 183477 - [patch] databases/py-mysql2pgsql dependency fix
Summary: [patch] databases/py-mysql2pgsql dependency fix
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Kubilay Kocak
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-10-30 11:40 UTC by Serhii (Sergey) Kozlov
Modified: 2013-12-05 11:40 UTC (History)
0 users

See Also:


Attachments
file.diff (609 bytes, patch)
2013-10-30 11:40 UTC, Serhii (Sergey) Kozlov
no flags Details | Diff
script.txt (721 bytes, text/plain; charset=windows-1251)
2013-10-30 13:56 UTC, Serhii (Sergey) Kozlov
no flags Details
py-mysql2pgsql-argparse-fix.patch (1.07 KB, patch)
2013-11-30 05:42 UTC, koobs
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Serhii (Sergey) Kozlov freebsd_committer freebsd_triage 2013-10-30 11:40:00 UTC
Dependencies don't cover py-argparse, which is required to run py-mysql2pgsql.

Fix: Patch attached with submission follows:
How-To-Repeat: Install py-mysql2pgsql onto a clean system, run py-mysql2pgsql, get the traceback.
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2013-10-30 11:40:14 UTC
Responsible Changed
From-To: freebsd-ports-bugs->freebsd-python

freebsd-python@ wants this port PRs (via the GNATS Auto Assign Tool)
Comment 2 Edwin Groothuis freebsd_committer freebsd_triage 2013-10-30 11:40:15 UTC
Maintainer of databases/py-mysql2pgsql,

Please note that PR ports/183477 has just been submitted.

If it contains a patch for an upgrade, an enhancement or a bug fix
you agree on, reply to this email stating that you approve the patch
and a committer will take care of it.

The full text of the PR can be found at:
    http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/183477

-- 
Edwin Groothuis via the GNATS Auto Assign Tool
edwin@FreeBSD.org
Comment 3 Edwin Groothuis freebsd_committer freebsd_triage 2013-10-30 11:40:16 UTC
State Changed
From-To: open->feedback

Awaiting maintainers feedback (via the GNATS Auto Assign Tool)
Comment 4 c.kworr 2013-10-30 13:13:38 UTC
Hi all.

I object, argparse is installed as part of lang/python27 (pkg-plist:136).

Can I see detailed error message?

-- 
Sphinx of black quartz, judge my vow.
Comment 5 Serhii (Sergey) Kozlov freebsd_committer freebsd_triage 2013-10-30 13:56:14 UTC
Sure.
Comment 6 c.kworr 2013-10-30 14:57:32 UTC
No objections then. If distribute really wants it that way I think it's 
easier to put it in.

-- 
Sphinx of black quartz, judge my vow.
Comment 7 koobs 2013-11-30 05:42:53 UTC
Volodymyr is correct, argparse is part of the standard library in 2.7
and 3.2+, and py-mysql2pgsql is *incorrectly* including argparse
unconditionally in install_requires.

I have just committed a fix to the devel/py-tox port [1], to correctly
model the conditional inclusion of argparse based on Python version,
that the tox authors correctly specify in their setup.py [2] after a
similar bug report [3]

[1] http://svnweb.freebsd.org/ports?view=revision&revision=335263
[2]
https://bitbucket.org/hpk42/tox/diff/setup.py?diff2=f20abdbeb930&at=default
[3] https://bitbucket.org/hpk42/tox/issue/5

I have attached a patch to pymysql2pgsql to do the same, I suggest
someone open an issue or submit a Pull Request, so it is fixed upstream:

https://github.com/philipsoutham/py-mysql2pgsql/

Comment 8 c.kworr 2013-12-03 07:43:42 UTC
30.11.2013 07:42, Kubilay Kocak wrote:
> Volodymyr is correct, argparse is part of the standard library in 2.7
> and 3.2+, and py-mysql2pgsql is *incorrectly* including argparse
> unconditionally in install_requires.
>
> I have just committed a fix to the devel/py-tox port [1], to correctly
> model the conditional inclusion of argparse based on Python version,
> that the tox authors correctly specify in their setup.py [2] after a
> similar bug report [3]
>
> [1] http://svnweb.freebsd.org/ports?view=revision&revision=335263
> [2]
> https://bitbucket.org/hpk42/tox/diff/setup.py?diff2=f20abdbeb930&at=default
> [3] https://bitbucket.org/hpk42/tox/issue/5
>
> I have attached a patch to pymysql2pgsql to do the same, I suggest
> someone open an issue or submit a Pull Request, so it is fixed upstream:
>
> https://github.com/philipsoutham/py-mysql2pgsql/

Fixed there, next version will contain the fix. I hope I'll branch it 
Real Soon Now (TM), when triggers and longblobs will pass tests.

-- 
Sphinx of black quartz judge my vow.
Comment 9 c.kworr 2013-12-04 15:21:44 UTC
To clarify things - I hadn't said that I will release new version right 
now but rather added this fix for the future. The patch should be added 
to the port too so that current version would be fixed.
-- 
Sphinx of black quartz, judge my vow.
Comment 10 Kubilay Kocak freebsd_committer freebsd_triage 2013-12-05 09:41:28 UTC
Responsible Changed
From-To: freebsd-python->koobs

I'll take it.
Comment 11 dfilter service freebsd_committer freebsd_triage 2013-12-05 11:39:46 UTC
Author: koobs
Date: Thu Dec  5 11:39:38 2013
New Revision: 335660
URL: http://svnweb.freebsd.org/changeset/ports/335660

Log:
  databases/py-mysql2pgsql: Fix argparse dependency
  
  argparse was missing from this ports RUN_DEPENDS, causing errors on imports.
  
  argparse is avaiilable in the Python 2.7 and 3.2+ standard libraries so patch
  setup.py to only require it for those versions.
  
  Patch has been committed upstream and won't be necessary for the next release.
  
  While I'm here, enable STAGE support.
  
  PR:		ports/183477
  Submitted by:	koobs
  Approved by:	Volodymyr Kostyrko <c.kworr@gmail.com> (maintainer)

Added:
  head/databases/py-mysql2pgsql/files/
  head/databases/py-mysql2pgsql/files/patch-setup.py   (contents, props changed)
Modified:
  head/databases/py-mysql2pgsql/Makefile

Modified: head/databases/py-mysql2pgsql/Makefile
==============================================================================
--- head/databases/py-mysql2pgsql/Makefile	Thu Dec  5 11:19:00 2013	(r335659)
+++ head/databases/py-mysql2pgsql/Makefile	Thu Dec  5 11:39:38 2013	(r335660)
@@ -2,6 +2,7 @@
 
 PORTNAME=	mysql2pgsql
 PORTVERSION=	0.1.6
+PORTREVISION=	1
 CATEGORIES=	databases python
 PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
 DISTNAME=	py-${PORTNAME}-${PORTVERSION}
@@ -28,5 +29,4 @@ GH_COMMIT=	250cb1c
 GH_PROJECT=	py-${PORTNAME}
 GH_TAGNAME=	v${PORTVERSION}
 
-NO_STAGE=	yes
 .include <bsd.port.mk>

Added: head/databases/py-mysql2pgsql/files/patch-setup.py
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/databases/py-mysql2pgsql/files/patch-setup.py	Thu Dec  5 11:39:38 2013	(r335660)
@@ -0,0 +1,27 @@
+--- ./setup.py.orig	2012-09-12 19:25:34.000000000 +1000
++++ ./setup.py	2013-12-05 21:21:46.941032294 +1100
+@@ -1,17 +1,22 @@
+ import os
++import sys
+ from setuptools import setup
+ 
+ install_requires = [
+     'mysql-python>=1.2.3', 
+     'psycopg2>=2.4.2',
+     'pyyaml>=3.10.0',
+-    'argparse',
+     'pytz',
+ ]
+ 
+ if os.name == 'posix':
+     install_requires.append('termcolor>=1.1.0')
+-    
++
++version = sys.version_info[:2]
++
++if version < (2,7) or (3,0) <= version <= (3,1):
++    install_requires += ['argparse']
++
+ setup(
+     name='py-mysql2pgsql',
+     version='0.1.6',
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
Comment 12 Kubilay Kocak freebsd_committer freebsd_triage 2013-12-05 11:40:49 UTC
State Changed
From-To: feedback->closed

Committed with changes. I have added a note to the upstream GitHub 
commit as well. Thanks!