Bug 244257 - textproc/py-textfsm: conflicts with py-texttable
Summary: textproc/py-textfsm: conflicts with py-texttable
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Kai Knoblich
URL: https://github.com/google/textfsm/rel...
Keywords:
Depends on:
Blocks:
 
Reported: 2020-02-21 01:01 UTC by John Hein
Modified: 2020-03-05 07:37 UTC (History)
1 user (show)

See Also:
kai: maintainer-feedback+
kai: merge-quarterly+


Attachments
[patch] move textfsm into site-packages/textfsm to avoid conflict with py-texttable (2.86 KB, patch)
2020-02-21 02:09 UTC, John Hein
no flags Details | Diff
py-textfsm-1.1.1.patch (1.77 KB, patch)
2020-02-21 09:16 UTC, Kai Knoblich
kai: maintainer-approval+
Details | Diff
py-textfsm-1.1.1-v2.patch (2.69 KB, patch)
2020-02-25 22:46 UTC, Kai Knoblich
kai: maintainer-approval+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description John Hein 2020-02-21 01:01:00 UTC
pkg-static: py37-textfsm-0.4.1 conflicts with py37-texttable-1.6.2 (installs files into the same place).  Problematic file: /usr/local/lib/python3.7/site-packages/__pycache__/texttable.cpython-37.opt-1.pyc

They both try to install texttable.py in site-packages.

I applied the bug to py-textfsm since py-texttable was in the tree first.

(Also textfsm is up to 1.1.0)
Comment 1 John Hein 2020-02-21 02:09:14 UTC
Created attachment 211788 [details]
[patch] move textfsm into site-packages/textfsm to avoid conflict with py-texttable

The attached patch moves the python "lib" files into site-packages/textfsm.

The user would do "import textfsm.clitable", for instance.

This solve the packaging conflict.  But the downside is that any existing scripts that expect 'import clitable' to work would have to be modified.

Adding textfsm/ to a .pth file doesn't help since the texttable naming conflict still exists.

Alternately the texttable.py could be renamed (texttable_fsm.py or something).  That's not great either unless upstream adopts the change.
Comment 2 Kai Knoblich freebsd_committer freebsd_triage 2020-02-21 09:16:43 UTC
Created attachment 211793 [details]
py-textfsm-1.1.1.patch

Hi John,

thank you for the patch and reporting the issue!  Although your patch resolves the packaging issue I was a bit surprised that there's already a 1.1.1 release out. [1]

So I was curious and tried also the 1.1.1 release and it seems that the problem is solved since the 1.1.0 release as the textproc/py-textfsm got its own subdirectory "textfsm".

Attached is a preliminary patch that updates textproc/py-textfsm to the 1.1.1 release that might resolve the issue.

----
[1] The reason why Portscout didn't send an e-mail is no surprise as upstream doesn't provide a sdist for PyPi since the 1.1.0 release.
Comment 3 John Hein 2020-02-24 22:24:08 UTC
Comment on attachment 211788 [details]
[patch] move textfsm into site-packages/textfsm to avoid conflict with py-texttable

Yes, the update to 1.1.1 works for me (by making a texfsm package and sticking everything in site-packages/textfsm/).  Your patch to update to 1.1.1 looks good to me (and briefly run-tested).

Should the site-packages/testdata/ directory be installed?
Comment 4 Kai Knoblich freebsd_committer freebsd_triage 2020-02-25 22:46:38 UTC
Created attachment 211941 [details]
py-textfsm-1.1.1-v2.patch

(In reply to John Hein from comment #3)

Thanks for testing and good catch regarding the "testdata" directory! I also stumbled on it during QA.

Here's an slightly updated patch that also patches out a line in "setup.py" to prevent the installation of the "testdata" directory with its contents.

It seems that the directory is only used by the testsuite. IMHO the directory should be omitted (as the updated patch does) or added as a subdirectory under "textfsm".

I'll do some final QA before committing the updated patch.
Comment 5 commit-hook freebsd_committer freebsd_triage 2020-03-05 07:17:44 UTC
A commit references this bug:

Author: kai
Date: Thu Mar  5 07:17:34 UTC 2020
New revision: 527810
URL: https://svnweb.freebsd.org/changeset/ports/527810

Log:
  textproc/py-textfsm: Update to 1.1.1

  This update resolves a package installation conflict with
  textproc/py-texttable as both ports installs "texttable.py" into the same
  place. [1]

  Also while I'm here:

  * Switch to GitHub for a while as no sdist tarballs are available at PyPi.

  * Make the port concurrent safe because it installs scripts outside of the
    site-lib directory.

  * Remove the "testdata" directory to prevent possible package conflicts as
    it's only required for the test suite.

  * Add a "do-test" target to make future QA easier.

  Changelog:

  https://github.com/google/textfsm/releases/tag/v1.1.0
  https://github.com/google/textfsm/releases/tag/v1.1.1

  PR:		244257
  Reported by:	John Hein <jcfyecrayz@liamekaens.com> [1]
  MFH:		2020Q1

Changes:
  head/textproc/py-textfsm/Makefile
  head/textproc/py-textfsm/distinfo
  head/textproc/py-textfsm/files/
  head/textproc/py-textfsm/files/patch-setup.py
Comment 6 Kai Knoblich freebsd_committer freebsd_triage 2020-03-05 07:26:45 UTC
(In reply to John Hein from comment #3)

Committed to the /head branch, once again thank you for reporting it and the initial patch!

I'm going to merge this also into the 2020Q1 branch, still waiting for approval from the ports-secteam.
Comment 7 commit-hook freebsd_committer freebsd_triage 2020-03-05 07:33:47 UTC
A commit references this bug:

Author: kai
Date: Thu Mar  5 07:32:55 UTC 2020
New revision: 527813
URL: https://svnweb.freebsd.org/changeset/ports/527813

Log:
  MFH: r527810

  textproc/py-textfsm: Update to 1.1.1

  This update resolves a package installation conflict with
  textproc/py-texttable as both ports installs "texttable.py" into the same
  place. [1]

  Also while I'm here:

  * Switch to GitHub for a while as no sdist tarballs are available at PyPi.

  * Make the port concurrent safe because it installs scripts outside of the
    site-lib directory.

  * Remove the "testdata" directory to prevent possible package conflicts as
    it's only required for the test suite.

  * Add a "do-test" target to make future QA easier.

  Changelog:

  https://github.com/google/textfsm/releases/tag/v1.1.0
  https://github.com/google/textfsm/releases/tag/v1.1.1

  PR:		244257
  Reported by:	John Hein <jcfyecrayz@liamekaens.com> [1]

  Approved by:	ports-secteam (joneum)

Changes:
_U  branches/2020Q1/
  branches/2020Q1/textproc/py-textfsm/Makefile
  branches/2020Q1/textproc/py-textfsm/distinfo
  branches/2020Q1/textproc/py-textfsm/files/
Comment 8 Kai Knoblich freebsd_committer freebsd_triage 2020-03-05 07:37:12 UTC
Changes were merged into the recent quartely branch, all done!