changeset 1997:85390446f8c1

packaging: fix setup.py and install as hgext3rd.topic This changeset is doing two things (gasp): - It fixes various errors in the setup.py - It move the topic source and install into hgext3rd.topic. This last part (code source move) use hgext3rd as namespace package to prevent installation nightmare. This won't be officially supported until Mercurial 3.8, but in the meantime, 3.7 user can enable it using the full package name: [extensions] hgext3rd.topic= Thanks goes to Julien Cristau <julien.cristau@logilab.fr> for the initial version of this.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Thu, 17 Mar 2016 09:12:18 -0700
parents b65f39791f92
children 93cf0ddb5234
files README.md hgext3rd/__init__.py hgext3rd/topic/__init__.py hgext3rd/topic/constants.py hgext3rd/topic/destination.py hgext3rd/topic/discovery.py hgext3rd/topic/revset.py hgext3rd/topic/stack.py hgext3rd/topic/topicmap.py setup.py src/topic/__init__.py src/topic/constants.py src/topic/destination.py src/topic/discovery.py src/topic/revset.py src/topic/stack.py src/topic/topicmap.py tests/testlib
diffstat 11 files changed, 11 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/README.md
+++ b/README.md
@@ -13,3 +13,8 @@
 
     [extensions]
     topics=path/to/hg-topics/src
+
+If you are using Mercurial 3.7 use:
+
+    [extensions]
+    hgext3rd.topics=path/to/hg-topics/src
new file mode 100644
--- /dev/null
+++ b/hgext3rd/__init__.py
@@ -0,0 +1,3 @@
+from __future__ import absolute_import
+import pkgutil
+__path__ = pkgutil.extend_path(__path__, __name__)
rename from src/topic/__init__.py
rename to hgext3rd/topic/__init__.py
rename from src/topic/constants.py
rename to hgext3rd/topic/constants.py
rename from src/topic/destination.py
rename to hgext3rd/topic/destination.py
rename from src/topic/discovery.py
rename to hgext3rd/topic/discovery.py
rename from src/topic/revset.py
rename to hgext3rd/topic/revset.py
rename from src/topic/stack.py
rename to hgext3rd/topic/stack.py
rename from src/topic/topicmap.py
rename to hgext3rd/topic/topicmap.py
--- a/setup.py
+++ b/setup.py
@@ -14,9 +14,9 @@
     maintainer_email='augie@google.com',
     url='http://bitbucket.org/durin42/hg-topics/',
     description='Experimental tinkering with workflow ideas for topic branches.',
-    long_description=open('README').read(),
+    long_description=open('README.md').read(),
     keywords='hg mercurial',
     license='GPLv2+',
-    py_modules=['src'],
+    packages=['hgext3rd.topic'],
     install_requires=requires,
 )
--- a/tests/testlib
+++ b/tests/testlib
@@ -12,4 +12,4 @@
 [extensions]
 rebase=
 EOF
-echo "topic=$(echo $(dirname $TESTDIR))/src/topic" >> $HGRCPATH
+echo "topic=$(echo $(dirname $TESTDIR))/hgext3rd/topic" >> $HGRCPATH