Skip to content

Commit 394d7f3

Browse files
tulinkryVladimir Kotal
authored andcommitted
moving all package to opengrok-tools
1 parent c25ffb4 commit 394d7f3

File tree

11 files changed

+50
-35
lines changed

11 files changed

+50
-35
lines changed

opengrok-tools/setup.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,15 @@ def my_test_suite():
2323
version='1.1rc63',
2424
packages=[
2525
'opengrok_tools',
26-
'all',
27-
'all.utils',
28-
'all.scm',
26+
'opengrok_tools.all',
27+
'opengrok_tools.all.utils',
28+
'opengrok_tools.all.scm',
2929
],
3030
package_dir={
3131
'opengrok_tools': 'src/main/python/opengrok_tools',
32-
'all': 'src/main/python/opengrok_tools/all',
33-
'all.scm': 'src/main/python/opengrok_tools/all/scm',
34-
'all.utils': 'src/main/python/opengrok_tools/all/utils',
32+
'opengrok_tools.all': 'src/main/python/opengrok_tools/all',
33+
'opengrok_tools.all.scm': 'src/main/python/opengrok_tools/all/scm',
34+
'opengrok_tools.all.utils': 'src/main/python/opengrok_tools/all/utils',
3535
},
3636
url='https://github.com/OpenGrok/OpenGrok',
3737
license='CDDL',

opengrok-tools/src/main/python/README.md

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,29 @@ python -m pip install -r requirements.txt
4545

4646
## Developing
4747

48-
Start developing, making changes in files. Test your changes with usual python commands.
48+
When you start developing, install the package in a development mode.
4949

5050
```bash
51-
python src/main/python/opengrok_tools/groups.py
52-
python src/main/python/opengrok_tools/sync.py
51+
python setup.py develop
5352
```
5453

54+
This installs the package however keeping the links directly to your source,
55+
so you can edit the files and see the immediate results.
56+
57+
Start developing, making changes in files. Test your changes with calling the entry points.
58+
59+
```bash
60+
export PYTHONPATH=`pwd`/src/main/python:$PYTHONPATH
61+
opengrok-groups
62+
opengrok-sync
63+
```
64+
65+
It is necessary to set the python path as the python interpreter is not able to find the packages
66+
in our provided structure on its own.
67+
68+
Also you call the opengrok tools scripts by the entry points then (`opengrok-groups`, ...).
69+
Calling directly the python script `groups.py` would lead to error related to relative imports.
70+
5571
## Installation
5672

5773
Test installing your package into the local environment

opengrok-tools/src/main/python/opengrok_tools/config_merge.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
import os
2727
import sys
2828

29-
from all.utils.java import Java, get_javaparser
29+
from .all.utils.java import Java, get_javaparser
3030

3131
"""
3232
Wrapper for Java program merging OpenGrok configuration.

opengrok-tools/src/main/python/opengrok_tools/deploy.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@
2929
import tempfile
3030
from shutil import copyfile
3131

32-
from all.utils.command import Command
33-
from all.utils.utils import get_command
32+
from .all.utils.command import Command
33+
from .all.utils.utils import get_command
3434

3535
"""
3636
deploy war file

opengrok-tools/src/main/python/opengrok_tools/groups.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
import os
2727
import sys
2828

29-
from all.utils.java import Java, get_javaparser
29+
from .all.utils.java import Java, get_javaparser
3030

3131
"""
3232
Script for manipulating project groups

opengrok-tools/src/main/python/opengrok_tools/indexer.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
import os
2929
import sys
3030

31-
from all.utils.indexer import FindCtags, Indexer
32-
from all.utils.java import get_javaparser
31+
from .all.utils.indexer import FindCtags, Indexer
32+
from .all.utils.java import get_javaparser
3333

3434
"""
3535
opengrok.jar wrapper
@@ -39,7 +39,6 @@
3939

4040

4141
def main():
42-
4342
parser = argparse.ArgumentParser(description='OpenGrok indexer wrapper',
4443
parents=[get_javaparser()])
4544
parser.add_argument('-C', '--no_ctags_check', action='store_true',

opengrok-tools/src/main/python/opengrok_tools/java.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
import os
2828
import sys
2929

30-
from all.utils.java import Java, get_javaparser
30+
from .all.utils.java import Java, get_javaparser
3131

3232

3333
def main():

opengrok-tools/src/main/python/opengrok_tools/mirror.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,13 @@
3737
import tempfile
3838
from logging.handlers import RotatingFileHandler
3939

40-
from all.utils.filelock import Timeout, FileLock
41-
from all.utils.hook import run_hook
42-
from all.utils.opengrok import get_repos, get_config_value, get_repo_type
43-
from all.utils.readconfig import read_config
44-
from all.utils.repofactory import get_repository
45-
from all.utils.utils import is_exe, check_create_dir, get_int, diff_list
46-
from all.scm.repository import RepositoryException
40+
from .all.utils.filelock import Timeout, FileLock
41+
from .all.utils.hook import run_hook
42+
from .all.utils.opengrok import get_repos, get_config_value, get_repo_type
43+
from .all.utils.readconfig import read_config
44+
from .all.utils.repofactory import get_repository
45+
from .all.utils.utils import is_exe, check_create_dir, get_int, diff_list
46+
from .all.scm.repository import RepositoryException
4747

4848

4949
major_version = sys.version_info[0]

opengrok-tools/src/main/python/opengrok_tools/projadm.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@
3535
import tempfile
3636
from os import path
3737

38-
from all.utils.command import Command
39-
from all.utils.filelock import Timeout, FileLock
40-
from all.utils.opengrok import get_configuration, set_configuration, \
38+
from .all.utils.command import Command
39+
from .all.utils.filelock import Timeout, FileLock
40+
from .all.utils.opengrok import get_configuration, set_configuration, \
4141
add_project, delete_project, get_config_value
42-
from all.utils.utils import get_command
42+
from .all.utils.utils import get_command
4343

4444
MAJOR_VERSION = sys.version_info[0]
4545
if (MAJOR_VERSION < 3):

opengrok-tools/src/main/python/opengrok_tools/reindex_project.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@
2828
import sys
2929
import tempfile
3030

31-
from all.utils.indexer import Indexer
32-
from all.utils.java import get_javaparser
33-
from all.utils.opengrok import get_configuration
31+
from .all.utils.indexer import Indexer
32+
from .all.utils.java import get_javaparser
33+
from .all.utils.opengrok import get_configuration
3434

3535
"""
3636
OpenGrok reindexing script for single project. Makes sure it uses

0 commit comments

Comments
 (0)