Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setup.py install fails when building repo cloned from Github #2

Open
vladak opened this issue Feb 5, 2020 · 2 comments
Open

setup.py install fails when building repo cloned from Github #2

vladak opened this issue Feb 5, 2020 · 2 comments

Comments

@vladak
Copy link
Member

vladak commented Feb 5, 2020

Trying to build the IPS repo cloned from Github results in exception in pydates:

$ python3.7 ./src/setup.py install
running install
running build
running build_py
Traceback (most recent call last):
  File "/home/vkotal/solaris-ips/src/pydates", line 36, in <module>
    repo = localrepo.instance(myui, cmdutil.findrepo(os.getcwd()), False)
  File "/usr/lib/python2.7/dist-packages/mercurial/localrepo.py", line 2810, in instance
    localpath = util.urllocalpath(path)
  File "/usr/lib/python2.7/dist-packages/mercurial/util.py", line 2947, in urllocalpath
    return url(path, parsequery=False, parsefragment=False).localpath()
  File "/usr/lib/python2.7/dist-packages/mercurial/util.py", line 2726, in __init__
    if hasdriveletter(path) or path.startswith('\\\\'):
AttributeError: 'NoneType' object has no attribute 'startswith'

This is because it constructs a Mercurial repository object from cmdutil.findrepo(os.getcwd()). Of course, the repo cloned from Github is Git repo and not a Mercurial repo as the findrepo() expects, therefore it returns None.

@vladak
Copy link
Member Author

vladak commented Feb 5, 2020

possible workaround:

diff --git a/src/setup.py b/src/setup.py
index 9b94832b..af247a95 100755
--- a/src/setup.py
+++ b/src/setup.py
@@ -1303,7 +1303,7 @@ class build_py_func(_build_py):
                 self.timestamps = {}
 
                 p = subprocess.Popen(
-                    ["/usr/bin/python2.7", os.path.join(pwd, "pydates")],
+                    ["find", "src/modules", "-maxdepth", "1", "-name", "*.py", "-printf", '%C@ %p\n'],
                     stdout=subprocess.PIPE)
 
                 for line in p.stdout:

Okay, does not contain the . entry.

@citrus-it
Copy link

Some forks of this project use a pydate.git python script like this one:

https://github.com/omniosorg/pkg5/blob/master/src/pydates.git

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants