From c6a04d10b9ca37e2080a03493180e5f25ba35a23 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Aug 11 2016 14:50:41 +0000 Subject: [PATCH 1/3] Use full imports instead of relative ones When running the application from a git checkout, these imports fail if they are relative ones. --- diff --git a/pagure_importer/app.py b/pagure_importer/app.py index 1c2b507..054c422 100644 --- a/pagure_importer/app.py +++ b/pagure_importer/app.py @@ -13,10 +13,10 @@ __all__ = [ 'app', ] -from .commands import fedorahosted -from .commands import github -from .commands import clone -from .commands import push +import pagure_importer.commands.fedorahosted +import pagure_importer.commands.github +import pagure_importer.commands.clone +import pagure_importer.commands.push if __name__ == '__main__': app() From 1c9df5a4e8c6a5bb7e750c5c1a3da0b5adc1bbf8 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Aug 11 2016 14:51:21 +0000 Subject: [PATCH 2/3] Document how to run pagure_importer from a git clone and couple of other fixes --- diff --git a/README.md b/README.md index 6aa91fb..9f91801 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,8 @@ CLI tool for importing issues etc. from different sources like github to pagure ## Installation --- -1. Install it using ```pip``` . ```pip install pagure_importer``` +* Install it using ```pip``` . ```pip install pagure_importer``` + ## How to run --- @@ -14,6 +15,18 @@ CLI tool for importing issues etc. from different sources like github to pagure 4. The script will make commits in your cloned repo: push the changes back to pagure. Use : ```pgimport push foobar.git``` +## Run from git +--- + +* Install the dependencies: + + sudo dnf install python-github python-pygit2 python-fedora python-click + +* Run the application + + python pagure_importer/app.py + + ## Usage --- @@ -62,6 +75,8 @@ The push command can be used to push a clone pagure ticket repo back to pagure. 1. [PyGithub](https://github.com/PyGithub/PyGithub) - a python library for [github](https://github.com/) api. 2. [click](https://github.com/pallets/click) - Python package for creating beautiful command line interfaces 3. [python-fedora](https://fedorahosted.org/python-fedora/) - A collection of python code that allows programs to talk to Fedora Services +4. [pygit2](http://pygit2.org/) - A Python bindings to the libgit2 to interact + with git from python. ## How it works: Github Issues From 555d8ae3b58a87df8d3eee3801989190935d0414 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Aug 11 2016 14:55:22 +0000 Subject: [PATCH 3/3] Specify the PYTHONPATH to run the app --- diff --git a/README.md b/README.md index 9f91801..fb4d216 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ CLI tool for importing issues etc. from different sources like github to pagure * Run the application - python pagure_importer/app.py + PYTHONPATH=. python pagure_importer/app.py ## Usage